Le 02/05/2013 17:48, Сергей Василюгин a écrit :
> 
> 
> 02.05.2013, 22:24, "John Crispin" <[email protected]>:
>> On 02/05/13 17:07, Сергей Василюгин wrote:
>>
>>>            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) {
>>>  - mode&= ~(m<<  rt_gpio_pinmux.uart_shift);
>>
>>   this line should be
>>         mode&= ~(rt_gpio_pinmux.uart_mask <<  rt_gpio_pinmux.uart_shift);
>>
>> could you try with just that one line changed ?
> 
> I'm sure it will work. But clarity of code is the main question. It's not 
> obvious that uart_mask is equivalent to uartfull gpio mode. Just add 
> uart_default_mode field?

No, this doesn't. The problem is that 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 the 
uart_mask (all bits in the uart_mask set to 1), I will send a working patch 
following this message.

-Michel
> 
>>>                            mode |= (m<<  rt_gpio_pinmux.uart_shift);
>>>                            pr_debug("pinmux: registered uartmux \"%s\"\n", 
>>> uart);
>>>                    } else {
>>>  + mode |= rt_gpio_pinmux.uart_mask<<  rt_gpio_pinmux.uart_shift;
>>>                            pr_debug("pinmux: registered uartmux 
>>> \"gpio\"\n");
>>>                    }
>>>            }
>>
>> _______________________________________________
>> openwrt-devel mailing list
>> [email protected]
>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
> 
> ---
> serge
> _______________________________________________
> openwrt-devel mailing list
> [email protected]
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
> 
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to