+#endif
+#ifdef CONFIG_ARCH_RK2928
+static void dwc_otg_pcd_check_vbus_timer( unsigned long pdata )
+{
+ dwc_otg_pcd_t * _pcd = (dwc_otg_pcd_t *)pdata;
+ unsigned long flags;
+ unsigned int usbgrf_status = *(unsigned int*)(USBGRF_SOC_STATUS0);//@lyz USBGRF_SOC_STATUS0½á¹¹Óбä
+
+ local_irq_save(flags);
+ _pcd->check_vbus_timer.expires = jiffies + (HZ); /* 1 s */
+ if((usbgrf_status &(1<<10)) == 0){ // id low //@lyz SOC_STATUS0[10] represents id_dig
+
+ if( _pcd->phy_suspend)
+ dwc_otg20phy_suspend( 1 );
+ }
+ else if(usbgrf_status & (1<<7)){ //@lyz SOC_STATUS0[7] represents bvalid
+ /* if usb not connect before ,then start connect */
+ if( _pcd->vbus_status == 0 ) {
+ DWC_PRINT("********vbus detect*********************************************\n");
+ dwc_otg_msc_lock(_pcd);
+ _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");
+ goto connect;
+ }
+ else if(_pcd->conn_status ==3){
+ //*Á¬½Ó²»ÉÏʱÊÍ·ÅËø£¬ÔÊÐíϵͳ½øÈë¶þ¼¶Ë¯Ãߣ¬yk@rk,20100331*//
+ dwc_otg_msc_unlock(_pcd);
+ _pcd->conn_status++;
+ if((dwc_read_reg32((uint32_t*)((uint8_t *)_pcd->otg_dev->base + DWC_OTG_HOST_PORT_REGS_OFFSET))&0xc00) == 0xc00)
+ _pcd->vbus_status = 2;
+ }
+ }else {
+ _pcd->vbus_status = 0;
+ if(_pcd->conn_status)
+ {
+ _pcd->conn_status = 0;
+ 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 )
+ /* no vbus detect here , close usb phy */
+ dwc_otg20phy_suspend( 0 );
+ }
+ add_timer(&_pcd->check_vbus_timer);
+ local_irq_restore(flags);
+ return;
+
+connect:
+ if( _pcd->phy_suspend == 1 )
+ dwc_otg20phy_suspend( 1 );
+ 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);
+ local_irq_restore(flags);
+ return;
+}
+