mfd: twl6040: Add twl6040-gpio child

Add needed platform data structure and code to be able to load
the GPO child of twl6040.
Update the devicetree binding documentation at the same time.

Signed-off-by: Sergio Aguirre <[email protected]>
Signed-off-by: Peter Ujfalusi <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
This commit is contained in:
Peter Ujfalusi 2012-08-16 15:13:14 +03:00 • committed by Samuel Ortiz
commit 5cbe786a6e
3 changed files with 29 additions and 4 deletions

View file

@ -631,6 +631,21 @@ static int __devinit twl6040_probe(struct i2c_client *client,
children++;
}
/*
* Enable the GPO driver in the following cases:
* DT booted kernel or legacy boot with valid gpo platform_data
*/
if (!pdata || (pdata && pdata->gpo)) {
cell = &twl6040->cells[children];
cell->name = "twl6040-gpo";
if (pdata) {
cell->platform_data = pdata->gpo;
cell->pdata_size = sizeof(*pdata->gpo);
}
children++;
}
ret = mfd_add_devices(&client->dev, -1, twl6040->cells, children,
NULL, 0, NULL);
if (ret)