From: Meng Dongyang Date: Wed, 12 Oct 2016 07:55:39 +0000 (+0800) Subject: usb: dwc3: rockchip: enable dwc3 to be a wakeup source X-Git-Tag: firefly_0821_release~1413 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1a1e029209e91694272cd56833bd75afd086df05;p=firefly-linux-kernel-4.4.55.git usb: dwc3: rockchip: enable dwc3 to be a wakeup source Enable dwc3 to be wakeup source in runtime resume callback function and disable dwc3 to be wake up source in runtime suspend. Change pd in order to control usb pd base on the connect state of usb controller and fix the detect fail bug of otg port after suspend and resume. Change-Id: Ic204a82952eb5dd626945189e18a3d2cc40aa6d9 Signed-off-by: Meng Dongyang --- diff --git a/drivers/usb/dwc3/dwc3-rockchip.c b/drivers/usb/dwc3/dwc3-rockchip.c index 198f67158c33..323d7ef402f6 100644 --- a/drivers/usb/dwc3/dwc3-rockchip.c +++ b/drivers/usb/dwc3/dwc3-rockchip.c @@ -501,6 +501,8 @@ static int dwc3_rockchip_runtime_suspend(struct device *dev) for (i = 0; i < rockchip->num_clocks; i++) clk_disable(rockchip->clks[i]); + device_init_wakeup(dev, false); + return 0; } @@ -512,6 +514,8 @@ static int dwc3_rockchip_runtime_resume(struct device *dev) for (i = 0; i < rockchip->num_clocks; i++) clk_enable(rockchip->clks[i]); + device_init_wakeup(dev, true); + return 0; }