1c6fa7c0390f9c8e54d803db5970ad1d963fdebe
[openwrt/staging/dedeckeh.git] / target / linux / brcm63xx / patches-4.9 / 101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch
1 From 8e9bf528a122741f0171b89c297b63041116d704 Mon Sep 17 00:00:00 2001
2 From: Florian Fainelli <florian@openwrt.org>
3 Date: Mon, 28 Jan 2013 20:06:20 +0100
4 Subject: [PATCH 02/11] MIPS: BCM63XX: add USB device clock enable delay to
5 clock code
6
7 This patch adds the required 10 micro seconds delay to the USB device
8 clock enable operation. Put this where the correct clock knowledege is,
9 which is in the clock code, and remove this delay from the bcm63xx_udc
10 gadget driver where it was before.
11
12 Signed-off-by: Florian Fainelli <florian@openwrt.org>
13 ---
14 arch/mips/bcm63xx/clk.c | 5 +++++
15 drivers/usb/gadget/bcm63xx_udc.c | 1 -
16 2 files changed, 5 insertions(+), 1 deletion(-)
17
18 --- a/arch/mips/bcm63xx/clk.c
19 +++ b/arch/mips/bcm63xx/clk.c
20 @@ -235,6 +235,11 @@ static void usbd_set(struct clk *clk, in
21 bcm_hwclock_set(CKCTL_6362_USBD_EN, enable);
22 else if (BCMCPU_IS_6368())
23 bcm_hwclock_set(CKCTL_6368_USBD_EN, enable);
24 + else
25 + return;
26 +
27 + if (enable)
28 + udelay(10);
29 }
30
31 static struct clk clk_usbd = {
32 --- a/drivers/usb/gadget/udc/bcm63xx_udc.c
33 +++ b/drivers/usb/gadget/udc/bcm63xx_udc.c
34 @@ -410,7 +410,6 @@ static inline void set_clocks(struct bcm
35 if (is_enabled) {
36 clk_enable(udc->usbh_clk);
37 clk_enable(udc->usbd_clk);
38 - udelay(10);
39 } else {
40 clk_disable(udc->usbd_clk);
41 clk_disable(udc->usbh_clk);