This patch adds the required 10 micro seconds delay to the USB device
clock enable operation. Put this where the correct clock knowledege is,
which is in the clock code, and remove this delay from the bcm63xx_udc
gadget driver where it was before.

Signed-off-by: Florian Fainelli <flor...@openwrt.org>
---
 arch/mips/bcm63xx/clk.c          |    5 +++++
 drivers/usb/gadget/bcm63xx_udc.c |    1 -
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c
index a39aeb8..1f1a6c1 100644
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
@@ -182,6 +182,11 @@ static void usbd_set(struct clk *clk, int enable)
                bcm_hwclock_set(CKCTL_6328_USBD_EN, enable);
        else if (BCMCPU_IS_6368())
                bcm_hwclock_set(CKCTL_6368_USBD_EN, enable);
+       else
+               return;
+
+       if (enable)
+               udelay(10);
 }
 
 static struct clk clk_usbd = {
diff --git a/drivers/usb/gadget/bcm63xx_udc.c b/drivers/usb/gadget/bcm63xx_udc.c
index 47a4993..ad17533 100644
--- a/drivers/usb/gadget/bcm63xx_udc.c
+++ b/drivers/usb/gadget/bcm63xx_udc.c
@@ -386,7 +386,6 @@ static inline void set_clocks(struct bcm63xx_udc *udc, bool 
is_enabled)
        if (is_enabled) {
                clk_enable(udc->usbh_clk);
                clk_enable(udc->usbd_clk);
-               udelay(10);
        } else {
                clk_disable(udc->usbd_clk);
                clk_disable(udc->usbh_clk);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to