usb: gadget: fsl_udc: Removed unnecessary checks
authorBenoit Goby <benoit@android.com>
Wed, 29 Sep 2010 23:17:18 +0000 (16:17 -0700)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:28:58 +0000 (16:28 -0700)
The OTG driver disables the gadget device when the cable is
removed, so there is no need to check if the cable is plugged
before touching registers.

Change-Id: I0b1a3a8b07560d3eca2e2e25574b5219e3373808
Signed-off-by: Benoit Goby <benoit@android.com>
drivers/usb/gadget/fsl_udc_core.c

index 1242c1a57e43032711e54161c73780d199b141ae..68715f5183be7036198d284d0384897c23c71c88 100644 (file)
@@ -307,16 +307,6 @@ static void dr_controller_run(struct fsl_udc *udc)
 #ifdef CONFIG_ARCH_TEGRA
        unsigned long timeout;
 #define FSL_UDC_RUN_TIMEOUT 1000
-       /* If OTG transceiver is available, then it handles the VBUS detection */
-       if (!udc_controller->transceiver) {
-               /* Enable cable detection interrupt, without setting the
-                * USB_SYS_VBUS_WAKEUP_INT bit. USB_SYS_VBUS_WAKEUP_INT is
-                * clear on write */
-               temp = fsl_readl(&usb_sys_regs->vbus_wakeup);
-               temp |= (USB_SYS_VBUS_WAKEUP_INT_ENABLE | USB_SYS_VBUS_WAKEUP_ENABLE);
-               temp &= ~USB_SYS_VBUS_WAKEUP_INT_STATUS;
-               fsl_writel(temp, &usb_sys_regs->vbus_wakeup);
-       }
 #endif
        /* Clear stopped bit */
        udc->stopped = 0;
@@ -613,19 +603,13 @@ static int fsl_ep_disable(struct usb_ep *_ep)
        }
 
        /* disable ep on controller */
-#ifdef CONFIG_ARCH_TEGRA
-       /* Touch the registers if cable is connected and phy is on */
-       if (fsl_readl(&usb_sys_regs->vbus_wakeup) & USB_SYS_VBUS_STATUS)
-#endif
-       {
-               ep_num = ep_index(ep);
-               epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]);
-               if (ep_is_in(ep))
-                       epctrl &= ~EPCTRL_TX_ENABLE;
-               else
-                       epctrl &= ~EPCTRL_RX_ENABLE;
-               fsl_writel(epctrl, &dr_regs->endptctrl[ep_num]);
-       }
+       ep_num = ep_index(ep);
+       epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]);
+       if (ep_is_in(ep))
+               epctrl &= ~EPCTRL_TX_ENABLE;
+       else
+               epctrl &= ~EPCTRL_RX_ENABLE;
+       fsl_writel(epctrl, &dr_regs->endptctrl[ep_num]);
 
        udc = (struct fsl_udc *)ep->udc;
        spin_lock_irqsave(&udc->lock, flags);
@@ -1051,12 +1035,6 @@ static void fsl_ep_fifo_flush(struct usb_ep *_ep)
        unsigned long timeout;
 #define FSL_UDC_FLUSH_TIMEOUT 1000
 
-#ifdef CONFIG_ARCH_TEGRA
-       /* Touch the registers if cable is connected and phy is on */
-       if (!(fsl_readl(&usb_sys_regs->vbus_wakeup) & USB_SYS_VBUS_STATUS))
-               return;
-#endif
-
        if (!_ep) {
                return;
        } else {