diff options
author | José Miguel Gonçalves <jose.goncalves@inov.pt> | 2013-09-18 11:52:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-26 18:41:38 -0400 |
commit | 2d1e5a48965be57eefce033894d9795672f6ab63 (patch) | |
tree | a57d34b67852312525d0e7e2329118c17fe1a14d /drivers/tty | |
parent | 4190390ad282e5f69bdb02af094c09787f34ca38 (diff) |
serial: samsung: add support for manual RTS setting
The Samsung serial driver currently does not support setting the
RTS pin with an ioctl(TIOCMSET) call. This patch adds this support.
Changes in v2:
- Preserve the RTS pin's manual setting in set_termios() also when
enabling CRTSCTS.
Signed-off-by: José Miguel Gonçalves <jose.goncalves@inov.pt>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/samsung.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 81f3dbabaaed..c1af04d46682 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c | |||
@@ -407,7 +407,14 @@ static unsigned int s3c24xx_serial_get_mctrl(struct uart_port *port) | |||
407 | 407 | ||
408 | static void s3c24xx_serial_set_mctrl(struct uart_port *port, unsigned int mctrl) | 408 | static void s3c24xx_serial_set_mctrl(struct uart_port *port, unsigned int mctrl) |
409 | { | 409 | { |
410 | /* todo - possibly remove AFC and do manual CTS */ | 410 | unsigned int umcon = rd_regl(port, S3C2410_UMCON); |
411 | |||
412 | if (mctrl & TIOCM_RTS) | ||
413 | umcon |= S3C2410_UMCOM_RTS_LOW; | ||
414 | else | ||
415 | umcon &= ~S3C2410_UMCOM_RTS_LOW; | ||
416 | |||
417 | wr_regl(port, S3C2410_UMCON, umcon); | ||
411 | } | 418 | } |
412 | 419 | ||
413 | static void s3c24xx_serial_break_ctl(struct uart_port *port, int break_state) | 420 | static void s3c24xx_serial_break_ctl(struct uart_port *port, int break_state) |
@@ -774,8 +781,6 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, | |||
774 | if (termios->c_cflag & CSTOPB) | 781 | if (termios->c_cflag & CSTOPB) |
775 | ulcon |= S3C2410_LCON_STOPB; | 782 | ulcon |= S3C2410_LCON_STOPB; |
776 | 783 | ||
777 | umcon = (termios->c_cflag & CRTSCTS) ? S3C2410_UMCOM_AFC : 0; | ||
778 | |||
779 | if (termios->c_cflag & PARENB) { | 784 | if (termios->c_cflag & PARENB) { |
780 | if (termios->c_cflag & PARODD) | 785 | if (termios->c_cflag & PARODD) |
781 | ulcon |= S3C2410_LCON_PODD; | 786 | ulcon |= S3C2410_LCON_PODD; |
@@ -792,6 +797,15 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, | |||
792 | 797 | ||
793 | wr_regl(port, S3C2410_ULCON, ulcon); | 798 | wr_regl(port, S3C2410_ULCON, ulcon); |
794 | wr_regl(port, S3C2410_UBRDIV, quot); | 799 | wr_regl(port, S3C2410_UBRDIV, quot); |
800 | |||
801 | umcon = rd_regl(port, S3C2410_UMCON); | ||
802 | if (termios->c_cflag & CRTSCTS) { | ||
803 | umcon |= S3C2410_UMCOM_AFC; | ||
804 | /* Disable RTS when RX FIFO contains 63 bytes */ | ||
805 | umcon &= ~S3C2412_UMCON_AFC_8; | ||
806 | } else { | ||
807 | umcon &= ~S3C2410_UMCOM_AFC; | ||
808 | } | ||
795 | wr_regl(port, S3C2410_UMCON, umcon); | 809 | wr_regl(port, S3C2410_UMCON, umcon); |
796 | 810 | ||
797 | if (ourport->info->has_divslot) | 811 | if (ourport->info->has_divslot) |