usb: dwc_otg_310: set operational mode of phy to normal when suspend for rk3368
authorMeng Dongyang <daniel.meng@rock-chips.com>
Tue, 17 Jan 2017 03:46:57 +0000 (11:46 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 1 Aug 2017 06:47:45 +0000 (14:47 +0800)
The phy driver of otg port set operational mode to non-driving
when suspend and set to normal when resume. But if we connect
with low speed, it may be disconnected after suspend and resume
by the changing of operational mode. In addition, the linestate
change interrupt flag can't be cleared if the operational mode
is non-driving. This patch set operational mode to normal even
if the phy is suspended, and make sure that operational mode is
same during suspend and resume.

Change-Id: I670d2cbd4e7c4dc115a735feef848f36f120c295
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
drivers/usb/dwc_otg_310/usbdev_rk3368.c

index 3272e4e99c5fcdd604c1c7f9be0d9e40f1cef616..1507bd37f0207c19da4f40923f7ecf8bbf5adfff 100644 (file)
@@ -37,7 +37,7 @@ static void usb20otg_phy_suspend(void *pdata, int suspend)
        struct dwc_otg_platform_data *usbpdata = pdata;
        if (suspend) {
                /* enable soft control */
-               uoc_write(UOC_HIWORD_UPDATE(0x1d5, 0x1ff, 0), 0x700);
+               uoc_write(UOC_HIWORD_UPDATE(0x1d1, 0x1ff, 0), 0x700);
                usbpdata->phy_status = 1;
        } else {
                /* exit suspend */
@@ -240,7 +240,7 @@ static void usb20ehci_phy_suspend(void *pdata, int suspend)
 
        if (suspend) {
                /* enable soft control */
-               uoc_write(UOC_HIWORD_UPDATE(0x1d5, 0x1ff, 0), 0x728);
+               uoc_write(UOC_HIWORD_UPDATE(0x1d1, 0x1ff, 0), 0x728);
                usbpdata->phy_status = 1;
        } else {
                /* exit suspend */