From: William Wu Date: Fri, 11 Nov 2016 08:50:21 +0000 (+0800) Subject: CHROMIUM: usb: dwc3: rockchip: Check for plug/unplug events on resume X-Git-Tag: firefly_0821_release~1278 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=firefly-linux-kernel-4.4.55.git;a=commitdiff_plain;h=0e7d2a179dd2945ef0f91db0ac24ba78781fb1cc CHROMIUM: usb: dwc3: rockchip: Check for plug/unplug events on resume Check on resume if the cable state has changed to detect devices (un)plugged during suspend. TEST=build and boot on rk3399 board. No USB device plugged. Set system enter suspend. Wait for device to suspend. Plug USB device. Wakeup system; Verify USB device is enumerated. Change-Id: Iadbefe6737fa3ddfe2da1a66473f876411a4412a Signed-off-by: William Wu Signed-off-by: Matthias Kaehlcke Reviewed-on: https://chromium-review.googlesource.com/395528 Reviewed-by: Guenter Roeck --- diff --git a/drivers/usb/dwc3/dwc3-rockchip.c b/drivers/usb/dwc3/dwc3-rockchip.c index 0488af0b29be..a0051c1d9b2c 100644 --- a/drivers/usb/dwc3/dwc3-rockchip.c +++ b/drivers/usb/dwc3/dwc3-rockchip.c @@ -543,6 +543,9 @@ static int dwc3_rockchip_resume(struct device *dev) rockchip->suspended = false; + if (rockchip->edev) + schedule_work(&rockchip->otg_work); + return 0; }