Commit 99999961 authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Linus Torvalds
Browse files

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: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Ralf Baechle <ralf@linux-mips.org>
Acked-by: default avatarAlan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 84f8c6fc
Loading
Loading
Loading
Loading
+11 −3
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@


#include <asm/io.h>
#include <asm/io.h>


static char *serial_version = "1.09";
static char *serial_version = "1.10";
static char *serial_name = "TX39/49 Serial driver";
static char *serial_name = "TX39/49 Serial driver";


#define PASS_LIMIT	256
#define PASS_LIMIT	256
@@ -436,8 +436,10 @@ static unsigned int serial_txx9_get_mctrl(struct uart_port *port)
	struct uart_txx9_port *up = (struct uart_txx9_port *)port;
	struct uart_txx9_port *up = (struct uart_txx9_port *)port;
	unsigned int ret;
	unsigned int ret;


	ret =  ((sio_in(up, TXX9_SIFLCR) & TXX9_SIFLCR_RTSSC) ? 0 : TIOCM_RTS)
	/* no modem control lines */
		| ((sio_in(up, TXX9_SICISR) & TXX9_SICISR_CTSS) ? 0 : TIOCM_CTS);
	ret = TIOCM_CAR | TIOCM_DSR;
	ret |= (sio_in(up, TXX9_SIFLCR) & TXX9_SIFLCR_RTSSC) ? 0 : TIOCM_RTS;
	ret |= (sio_in(up, TXX9_SICISR) & TXX9_SICISR_CTSS) ? 0 : TIOCM_CTS;


	return ret;
	return ret;
}
}
@@ -557,6 +559,12 @@ serial_txx9_set_termios(struct uart_port *port, struct ktermios *termios,
	unsigned long flags;
	unsigned long flags;
	unsigned int baud, quot;
	unsigned int baud, quot;


	/*
	 * We don't support modem control lines.
	 */
	termios->c_cflag &= ~(HUPCL | CMSPAR);
	termios->c_cflag |= CLOCAL;

	cval = sio_in(up, TXX9_SILCR);
	cval = sio_in(up, TXX9_SILCR);
	/* byte size and parity */
	/* byte size and parity */
	cval &= ~TXX9_SILCR_UMODE_MASK;
	cval &= ~TXX9_SILCR_UMODE_MASK;