aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/at91/patches
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2015-02-19 09:06:56 +0000
committerJohn Crispin <john@openwrt.org>2015-02-19 09:06:56 +0000
commit3cf87e67b2bcb206a964211b08dd4e268d5e9455 (patch)
tree2896c9c7d428c857920f8f3659d099f53ffd263e /target/linux/at91/patches
parent6fb59689c669728db1ea0defb164bffa3a8a07f4 (diff)
downloadupstream-3cf87e67b2bcb206a964211b08dd4e268d5e9455.tar.gz
upstream-3cf87e67b2bcb206a964211b08dd4e268d5e9455.tar.bz2
upstream-3cf87e67b2bcb206a964211b08dd4e268d5e9455.zip
at91: USB gadget subsystem cleanup and driver fix.
Signed-off-by: Owen Kirby <osk@exegin.com> SVN-Revision: 44491
Diffstat (limited to 'target/linux/at91/patches')
-rw-r--r--target/linux/at91/patches/100-ARM-at91-build-dtb-for-LMU5000.patch2
-rw-r--r--target/linux/at91/patches/200-ARM-at91-udc-clockfix-backport.patch82
2 files changed, 83 insertions, 1 deletions
diff --git a/target/linux/at91/patches/100-ARM-at91-build-dtb-for-LMU5000.patch b/target/linux/at91/patches/100-ARM-at91-build-dtb-for-LMU5000.patch
index e8cc68d13d..8852b6a4f0 100644
--- a/target/linux/at91/patches/100-ARM-at91-build-dtb-for-LMU5000.patch
+++ b/target/linux/at91/patches/100-ARM-at91-build-dtb-for-LMU5000.patch
@@ -1,6 +1,6 @@
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
-@@ -26,6 +26,7 @@ dtb-$(CONFIG_ARCH_AT91) += usb_a9g20.dtb
+@@ -28,6 +28,7 @@ dtb-$(CONFIG_ARCH_AT91) += usb_a9g20.dtb
dtb-$(CONFIG_ARCH_AT91) += usb_a9g20_lpw.dtb
# sam9g45
dtb-$(CONFIG_ARCH_AT91) += at91sam9m10g45ek.dtb
diff --git a/target/linux/at91/patches/200-ARM-at91-udc-clockfix-backport.patch b/target/linux/at91/patches/200-ARM-at91-udc-clockfix-backport.patch
new file mode 100644
index 0000000000..1aec3d00b8
--- /dev/null
+++ b/target/linux/at91/patches/200-ARM-at91-udc-clockfix-backport.patch
@@ -0,0 +1,82 @@
+--- a/drivers/usb/gadget/udc/at91_udc.c
++++ b/drivers/usb/gadget/udc/at91_udc.c
+@@ -870,8 +870,6 @@
+ return;
+ udc->clocked = 1;
+
+- if (IS_ENABLED(CONFIG_COMMON_CLK))
+- clk_enable(udc->uclk);
+ clk_enable(udc->iclk);
+ clk_enable(udc->fclk);
+ }
+@@ -884,8 +882,6 @@
+ udc->gadget.speed = USB_SPEED_UNKNOWN;
+ clk_disable(udc->fclk);
+ clk_disable(udc->iclk);
+- if (IS_ENABLED(CONFIG_COMMON_CLK))
+- clk_disable(udc->uclk);
+ }
+
+ /*
+@@ -1766,27 +1762,18 @@
+ udc_reinit(udc);
+
+ /* get interface and function clocks */
+- udc->iclk = clk_get(dev, "udc_clk");
+- udc->fclk = clk_get(dev, "udpck");
+- if (IS_ENABLED(CONFIG_COMMON_CLK))
+- udc->uclk = clk_get(dev, "usb_clk");
+- if (IS_ERR(udc->iclk) || IS_ERR(udc->fclk) ||
+- (IS_ENABLED(CONFIG_COMMON_CLK) && IS_ERR(udc->uclk))) {
++ udc->iclk = clk_get(dev, "pclk");
++ udc->fclk = clk_get(dev, "hclk");
++ if (IS_ERR(udc->iclk) || IS_ERR(udc->fclk)) {
+ DBG("clocks missing\n");
+ retval = -ENODEV;
+ goto fail1;
+ }
+
+- /* don't do anything until we have both gadget driver and VBUS */
+- if (IS_ENABLED(CONFIG_COMMON_CLK)) {
+- clk_set_rate(udc->uclk, 48000000);
+- retval = clk_prepare(udc->uclk);
+- if (retval)
+- goto fail1;
+- }
++ clk_set_rate(udc->fclk, 48000000);
+ retval = clk_prepare(udc->fclk);
+ if (retval)
+- goto fail1a;
++ goto fail1;
+
+ retval = clk_prepare_enable(udc->iclk);
+ if (retval)
+@@ -1860,12 +1847,7 @@
+ clk_unprepare(udc->iclk);
+ fail1b:
+ clk_unprepare(udc->fclk);
+-fail1a:
+- if (IS_ENABLED(CONFIG_COMMON_CLK))
+- clk_unprepare(udc->uclk);
+ fail1:
+- if (IS_ENABLED(CONFIG_COMMON_CLK) && !IS_ERR(udc->uclk))
+- clk_put(udc->uclk);
+ if (!IS_ERR(udc->fclk))
+ clk_put(udc->fclk);
+ if (!IS_ERR(udc->iclk))
+@@ -1911,15 +1893,11 @@
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ release_mem_region(res->start, resource_size(res));
+
+- if (IS_ENABLED(CONFIG_COMMON_CLK))
+- clk_unprepare(udc->uclk);
+ clk_unprepare(udc->fclk);
+ clk_unprepare(udc->iclk);
+
+ clk_put(udc->iclk);
+ clk_put(udc->fclk);
+- if (IS_ENABLED(CONFIG_COMMON_CLK))
+- clk_put(udc->uclk);
+
+ return 0;
+ }