summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-08-16 15:13:14 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2012-09-19 12:21:20 +0200
commit5cbe786a6e32e80149f7b29def50b2bf563f6628 (patch)
tree60dd5b609a0bb3c7515810dd6ac639bb3c163816 /drivers/mfd
parent35736dce6c05bab8e8b1eb7c74f5b8b0fbb7886d (diff)
downloadlinux-5cbe786a6e32e80149f7b29def50b2bf563f6628.tar.gz
linux-5cbe786a6e32e80149f7b29def50b2bf563f6628.tar.bz2
linux-5cbe786a6e32e80149f7b29def50b2bf563f6628.zip
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 <saaguirre@ti.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/twl6040-core.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c
index 348e1de8e7c1..3f2a1cf02fc0 100644
--- a/drivers/mfd/twl6040-core.c
+++ b/drivers/mfd/twl6040-core.c
@@ -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)