diff mbox

[v3] extcon: usb-gpio: Don't miss event during suspend/resume

Message ID 570BAEFD.2050406@ti.com
State Accepted
Commit 04c080080855ce84dcd490a2e04805608a21085d
Headers show

Commit Message

Roger Quadros April 11, 2016, 2:04 p.m. UTC
Pin state might have changed during suspend/resume while
our interrupts were disabled and if device doesn't support wakeup.

Scan for change during resume for such case.

Signed-off-by: Roger Quadros <rogerq@ti.com>

---
v3:
- use queue_delayed_work() instead of directly calling usb_extcon_detect_cable()

v2:
- only check for state change during resume if device wakeup is 

 drivers/extcon/extcon-usb-gpio.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.5.0
diff mbox

Patch

diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c
index bc61d11..bad2159 100644
--- a/drivers/extcon/extcon-usb-gpio.c
+++ b/drivers/extcon/extcon-usb-gpio.c
@@ -185,6 +185,9 @@  static int usb_extcon_resume(struct device *dev)
 	int ret = 0;
 
 	enable_irq(info->id_irq);
+	if (!device_may_wakeup(dev))
+		queue_delayed_work(system_power_efficient_wq,
+				   &info->wq_detcable, 0);
 
 	return ret;
 }