101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. This patch adds the required 10 micro seconds delay to the USB device
  7. clock enable operation. Put this where the correct clock knowledege is,
  8. which is in the clock code, and remove this delay from the bcm63xx_udc
  9. gadget driver where it was before.
  10. Signed-off-by: Florian Fainelli <florian@openwrt.org>
  11. ---
  12. arch/mips/bcm63xx/clk.c | 5 +++++
  13. drivers/usb/gadget/bcm63xx_udc.c | 1 -
  14. 2 files changed, 5 insertions(+), 1 deletion(-)
  15. --- a/arch/mips/bcm63xx/clk.c
  16. +++ b/arch/mips/bcm63xx/clk.c
  17. @@ -199,6 +199,11 @@ static void usbd_set(struct clk *clk, in
  18. bcm_hwclock_set(CKCTL_6362_USBD_EN, enable);
  19. else if (BCMCPU_IS_6368())
  20. bcm_hwclock_set(CKCTL_6368_USBD_EN, enable);
  21. + else
  22. + return;
  23. +
  24. + if (enable)
  25. + udelay(10);
  26. }
  27. static struct clk clk_usbd = {
  28. --- a/drivers/usb/gadget/udc/bcm63xx_udc.c
  29. +++ b/drivers/usb/gadget/udc/bcm63xx_udc.c
  30. @@ -391,7 +391,6 @@ static inline void set_clocks(struct bcm
  31. if (is_enabled) {
  32. clk_enable(udc->usbh_clk);
  33. clk_enable(udc->usbd_clk);
  34. - udelay(10);
  35. } else {
  36. clk_disable(udc->usbd_clk);
  37. clk_disable(udc->usbh_clk);