extcon: palmas: Don't miss GPIO events during suspend/resume
authorRoger Quadros <rogerq@ti.com>
Wed, 15 Feb 2017 12:31:29 +0000 (14:31 +0200)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 6 Apr 2017 01:55:22 +0000 (10:55 +0900)
The USB cable state can change during suspend/resume
so be sure to check and update the extcon state.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon-palmas.c

index ca904e8..2af4369 100644 (file)
@@ -413,6 +413,12 @@ static int palmas_usb_resume(struct device *dev)
                if (palmas_usb->enable_gpio_id_detection)
                        disable_irq_wake(palmas_usb->gpio_id_irq);
        }
+
+       /* check if GPIO states changed while suspend/resume */
+       if (palmas_usb->enable_gpio_vbus_detection)
+               palmas_vbus_irq_handler(palmas_usb->gpio_vbus_irq, palmas_usb);
+       palmas_gpio_id_detect(&palmas_usb->wq_detectid.work);
+
        return 0;
 };
 #endif