]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/mfd/twl6030-irq.c
Merge branch 'for-paul-38-rebased' of git://gitorious.org/linux-omap-dss2/linux
[mv-sheeva.git] / drivers / mfd / twl6030-irq.c
index aaedb11d9d2c608af0b7e827252cf032c53fdd56..06c8955907e9de84876aa9df73107288244482e5 100644 (file)
@@ -74,7 +74,7 @@ static int twl6030_interrupt_mapping[24] = {
        USBOTG_INTR_OFFSET,     /* Bit 16       ID_WKUP                 */
        USBOTG_INTR_OFFSET,     /* Bit 17       VBUS_WKUP               */
        USBOTG_INTR_OFFSET,     /* Bit 18       ID                      */
-       USBOTG_INTR_OFFSET,     /* Bit 19       VBUS                    */
+       USB_PRES_INTR_OFFSET,   /* Bit 19       VBUS                    */
        CHARGER_INTR_OFFSET,    /* Bit 20       CHRG_CTRL               */
        CHARGER_INTR_OFFSET,    /* Bit 21       EXT_CHRG                */
        CHARGER_INTR_OFFSET,    /* Bit 22       INT_CHRG                */
@@ -128,6 +128,13 @@ static int twl6030_irq_thread(void *data)
 
                sts.bytes[3] = 0; /* Only 24 bits are valid*/
 
+               /*
+                * Since VBUS status bit is not reliable for VBUS disconnect
+                * use CHARGER VBUS detection status bit instead.
+                */
+               if (sts.bytes[2] & 0x10)
+                       sts.bytes[2] |= 0x08;
+
                for (i = 0; sts.int_sts; sts.int_sts >>= 1, i++) {
                        local_irq_disable();
                        if (sts.int_sts & 0x1) {