drm/i915: Wait for LVDS panel power sequence
[linux-2.6.git] / drivers / mfd / twl6030-irq.c
index aaedb11..eb3b5f8 100644 (file)
@@ -74,10 +74,10 @@ 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                */
+       CHARGERFAULT_INTR_OFFSET,       /* Bit 21       EXT_CHRG        */
+       CHARGERFAULT_INTR_OFFSET,       /* Bit 22       INT_CHRG        */
        RSV_INTR_OFFSET,        /* Bit 23       Reserved                */
 };
 /*----------------------------------------------------------------------*/
@@ -128,27 +128,19 @@ 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) {
                                int module_irq = twl6030_irq_base +
                                        twl6030_interrupt_mapping[i];
-                               struct irq_desc *d = irq_to_desc(module_irq);
-
-                               if (!d) {
-                                       pr_err("twl6030: Invalid SIH IRQ: %d\n",
-                                              module_irq);
-                                       return -EINVAL;
-                               }
-
-                               /* These can't be masked ... always warn
-                                * if we get any surprises.
-                                */
-                               if (d->status & IRQ_DISABLED)
-                                       note_interrupt(module_irq, d,
-                                                       IRQ_NONE);
-                               else
-                                       d->handle_irq(module_irq, d);
+                               generic_handle_irq(module_irq);
 
                        }
                local_irq_enable();
@@ -191,7 +183,7 @@ static inline void activate_irq(int irq)
        set_irq_flags(irq, IRQF_VALID);
 #else
        /* same effect on other architectures */
-       set_irq_noprobe(irq);
+       irq_set_noprobe(irq);
 #endif
 }
 
@@ -237,7 +229,7 @@ int twl6030_mmc_card_detect_config(void)
        twl6030_interrupt_unmask(TWL6030_MMCDETECT_INT_MASK,
                                                REG_INT_MSK_STS_B);
        /*
-        * Intially Configuring MMC_CTRL for receving interrupts &
+        * Initially Configuring MMC_CTRL for receiving interrupts &
         * Card status on TWL6030 for MMC1
         */
        ret = twl_i2c_read_u8(TWL6030_MODULE_ID0, &reg_val, TWL6030_MMCCTRL);
@@ -283,7 +275,7 @@ int twl6030_mmc_card_detect(struct device *dev, int slot)
                /* TWL6030 provide's Card detect support for
                 * only MMC1 controller.
                 */
-               pr_err("Unkown MMC controller %d in %s\n", pdev->id, __func__);
+               pr_err("Unknown MMC controller %d in %s\n", pdev->id, __func__);
                return ret;
        }
        /*
@@ -325,11 +317,11 @@ int twl6030_init_irq(int irq_num, unsigned irq_base, unsigned irq_end)
         */
        twl6030_irq_chip = dummy_irq_chip;
        twl6030_irq_chip.name = "twl6030";
-       twl6030_irq_chip.set_type = NULL;
+       twl6030_irq_chip.irq_set_type = NULL;
 
        for (i = irq_base; i < irq_end; i++) {
-               set_irq_chip_and_handler(i, &twl6030_irq_chip,
-                               handle_simple_irq);
+               irq_set_chip_and_handler(i, &twl6030_irq_chip,
+                                        handle_simple_irq);
                activate_irq(i);
        }
 
@@ -358,7 +350,7 @@ fail_irq:
 
 fail_kthread:
        for (i = irq_base; i < irq_end; i++)
-               set_irq_chip_and_handler(i, NULL, NULL);
+               irq_set_chip_and_handler(i, NULL, NULL);
        return status;
 }