cp210x.c (05909cd9a0c8811731b38697af13075e8954314f) | cp210x.c (95168d624f3a8dee466525767200391a0fb006b9) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Silicon Laboratories CP210x USB to RS232 serial adaptor driver 4 * 5 * Copyright (C) 2005 Craig Shelley (craig@microtron.org.uk) 6 * 7 * Support to set flow control line levels using TIOCMGET and TIOCMSET 8 * thanks to Karl Hiramoto karl@hiramoto.org. RTSCTS hardware flow --- 1338 unchanged lines hidden (view full) --- 1347 if (ret) { 1348 dev_err(&port->dev, "failed to disable events: %d\n", ret); 1349 return; 1350 } 1351 1352 port_priv->event_mode = false; 1353} 1354 | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Silicon Laboratories CP210x USB to RS232 serial adaptor driver 4 * 5 * Copyright (C) 2005 Craig Shelley (craig@microtron.org.uk) 6 * 7 * Support to set flow control line levels using TIOCMGET and TIOCMSET 8 * thanks to Karl Hiramoto karl@hiramoto.org. RTSCTS hardware flow --- 1338 unchanged lines hidden (view full) --- 1347 if (ret) { 1348 dev_err(&port->dev, "failed to disable events: %d\n", ret); 1349 return; 1350 } 1351 1352 port_priv->event_mode = false; 1353} 1354 |
1355static bool cp210x_termios_change(const struct ktermios *a, const struct ktermios *b) 1356{ 1357 bool iflag_change; 1358 1359 iflag_change = ((a->c_iflag ^ b->c_iflag) & INPCK); 1360 1361 return tty_termios_hw_change(a, b) || iflag_change; 1362} 1363 |
|
1355static void cp210x_set_termios(struct tty_struct *tty, 1356 struct usb_serial_port *port, struct ktermios *old_termios) 1357{ 1358 struct device *dev = &port->dev; 1359 unsigned int cflag, old_cflag; 1360 u16 bits; 1361 | 1364static void cp210x_set_termios(struct tty_struct *tty, 1365 struct usb_serial_port *port, struct ktermios *old_termios) 1366{ 1367 struct device *dev = &port->dev; 1368 unsigned int cflag, old_cflag; 1369 u16 bits; 1370 |
1371 if (!cp210x_termios_change(&tty->termios, old_termios)) 1372 return; 1373 |
|
1362 cflag = tty->termios.c_cflag; 1363 old_cflag = old_termios->c_cflag; 1364 1365 if (tty->termios.c_ospeed != old_termios->c_ospeed) 1366 cp210x_change_speed(tty, port, old_termios); 1367 1368 /* If the number of data bits is to be updated */ 1369 if ((cflag & CSIZE) != (old_cflag & CSIZE)) { --- 744 unchanged lines hidden --- | 1374 cflag = tty->termios.c_cflag; 1375 old_cflag = old_termios->c_cflag; 1376 1377 if (tty->termios.c_ospeed != old_termios->c_ospeed) 1378 cp210x_change_speed(tty, port, old_termios); 1379 1380 /* If the number of data bits is to be updated */ 1381 if ((cflag & CSIZE) != (old_cflag & CSIZE)) { --- 744 unchanged lines hidden --- |