mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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:
parent
35736dce6c
commit
5cbe786a6e
3 changed files with 29 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue