forked from Minki/linux
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>
This commit is contained in:
parent
2b6bfd4d4a
commit
80ec831e80
@ -935,6 +935,11 @@ static int twl_remove(struct i2c_client *client)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct of_dev_auxdata twl_auxdata_lookup[] = {
|
||||||
|
OF_DEV_AUXDATA("ti,twl4030-gpio", 0, "twl4030-gpio", NULL),
|
||||||
|
{ /* sentinel */ },
|
||||||
|
};
|
||||||
|
|
||||||
/* NOTE: This driver only handles a single twl4030/tps659x0 chip */
|
/* NOTE: This driver only handles a single twl4030/tps659x0 chip */
|
||||||
static int
|
static int
|
||||||
twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
twl_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)
|
|||||||
twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1);
|
twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node)
|
if (node) {
|
||||||
status = of_platform_populate(node, NULL, NULL, &client->dev);
|
if (pdata)
|
||||||
else
|
twl_auxdata_lookup[0].platform_data = pdata->gpio;
|
||||||
|
status = of_platform_populate(node, NULL, twl_auxdata_lookup,
|
||||||
|
&client->dev);
|
||||||
|
} else {
|
||||||
status = add_children(pdata, irq_base, id->driver_data);
|
status = add_children(pdata, irq_base, id->driver_data);
|
||||||
|
}
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user