From: Benoit Goby Date: Wed, 29 Sep 2010 23:17:18 +0000 (-0700) Subject: usb: gadget: fsl_udc: Removed unnecessary checks X-Git-Tag: firefly_0821_release~9833^2~192 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4929bfebc75c4ca1407c377c7b0599b26a783788;p=firefly-linux-kernel-4.4.55.git usb: gadget: fsl_udc: Removed unnecessary checks 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 --- diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index 1242c1a57e43..68715f5183be 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -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 {