aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/8250/8250.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-07-12 13:00:31 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-12 14:48:11 -0700
commiteb26dfe8aa7eeb5a5aa0b7574550125f8aa4c3b3 (patch)
tree8734be494ef3888bf39d0f0a472cc37c5843c4b6 /drivers/tty/serial/8250/8250.c
parent8250: propogate the bugs field (diff)
downloadlinux-dev-eb26dfe8aa7eeb5a5aa0b7574550125f8aa4c3b3.tar.xz
linux-dev-eb26dfe8aa7eeb5a5aa0b7574550125f8aa4c3b3.zip
8250: add support for ASIX devices with a FIFO bug
Information and a different patch provided by <donald@asix.com.tw>. We do it a little differently to keep the modularity and to avoid playing with RLSI. We add a new uart bug for the parity flaw and set it in the pci matches. If parity check is enabled then we drop the FIFO trigger to 1 as per the Asix reference code. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/8250/8250.c')
-rw-r--r--drivers/tty/serial/8250/8250.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
index ca42d16e5a12..44f52c6f15b9 100644
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -2202,6 +2202,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
unsigned char cval, fcr = 0;
unsigned long flags;
unsigned int baud, quot;
+ int fifo_bug = 0;
switch (termios->c_cflag & CSIZE) {
case CS5:
@@ -2221,8 +2222,11 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
if (termios->c_cflag & CSTOPB)
cval |= UART_LCR_STOP;
- if (termios->c_cflag & PARENB)
+ if (termios->c_cflag & PARENB) {
cval |= UART_LCR_PARITY;
+ if (up->bugs & UART_BUG_PARITY)
+ fifo_bug = 1;
+ }
if (!(termios->c_cflag & PARODD))
cval |= UART_LCR_EPAR;
#ifdef CMSPAR
@@ -2246,7 +2250,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
if (up->capabilities & UART_CAP_FIFO && port->fifosize > 1) {
fcr = uart_config[port->type].fcr;
- if (baud < 2400) {
+ if (baud < 2400 || fifo_bug) {
fcr &= ~UART_FCR_TRIGGER_MASK;
fcr |= UART_FCR_TRIGGER_1;
}