atmel_serial: fix RTS high after initialization in RS485 mode
authorClaudio Scordino <[email protected]>
Thu, 13 Jan 2011 23:45:39 +0000 (15:45 -0800)
committerLinus Torvalds <[email protected]>
Fri, 14 Jan 2011 01:32:31 +0000 (17:32 -0800)
When working in RS485 mode, the atmel_serial driver keeps RTS high after
the initialization of the serial port.  It goes low only after the first
character has been sent.

[[email protected]: simplify code]
Signed-off-by: Claudio Scordino <[email protected]>
Signed-off-by: Arkadiusz Bubala <[email protected]>
Tested-by: Arkadiusz Bubala <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Cc: Greg KH <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/serial/atmel_serial.c

index 3892666b5fbdf4cfe36e66f1a6092c7666afd2be..2a1d52fb493646b2c56648aef28d5e24e6805126 100644 (file)
@@ -1732,6 +1732,11 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
        device_init_wakeup(&pdev->dev, 1);
        platform_set_drvdata(pdev, port);
 
+       if (port->rs485.flags & SER_RS485_ENABLED) {
+               UART_PUT_MR(&port->uart, ATMEL_US_USMODE_NORMAL);
+               UART_PUT_CR(&port->uart, ATMEL_US_RTSEN);
+       }
+
        return 0;
 
 err_add_port: