linux-mips
[Top] [All Lists]

[PATCH 01/13] MIPS: BCM63XX: add USB host clock enable delay

To: linux-mips@linux-mips.org
Subject: [PATCH 01/13] MIPS: BCM63XX: add USB host clock enable delay
From: Florian Fainelli <florian@openwrt.org>
Date: Mon, 28 Jan 2013 20:06:19 +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
Knowledge of the clock setup delay should remain at the clock level (so
it can be clock specific and CPU specific). Add the 100 milliseconds
required clock delay for the USB host clock when it gets enabled.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
 arch/mips/bcm63xx/clk.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c
index b9e948d..a39aeb8 100644
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
@@ -162,6 +162,11 @@ static void usbh_set(struct clk *clk, int enable)
                bcm_hwclock_set(CKCTL_6348_USBH_EN, enable);
        else if (BCMCPU_IS_6368())
                bcm_hwclock_set(CKCTL_6368_USBH_EN, enable);
+       else
+               return;
+
+       if (enable)
+               msleep(100);
 }
 
 static struct clk clk_usbh = {
-- 
1.7.10.4


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