Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial_txx9: Fix modem control line handling

This chip does not have modem control lines. Return TIOCM_CAR and
TIOCM_DSR always on get_mctrl() and ajust some bits in termios cflag.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Atsushi Nemoto and committed by
Linus Torvalds
99999961 84f8c6fc

+11 -3
+11 -3
drivers/serial/serial_txx9.c
··· 37 37 38 38 #include <asm/io.h> 39 39 40 - static char *serial_version = "1.09"; 40 + static char *serial_version = "1.10"; 41 41 static char *serial_name = "TX39/49 Serial driver"; 42 42 43 43 #define PASS_LIMIT 256 ··· 436 436 struct uart_txx9_port *up = (struct uart_txx9_port *)port; 437 437 unsigned int ret; 438 438 439 - ret = ((sio_in(up, TXX9_SIFLCR) & TXX9_SIFLCR_RTSSC) ? 0 : TIOCM_RTS) 440 - | ((sio_in(up, TXX9_SICISR) & TXX9_SICISR_CTSS) ? 0 : TIOCM_CTS); 439 + /* no modem control lines */ 440 + ret = TIOCM_CAR | TIOCM_DSR; 441 + ret |= (sio_in(up, TXX9_SIFLCR) & TXX9_SIFLCR_RTSSC) ? 0 : TIOCM_RTS; 442 + ret |= (sio_in(up, TXX9_SICISR) & TXX9_SICISR_CTSS) ? 0 : TIOCM_CTS; 441 443 442 444 return ret; 443 445 } ··· 558 556 unsigned int cval, fcr = 0; 559 557 unsigned long flags; 560 558 unsigned int baud, quot; 559 + 560 + /* 561 + * We don't support modem control lines. 562 + */ 563 + termios->c_cflag &= ~(HUPCL | CMSPAR); 564 + termios->c_cflag |= CLOCAL; 561 565 562 566 cval = sio_in(up, TXX9_SILCR); 563 567 /* byte size and parity */