this commit cause host1 usb phy stop 480MHz clk output in suspend mode.
authorwlf <wulf@rock-chips.com>
Fri, 25 Apr 2014 09:31:02 +0000 (17:31 +0800)
committerwlf <wulf@rock-chips.com>
Fri, 25 Apr 2014 09:31:02 +0000 (17:31 +0800)
Revert "USB: set SIDDQ to place USB PHY into a low power state."

This reverts commit d4cb6899acfe231372e72c2e8b0c4e8f5f9efe15.

drivers/usb/dwc_otg_310/dwc_otg_driver.c
drivers/usb/dwc_otg_310/usbdev_rk32.c

index b3bf80e761334934f58a6af3993509b68e0c3b3e..49026c432d17e19ef634f807f6bf636d8666f3d5 100755 (executable)
@@ -1576,22 +1576,74 @@ static struct platform_driver dwc_otg_driver = {
 
 void rk_usb_power_up(void)
 {
+       struct dwc_otg_platform_data *pldata_otg;
+       struct dwc_otg_platform_data *pldata_host;
+       struct rkehci_platform_data *pldata_ehci;
+
        if(cpu_is_rk3288()){
 #ifdef CONFIG_RK_USB_UART
                /* enable USB bypass UART function  */
                writel_relaxed(0x00c00000 | usb_to_uart_status, RK_GRF_VIRT + RK3288_GRF_UOC0_CON3);
 
 #endif
+               /* unset siddq,the analog blocks are powered up */
+#ifdef CONFIG_USB20_OTG
+               if((pldata_otg = &usb20otg_pdata_rk3288)){
+                       if(pldata_otg->phy_status == USB_PHY_SUSPEND)
+                               writel_relaxed((0x01<<13)<<16, RK_GRF_VIRT + RK3288_GRF_UOC0_CON0);
+               }
+#endif
+#ifdef CONFIG_USB20_HOST
+               if((pldata_host = &usb20host_pdata_rk3288)){
+                       if(pldata_host->phy_status == USB_PHY_SUSPEND)
+                               writel_relaxed((0x01<<13)<<16, RK_GRF_VIRT + RK3288_GRF_UOC2_CON0);
+               }
+#endif
+#ifdef CONFIG_USB_EHCI_RK
+               if((pldata_ehci = &rkehci_pdata_rk3288)){
+                       if(pldata_ehci->phy_status == USB_PHY_SUSPEND)
+                               writel_relaxed((0x01<<13)<<16, RK_GRF_VIRT + RK3288_GRF_UOC1_CON0);
+               }
+#endif
+
        }
 }
 
 void rk_usb_power_down(void)
 {
+       struct dwc_otg_platform_data *pldata_otg;
+       struct dwc_otg_platform_data *pldata_host;
+       struct rkehci_platform_data *pldata_ehci;
+
        if(cpu_is_rk3288()){
 #ifdef CONFIG_RK_USB_UART
                /* disable USB bypass UART function */
                usb_to_uart_status = readl_relaxed(RK_GRF_VIRT + RK3288_GRF_UOC0_CON3);
                writel_relaxed(0x00c00000, RK_GRF_VIRT + RK3288_GRF_UOC0_CON3);
+#endif
+               /* set siddq,the analog blocks are powered down
+                * note:
+                * 1. Before asserting SIDDQ, ensure that VDATSRCENB0,
+                * VDATDETENB0, DCDENB0, BYPASSSEL0, ADPPRBENB0,
+                * and TESTBURNIN are set to 1'b0.
+                * 2. Before asserting SIDDQ, ensure that phy enter suspend.*/
+#ifdef CONFIG_USB20_OTG
+               if((pldata_otg = &usb20otg_pdata_rk3288)){
+                       if(pldata_otg->phy_status == USB_PHY_SUSPEND)
+                               writel_relaxed((0x01<<13)|((0x01<<13)<<16), RK_GRF_VIRT + RK3288_GRF_UOC0_CON0);
+               }
+#endif
+#ifdef CONFIG_USB20_HOST
+               if((pldata_host = &usb20host_pdata_rk3288)){
+                       if(pldata_host->phy_status == USB_PHY_SUSPEND)
+                               writel_relaxed((0x01<<13)|((0x01<<13)<<16), RK_GRF_VIRT + RK3288_GRF_UOC2_CON0);
+               }
+#endif
+#ifdef CONFIG_USB_EHCI_RK
+               if((pldata_ehci = &rkehci_pdata_rk3288)){
+                       if(pldata_ehci->phy_status == USB_PHY_SUSPEND)
+                               writel_relaxed((0x01<<13)|((0x01<<13)<<16), RK_GRF_VIRT + RK3288_GRF_UOC1_CON0);
+               }
 #endif
        }
 }
index 35fe365f5aa6f16d36ac2413b0ac043ceddd8642..e06ce4b3c3a8075cb4395a59adb7997010443496 100755 (executable)
@@ -35,20 +35,9 @@ static void usb20otg_phy_suspend(void* pdata, int suspend)
                control_usb->grf_uoc0_base->CON2 = (0x01<<2)|((0x01<<2)<<16);
                //enter suspend
                control_usb->grf_uoc0_base->CON3 = 0x2A|(0x3F<<16);
-               mdelay(1);
-               /* set siddq,the analog blocks are powered down
-                * note:
-                * 1. Before asserting SIDDQ, ensure that VDATSRCENB0,
-                * VDATDETENB0, DCDENB0, BYPASSSEL0, ADPPRBENB0,
-                * and TESTBURNIN are set to 1'b0.
-                * 2. Before asserting SIDDQ, ensure that phy enter suspend.*/
-               control_usb->grf_uoc0_base->CON0 = (0x01<<13)|((0x01<<13)<<16);
                usbpdata->phy_status = 1;
        }else{
-               /* unset siddq,the analog blocks are powered up */
-               control_usb->grf_uoc0_base->CON0 = (0x01<<13)<<16;
-               mdelay(1);
-               //exit suspend
+               // exit suspend.
                control_usb->grf_uoc0_base->CON2 = ((0x01<<2)<<16);
                usbpdata->phy_status = 0;
        }
@@ -208,15 +197,9 @@ static void usb20host_phy_suspend(void* pdata, int suspend)
                control_usb->grf_uoc2_base->CON2 = (0x01<<2)|((0x01<<2)<<16);
                // enter suspend
                control_usb->grf_uoc2_base->CON3 = 0x2A|(0x3F<<16); 
-               mdelay(1);
-               // set siddq
-               control_usb->grf_uoc2_base->CON0 = (0x01<<13)|((0x01<<13)<<16);
                usbpdata->phy_status = 1;
        }else{
-               // unset siddq
-               control_usb->grf_uoc2_base->CON0 = (0x01<<13)<<16;
-               mdelay(1);
-               // exit suspend
+               //exit suspend.
                control_usb->grf_uoc2_base->CON2 = ((0x01<<2)<<16);
                usbpdata->phy_status = 0;
        }
@@ -459,14 +442,8 @@ static void rk_ehci_phy_suspend(void* pdata, int suspend)
                control_usb->grf_uoc1_base->CON2 = (0x01<<2)|((0x01<<2)<<16);
                // enter suspend
                control_usb->grf_uoc1_base->CON3 = 0x2A|(0x3F<<16);
-               mdelay(1);
-               // set siddq
-               control_usb->grf_uoc1_base->CON0 = (0x01<<13) | ((0x01<<13) << 16);
                usbpdata->phy_status = 1;
        }else{
-               // unset siddq
-               control_usb->grf_uoc1_base->CON0 = ((0x01<<13) << 16);
-               mdelay(1);
                // exit suspend
                control_usb->grf_uoc1_base->CON2 = ((0x01<<2)<<16);
                usbpdata->phy_status = 0;