aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl-core.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-11-15 19:36:03 -0500
committerLee Jones <lee.jones@linaro.org>2014-01-21 03:13:38 -0500
commit80ec831e8069c3da06bd96db196422d736d364bc (patch)
treeb71c4933beeded85782719c8d77af5976540067a /drivers/mfd/twl-core.c
parent2b6bfd4d4af86310903804b35183e3b50b469591 (diff)
mfd: twl-core: Fix passing of platform data in the device tree case
Since we still need to rely on a mix of device tree initialized drivers and legacy platform data initialize drivers, let's fix the passing of platform data to twl4030-gpio. As the twl4030 GPIO is initialized by twl-core.c, we need to register the auxdata for twl4030 GPIO in twl-core.c. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/twl-core.c')
-rw-r--r--drivers/mfd/twl-core.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index c3c28b985c01..f0aa4cef9ad0 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -935,6 +935,11 @@ static int twl_remove(struct i2c_client *client)
935 return 0; 935 return 0;
936} 936}
937 937
938static struct of_dev_auxdata twl_auxdata_lookup[] = {
939 OF_DEV_AUXDATA("ti,twl4030-gpio", 0, "twl4030-gpio", NULL),
940 { /* sentinel */ },
941};
942
938/* NOTE: This driver only handles a single twl4030/tps659x0 chip */ 943/* NOTE: This driver only handles a single twl4030/tps659x0 chip */
939static int 944static int
940twl_probe(struct i2c_client *client, const struct i2c_device_id *id) 945twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
@@ -1073,10 +1078,14 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
1073 twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1); 1078 twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1);
1074 } 1079 }
1075 1080
1076 if (node) 1081 if (node) {
1077 status = of_platform_populate(node, NULL, NULL, &client->dev); 1082 if (pdata)
1078 else 1083 twl_auxdata_lookup[0].platform_data = pdata->gpio;
1084 status = of_platform_populate(node, NULL, twl_auxdata_lookup,
1085 &client->dev);
1086 } else {
1079 status = add_children(pdata, irq_base, id->driver_data); 1087 status = add_children(pdata, irq_base, id->driver_data);
1088 }
1080 1089
1081fail: 1090fail:
1082 if (status < 0) 1091 if (status < 0)