summaryrefslogtreecommitdiff
path: root/target/linux/ramips/patches-3.8/0123-MIPS-ralink-fix-uartmux-group-handling.patch
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-04-07 14:46:09 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-04-07 14:46:09 +0000
commit65d5e5579ca500487231eb8f2b28bd4ef121556f (patch)
treea43ac10ec26c22b9238c6c8ae614913c8aa7197a /target/linux/ramips/patches-3.8/0123-MIPS-ralink-fix-uartmux-group-handling.patch
parent2417786e2c6d8ff63dbc1c8ea7aba11df74b2c7f (diff)
ramips: pinmux fixes
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36247 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/patches-3.8/0123-MIPS-ralink-fix-uartmux-group-handling.patch')
-rw-r--r--target/linux/ramips/patches-3.8/0123-MIPS-ralink-fix-uartmux-group-handling.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/target/linux/ramips/patches-3.8/0123-MIPS-ralink-fix-uartmux-group-handling.patch b/target/linux/ramips/patches-3.8/0123-MIPS-ralink-fix-uartmux-group-handling.patch
new file mode 100644
index 0000000000..dee504fe50
--- /dev/null
+++ b/target/linux/ramips/patches-3.8/0123-MIPS-ralink-fix-uartmux-group-handling.patch
@@ -0,0 +1,40 @@
+From 34a9a634432a95d8ae9af86d41fdaf32fb039c2c Mon Sep 17 00:00:00 2001
+From: Gabor Juhos <juhosg@openwrt.org>
+Date: Wed, 27 Mar 2013 21:10:14 +0100
+Subject: [PATCH 1/5] MIPS: ralink: fix uartmux group handling
+
+ * don't try get 'ralink,uartmux' porperty if the pinmux.uart is
+ not initialized,
+ * don't touch 'mode' value if mux mask is zero
+
+Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
+---
+ arch/mips/ralink/pinmux.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+--- a/arch/mips/ralink/pinmux.c
++++ b/arch/mips/ralink/pinmux.c
+@@ -56,15 +56,19 @@ void ralink_pinmux(void)
+ }
+ }
+
+- of_property_read_string(np, "ralink,uartmux", &uart);
++ uart = NULL;
++ if (rt_pinmux.uart)
++ of_property_read_string(np, "ralink,uartmux", &uart);
++
+ if (uart) {
+ int m = ralink_mux_mask(uart, rt_pinmux.uart);
+- mode |= rt_pinmux.uart_mask << rt_pinmux.uart_shift;
++
+ if (m) {
+- mode &= ~(m << rt_pinmux.uart_shift);
++ mode &= ~(rt_pinmux.uart_mask << rt_pinmux.uart_shift);
++ mode |= m << rt_pinmux.uart_shift;
+ pr_debug("pinmux: registered uartmux \"%s\"\n", uart);
+ } else {
+- pr_debug("pinmux: registered uartmux \"gpio\"\n");
++ pr_debug("pinmux: unknown uartmux \"%s\"\n", uart);
+ }
+ }
+