aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ftdi_sio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r--drivers/usb/serial/ftdi_sio.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 9ced8937a8f3..fb0d537435eb 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -2123,6 +2123,20 @@ static void ftdi_set_termios(struct tty_struct *tty,
2123 termios->c_cflag |= CRTSCTS; 2123 termios->c_cflag |= CRTSCTS;
2124 } 2124 }
2125 2125
2126 /*
2127 * All FTDI UART chips are limited to CS7/8. We won't pretend to
2128 * support CS5/6 and revert the CSIZE setting instead.
2129 */
2130 if ((C_CSIZE(tty) != CS8) && (C_CSIZE(tty) != CS7)) {
2131 dev_warn(ddev, "requested CSIZE setting not supported\n");
2132
2133 termios->c_cflag &= ~CSIZE;
2134 if (old_termios)
2135 termios->c_cflag |= old_termios->c_cflag & CSIZE;
2136 else
2137 termios->c_cflag |= CS8;
2138 }
2139
2126 cflag = termios->c_cflag; 2140 cflag = termios->c_cflag;
2127 2141
2128 if (!old_termios) 2142 if (!old_termios)
@@ -2159,19 +2173,16 @@ no_skip:
2159 } else { 2173 } else {
2160 urb_value |= FTDI_SIO_SET_DATA_PARITY_NONE; 2174 urb_value |= FTDI_SIO_SET_DATA_PARITY_NONE;
2161 } 2175 }
2162 if (cflag & CSIZE) { 2176 switch (cflag & CSIZE) {
2163 switch (cflag & CSIZE) { 2177 case CS7:
2164 case CS7: 2178 urb_value |= 7;
2165 urb_value |= 7; 2179 dev_dbg(ddev, "Setting CS7\n");
2166 dev_dbg(ddev, "Setting CS7\n"); 2180 break;
2167 break; 2181 default:
2168 case CS8: 2182 case CS8:
2169 urb_value |= 8; 2183 urb_value |= 8;
2170 dev_dbg(ddev, "Setting CS8\n"); 2184 dev_dbg(ddev, "Setting CS8\n");
2171 break; 2185 break;
2172 default:
2173 dev_err(ddev, "CSIZE was set but not CS7-CS8\n");
2174 }
2175 } 2186 }
2176 2187
2177 /* This is needed by the break command since it uses the same command 2188 /* This is needed by the break command since it uses the same command