On 03/05/13 13:14, Сергей Василюгин wrote:


03.05.2013, 15:40, "Michel Stempin"<michel.stem...@wanadoo.fr>:
The mask m is only null when there is no "ralink,uartmux" property defined in 
DTS.

When the "ralink,uartmux" property is set to "gpio", m will be equal to 
RT305X_GPIO_MODE_GPIO, i.e. all bits sets in the uart_mask, thus the proper way to do it is to 
compare m against the uart_mask for equality.

Signed-off-by: Michel Stempin<michel.stem...@wanadoo.fr>
---

diff a/target/linux/ramips/patches-3.8/0128-MIPS-ralink-add-pinmux-driver.patch 
b/target/linux/ramips/patches-3.8/0128-MIPS-ralink-add-pinmux-driver.patch
--- a/target/linux/ramips/patches-3.8/0128-MIPS-ralink-add-pinmux-driver.patch
+++ b/target/linux/ramips/patches-3.8/0128-MIPS-ralink-add-pinmux-driver.patch
@@ -112,7 +112,7 @@ Signed-off-by: John Crispin<blo...@openwrt.org>
  +      if (uart) {
  +              int m = ralink_mux_mask(uart, rt_gpio_pinmux.uart);
  +              mode |= rt_gpio_pinmux.uart_mask<<  rt_gpio_pinmux.uart_shift;
-+              if (m) {
++              if (m != rt_gpio_pinmux.uart_mask) {
  +                      mode&= ~(m<<  rt_gpio_pinmux.uart_shift);
  +                      pr_debug("pinmux: registered uartmux \"%s\"\n", uart);
  +              } else {

I think you are wrong. If m == 0 (uart full) mode you get ... gpio mode again 
:).

i have a patch in the queu that addresses all these problems properly.
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to