linux-mips
[Top] [All Lists]

[PATCH 02/13] MIPS: BCM63XX: add USB device clock enable delay to clock

To: linux-mips@linux-mips.org
Subject: [PATCH 02/13] MIPS: BCM63XX: add USB device clock enable delay to clock code
From: Florian Fainelli <florian@openwrt.org>
Date: Mon, 28 Jan 2013 20:06:20 +0100
Cc: ralf@linux-mips.org, jogo@openwrt.org, mbizon@freebox.fr, cenerkee@gmail.com, linux-usb@vger.kernel.org, stern@rowland.harvard.edu, gregkh@linuxfoundation.org, blogic@openwrt.org, Florian Fainelli <florian@openwrt.org>
In-reply-to: <1359399991-2236-1-git-send-email-florian@openwrt.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1359399991-2236-1-git-send-email-florian@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
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 <florian@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


<Prev in Thread] Current Thread [Next in Thread>