diff options
author | Tony Lindgren <tony@atomide.com> | 2013-11-15 19:36:03 -0500 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2013-11-21 05:42:36 -0500 |
commit | f984370913d3ba5d13806cc8ac6fc26f8ebd1694 (patch) | |
tree | 10aaa671dc25805d0e3c5fc4bb67a5e3ed32e7f1 | |
parent | 5e01dc7b26d9f24f39abace5da98ccbd6a5ceb52 (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>
-rw-r--r-- | drivers/mfd/twl-core.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 29473c2c95ae..d5b3dd8a940e 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c | |||
@@ -1133,6 +1133,11 @@ static int twl_remove(struct i2c_client *client) | |||
1133 | return 0; | 1133 | return 0; |
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | static struct of_dev_auxdata twl_auxdata_lookup[] = { | ||
1137 | OF_DEV_AUXDATA("ti,twl4030-gpio", 0, "twl4030-gpio", NULL), | ||
1138 | { /* sentinel */ }, | ||
1139 | }; | ||
1140 | |||
1136 | /* NOTE: This driver only handles a single twl4030/tps659x0 chip */ | 1141 | /* NOTE: This driver only handles a single twl4030/tps659x0 chip */ |
1137 | static int | 1142 | static int |
1138 | twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | 1143 | twl_probe(struct i2c_client *client, const struct i2c_device_id *id) |
@@ -1271,10 +1276,14 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1271 | twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1); | 1276 | twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1); |
1272 | } | 1277 | } |
1273 | 1278 | ||
1274 | if (node) | 1279 | if (node) { |
1275 | status = of_platform_populate(node, NULL, NULL, &client->dev); | 1280 | if (pdata) |
1276 | else | 1281 | twl_auxdata_lookup[0].platform_data = pdata->gpio; |
1282 | status = of_platform_populate(node, NULL, twl_auxdata_lookup, | ||
1283 | &client->dev); | ||
1284 | } else { | ||
1277 | status = add_children(pdata, irq_base, id->driver_data); | 1285 | status = add_children(pdata, irq_base, id->driver_data); |
1286 | } | ||
1278 | 1287 | ||
1279 | fail: | 1288 | fail: |
1280 | if (status < 0) | 1289 | if (status < 0) |