Le 03/05/2013 13:26, John Crispin a écrit :
> 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.
Yes, I think Serge is right: I misunderstood his previous post, it looks like 
there is no need for a test on m, except to set up the default value.

Clearing the bits with the mask and setting the wanted ones should do it, 
except when there is no property, where a default value must be used.

6Michel
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to