From fc345ba3f01a59ac0d6574fe9bf049b0b18df1c9 Mon Sep 17 00:00:00 2001 From: yangkai Date: Tue, 8 May 2012 11:40:46 +0800 Subject: [PATCH] pcd suspend with dp,dm hi-z --- drivers/usb/dwc_otg/dwc_otg_pcd.c | 11 +++-------- drivers/usb/dwc_otg/dwc_otg_pcd_intr.c | 1 + 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/usb/dwc_otg/dwc_otg_pcd.c b/drivers/usb/dwc_otg/dwc_otg_pcd.c index 9c50fcb4826b..f14db99ccf29 100755 --- a/drivers/usb/dwc_otg/dwc_otg_pcd.c +++ b/drivers/usb/dwc_otg/dwc_otg_pcd.c @@ -1635,21 +1635,14 @@ int dwc_otg20phy_suspend( int exitsuspend ) clk_enable(pcd->otg_dev->phyclk); pcd->phy_suspend = 0; *otg_phy_con1 = ((0x01<<2)<<16); // exit suspend. -// *otg_phy_con1 |= (0x01<<3); -// *otg_phy_con1 &= ~(0x01<<2); - - /* 20091011,reenable usb phy ,will raise reset intr */ -// DWC_PRINT("enable usb phy 0x%x\n", *otg_phy_con1); DWC_DEBUGPL(DBG_PCDV, "enable usb phy\n"); } if( !exitsuspend && (pcd->phy_suspend == 0)) { pcd->phy_suspend = 1; - *otg_phy_con1 = ((0x01<<2)|(0x00<<3)|(0x05<<6))|(((0x01<<2)|(0x01<<3)|(0x07<<6))<<16); // enter suspend. + *otg_phy_con1 = 0x554|(0xfff<<16); // enter suspend. udelay(3); clk_disable(pcd->otg_dev->phyclk); clk_disable(pcd->otg_dev->ahbclk); - //*otg_phy_con1 &= ~(0x01<<2); -// DWC_PRINT("disable usb phy 0x%x\n", *otg_phy_con1); DWC_DEBUGPL(DBG_PCDV, "disable usb phy\n"); } #endif @@ -1824,6 +1817,8 @@ static void dwc_otg_pcd_check_vbus_timer( unsigned long pdata ) _pcd->vbus_status = 1; if(_pcd->conn_en) goto connect; + else + dwc_otg20phy_suspend( 0 ); } else if((_pcd->conn_en)&&(_pcd->conn_status>=0)&&(_pcd->conn_status <3)){ DWC_PRINT("********soft reconnect******************************************\n"); diff --git a/drivers/usb/dwc_otg/dwc_otg_pcd_intr.c b/drivers/usb/dwc_otg/dwc_otg_pcd_intr.c index 224054ceaabb..ce6a44cdfe85 100755 --- a/drivers/usb/dwc_otg/dwc_otg_pcd_intr.c +++ b/drivers/usb/dwc_otg/dwc_otg_pcd_intr.c @@ -568,6 +568,7 @@ void dwc_otg_pcd_stop(dwc_otg_pcd_t *_pcd) /* don't disconnect drivers more than once */ if (_pcd->ep0state == EP0_DISCONNECT) { + SPIN_UNLOCK(&_pcd->lock); DWC_DEBUGPL(DBG_ANY, "%s() Already Disconnected\n", __func__ ); return; } -- 2.34.1