[PATCH] ARM/serial: at91: switch atmel serial to use gpiolib
From: Linus Walleij <hidden>
Date: 2013-11-06 09:16:45
Also in:
linux-gpio
On Tue, Nov 5, 2013 at 5:28 PM, Jean-Christophe PLAGNIOL-VILLARD [off-list ref] wrote:
On 13:35 Tue 05 Nov , Linus Walleij wrote:
quoted
+ /* + * AT91RM9200 Errata #39: RTS0 is not internally connected + * to PA21. We need to drive the pin as a GPIO. + */ + if (gpio_is_valid(atmel_port->rts_gpio) && + port->mapbase == AT91RM9200_BASE_US0) {
not really a fon of this hack if we use a uart for rs485 we need to use a gpio for rts too
Hm it was completely unnecessary anyway, as I now specify the RTS pin per UART instance, it will only be valid for those setting it right.
quoted
+ /* + * In theory the GPIO pin controlling RTS could be zero and + * this would be an improper check, but we know that the only + * existing case is != 0 and it's nice to use the zero-initialized + * structs to indicate "no RTS GPIO" instead of open-coding some + * invalid value everywhere. + */ + if (pdata->rts_gpio > 0) {
this can not work 0 is a valid gpio if you do this you need to update
ALL the bard filee too to set it as -EINVAL;Isn't it the other way around? I did this exactly to avoid updating all the boardfiles, as the rts_gpio == 0 for all those not defining it. This is why I test for > 0. Yours, Linus Walleij