mfd: cpcap-whisper: Fix defect introduced by I2c374a98
authorGreg Meiste <w30289@motorola.com>
Tue, 7 Sep 2010 14:48:44 +0000 (09:48 -0500)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:51:22 +0000 (16:51 -0700)
Fix issue where the ID Float interrupt may occur during the 200ms
where state is set to USB_POWER, causing the state machine to get
into a bad state.

Change-Id: I99e7b5de84f4b091c5b6e4f3e522876561603b61
Signed-off-by: Greg Meiste <w30289@motorola.com>
drivers/mfd/cpcap-whisper.c

index 64c0bec0a7304bc78d758be871d7daf0153e59bc..45996b890f4df0452d111108225c65fcf2f1ac28 100644 (file)
@@ -418,7 +418,6 @@ static void whisper_det_work(struct work_struct *work)
                } else if ((data->sense & SENSE_USB_HOST_MASK) == SENSE_USB_HOST) {
                        whisper_notify(data, CPCAP_ACCY_USB_HOST);
 
-                       cpcap_irq_unmask(data->cpcap, CPCAP_IRQ_IDFLOAT);
                        data->state = USB_POWER;
                        schedule_delayed_work(&data->work,
                                              msecs_to_jiffies(200));
@@ -496,6 +495,7 @@ static void whisper_det_work(struct work_struct *work)
        case USB_POWER:
                gpio_set_value(data->pdata->pwr_gpio, 1);
                data->state = CONFIG;
+               cpcap_irq_unmask(data->cpcap, CPCAP_IRQ_IDFLOAT);
                break;
 
        case WHISPER: