usb: dwc3: rockchip: enable dwc3 to be a wakeup source
authorMeng Dongyang <daniel.meng@rock-chips.com>
Wed, 12 Oct 2016 07:55:39 +0000 (15:55 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 13 Oct 2016 06:56:51 +0000 (14:56 +0800)
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 <daniel.meng@rock-chips.com>
drivers/usb/dwc3/dwc3-rockchip.c

index 198f67158c3360e9efe382e83aade41c106eacd6..323d7ef402f6e734e65970c8d190c9ca0b033038 100644 (file)
@@ -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;
 }