]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/input/keyboard/omap-twl4030keypad.c
twl4030 "subdriver" irq tweaks
[linux-2.6-omap-h63xx.git] / drivers / input / keyboard / omap-twl4030keypad.c
index 3893d63307171366e5548a92d7f582b1a80efedf..d3e1d2076d32a22bbd822fe44e1690299052a340 100644 (file)
@@ -38,7 +38,6 @@
 #include <linux/i2c.h>
 #include <linux/i2c/twl4030.h>
 #include <linux/irq.h>
-#include <mach/keypad.h>
 #include "twl4030-keypad.h"
 
 #define PTV_PRESCALER          4
@@ -46,6 +45,7 @@
 #define MAX_ROWS               8 /* TWL4030 hardlimit */
 #define ROWCOL_MASK            0xFF000000
 #define KEYNUM_MASK            0x00FFFFFF
+#define KEY(col, row, val) (((col) << 28) | ((row) << 24) | (val))
 
 /* Global variables */
 
@@ -208,6 +208,14 @@ static irqreturn_t do_kp_irq(int irq, void *_kp)
        u8 reg;
        int ret;
 
+#ifdef CONFIG_LOCKDEP
+       /* WORKAROUND for lockdep forcing IRQF_DISABLED on us, which
+        * we don't want and can't tolerate.  Although it might be
+        * friendlier not to borrow this thread context...
+        */
+       local_irq_enable();
+#endif
+
        /* Read & Clear TWL4030 pending interrupt */
        ret = twl4030_kpread(kp, TWL4030_MODULE_KEYPAD, &reg, KEYP_ISR1, 1);
 
@@ -231,14 +239,14 @@ static int __init omap_kp_probe(struct platform_device *pdev)
        int i;
        int ret = 0;
        struct omap_keypad *kp;
-       struct omap_kp_platform_data *pdata = pdev->dev.platform_data;
+       struct twl4030_keypad_data *pdata = pdev->dev.platform_data;
 
        kp = kzalloc(sizeof(*kp), GFP_KERNEL);
        if (!kp)
                return -ENOMEM;
 
        if (!pdata->rows || !pdata->cols || !pdata->keymap) {
-               dev_err(kp->dbg_dev, "No rows, cols or keymap from pdata\n");
+               dev_err(&pdev->dev, "No rows, cols or keymap from pdata\n");
                kfree(kp);
                return -EINVAL;
        }
@@ -340,8 +348,7 @@ static int __init omap_kp_probe(struct platform_device *pdev)
         * This ISR will always execute in kernel thread context because of
         * the need to access the TWL4030 over the I2C bus.
         */
-       ret = request_irq(kp->irq, do_kp_irq, IRQF_DISABLED,
-                       "TWL4030 Keypad", kp);
+       ret = request_irq(kp->irq, do_kp_irq, 0, pdev->name, kp);
        if (ret < 0) {
                dev_info(kp->dbg_dev, "request_irq failed for irq no=%d\n",
                        kp->irq);
@@ -389,7 +396,7 @@ static struct platform_driver omap_kp_driver = {
        .probe          = omap_kp_probe,
        .remove         = __devexit_p(omap_kp_remove),
        .driver         = {
-               .name   = "omap_twl4030keypad",
+               .name   = "twl4030_keypad",
                .owner  = THIS_MODULE,
        },
 };
@@ -409,7 +416,7 @@ static void __exit omap_kp_exit(void)
 
 module_init(omap_kp_init);
 module_exit(omap_kp_exit);
-MODULE_ALIAS("platform:omap_twl4030keypad");
+MODULE_ALIAS("platform:twl4030_keypad");
 MODULE_AUTHOR("Texas Instruments");
 MODULE_DESCRIPTION("OMAP TWL4030 Keypad Driver");
 MODULE_LICENSE("GPL");