From 1a1e029209e91694272cd56833bd75afd086df05 Mon Sep 17 00:00:00 2001 From: Meng Dongyang Date: Wed, 12 Oct 2016 15:55:39 +0800 Subject: [PATCH] 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 --- drivers/usb/dwc3/dwc3-rockchip.c | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.34.1