_pcd->vbus_status = 1;
if(_pcd->conn_en)
goto connect;
- else{
+ else if( pldata->phy_status == USB_PHY_ENABLED ){
// not connect, suspend phy
pldata->phy_suspend(pldata, USB_PHY_SUSPEND);
udelay(3);
_pcd->vbus_status = 2;
// not connect, suspend phy
- pldata->phy_suspend(pldata, USB_PHY_SUSPEND);
- udelay(3);
- pldata->clock_enable( pldata, 0);
+ if( pldata->phy_status == USB_PHY_ENABLED ){
+ pldata->phy_suspend(pldata, USB_PHY_SUSPEND);
+ udelay(3);
+ pldata->clock_enable( pldata, 0);
+ }
}
}else {
_pcd->vbus_status = 0;
_pcd->conn_status = 0;
dwc_otg_msc_unlock(_pcd);
}
- else if( pldata->phy_status == 0 ){
+ else if( pldata->phy_status == USB_PHY_ENABLED ){
/* no vbus detect here , close usb phy */
pldata->phy_suspend(pldata, USB_PHY_SUSPEND);
udelay(3);
connect:
if(_pcd->conn_status==0)
dwc_otg_msc_lock(_pcd);
- pldata->clock_enable( pldata, 1);
- pldata->phy_suspend(pldata, USB_PHY_ENABLED);
+ if( pldata->phy_status){
+ pldata->clock_enable( pldata, 1);
+ pldata->phy_suspend(pldata, USB_PHY_ENABLED);
+ }
schedule_delayed_work( &_pcd->reconnect , 8 ); /* delay 1 jiffies */
_pcd->check_vbus_timer.expires = jiffies + (HZ<<1); /* 1 s */
add_timer(&_pcd->check_vbus_timer);
pcd->vbus_status = 0;
pcd->phy_suspend = 0;
if(dwc_otg_is_device_mode(core_if))
- mod_timer(&pcd->check_vbus_timer, jiffies+(HZ<<2)); // delay 16 S
+ mod_timer(&pcd->check_vbus_timer, jiffies+(HZ<<4)); // delay 16 S
return 0;
}
/**