]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/mfd/twl6040-core.c
Merge branch 'slab/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penber...
[karo-tx-linux.git] / drivers / mfd / twl6040-core.c
index 3dca5c195a200505c3796c488b34b65f8a32b7e6..3f2a1cf02fc0697d2c56c3fcb3f84cc8106fda21 100644 (file)
@@ -584,7 +584,7 @@ static int __devinit twl6040_probe(struct i2c_client *client,
                goto irq_init_err;
 
        ret = request_threaded_irq(twl6040->irq_base + TWL6040_IRQ_READY,
-                                  NULL, twl6040_naudint_handler, 0,
+                                  NULL, twl6040_naudint_handler, IRQF_ONESHOT,
                                   "twl6040_irq_ready", twl6040);
        if (ret) {
                dev_err(twl6040->dev, "READY IRQ request failed: %d\n",
@@ -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)