AnsweredAssumed Answered

Platform data with device tree

Question asked by Jeffrey Coffman on Aug 1, 2017
Latest reply on Aug 1, 2017 by Jeffrey Coffman

I'm in the process of upgrading from 3.0.35 to 4.1.15.  I am new to the world of device trees, etc..  I have a gpio expander chip pca9502 that I used to configure with platform data in a board configuration file, like so:


static const char* gpio_names[PCA9502_NUM_GPIO] = { "program",
"cpudone" };

static struct pca9502_platform_data pca9502_i2c_gpio_data = {
.num_gpio = PCA9502_NUM_GPIO,
.gpio_base = -1,
.names = gpio_names



Now I have moved to a device tree and have the following in my dts:


pca9502: pca9502@49 {
compatible = "nxp,pca9502";
reg = <0x49>;


What I am not sure about is now I pass platform data to the driver, now that I am using the device tree or if that is even possible.  Mainly I need .names for the gpios, and that used to get passed in platform data.  I've tried adding 

gpio-line-names property to my controller in the dts, but that doesn't seem to work or I misunderstand the kernel documentation in regard to it.


The gpios work fine other than they no longer have the aliased names in sysfs.


Is there a way to pass platform data without the old board descriptors in the newer kernel?  Otherwise is there a way to alias the names for controllers gpio lines like I used to be able to?


Thanks in advance.