dwc_otg_device->core_if->usb_mode = USB_MODE_FORCE_HOST;
#else
dwc_otg_device->core_if->usb_mode = USB_MODE_NORMAL;
+#ifdef CONFIG_DWC_OTG_DEFAULT_DEVICE
+ dwc_otg_device->core_if->usb_mode = USB_MODE_FORCE_DEVICE;
+#endif
#endif
#endif
*/
#ifdef CONFIG_ARCH_RK29
unsigned int * otg_phy_con1 = (unsigned int*)(USB_GRF_CON);
-#endif
-#ifdef CONFIG_ARCH_RK30
- unsigned int * otg_phy_con1 = (unsigned int*)(USBGRF_UOC1_CON2);
-#endif
-
otgreg = * otg_phy_con1;
otgreg |= (0x01<<13); // software control
otgreg |= (0x01<<14); // exit suspend.
otgreg &= ~(0x01<<13); // software control
*otg_phy_con1 = otgreg;
+#endif
+#ifdef CONFIG_ARCH_RK30
+ unsigned int * otg_phy_con1 = (unsigned int*)(USBGRF_UOC1_CON2);
+ *otg_phy_con1 = ((0x01<<2)<<16); // exit suspend.
+#endif
+
#if 0
*otg_phy_con1 |= (0x01<<2);
*otg_phy_con1 |= (0x01<<3); // exit suspend.
}
#ifdef CONFIG_ARCH_RK30
+ dwc_otg_hcd->host_setenable = 1;
dwc_otg_hcd->connect_detect_timer.function = dwc_otg_hcd_connect_detect;
dwc_otg_hcd->connect_detect_timer.data = (unsigned long)(dwc_otg_hcd);
init_timer( &dwc_otg_hcd->connect_detect_timer);
dwc_otg_msc_unlock(_pcd);
}
/* every 500 ms open usb phy power and start 1 jiffies timer to get vbus */
- if( _pcd->phy_suspend == 0 )
+ else if( _pcd->phy_suspend == 0 )
/* no vbus detect here , close usb phy */
dwc_otg20phy_suspend( 0 );
}
{
SPIN_UNLOCK(&_pcd->lock);
ret = _pcd->driver->setup(&_pcd->gadget, _ctrl);
- if(spin_is_locked(&_pcd->lock)){
+ if(spin_is_locked(&_pcd->lock))
DWC_PRINT("%s warning: pcd->lock locked without unlock\n", __func__);
- SPIN_UNLOCK(&_pcd->lock);
- }
SPIN_LOCK(&_pcd->lock);
if (ret < 0)
{