Lines Matching +full:odd +full:- +full:parity
1 // SPDX-License-Identifier: GPL-2.0
8 * μPD78F0730 8-bit Single-Chip Microcontroller
9 * USB-to-Serial Conversion Software
10 * <https://www.renesas.com/en-eu/doc/DocumentServer/026/U19660EJ1V0AN00.pdf>
13 * - data bits: 7 or 8
14 * - stop bits: 1 or 2
15 * - parity: even, odd or none
16 * - flow control: none
17 * - baud rates: 0, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 153600
18 * - signals: DTR, RTS and BREAK
32 { USB_DEVICE(0x0409, 0x0063) }, /* V850ESJX3-STICK */
34 { USB_DEVICE(0x064B, 0x7825) }, /* Analog Devices EVAL-ADXL362Z-DB */
49 /* Op-codes of control commands */
61 /* Stop-bit modes in UPD78F0730_CMD_LINE_CONTROL command */
66 /* Parity modes in UPD78F0730_CMD_LINE_CONTROL command */
131 struct usb_device *usbdev = port->serial->dev; in upd78f0730_send_ctl()
136 return -EINVAL; in upd78f0730_send_ctl()
140 return -ENOMEM; in upd78f0730_send_ctl()
149 struct device *dev = &port->dev; in upd78f0730_send_ctl()
166 return -ENOMEM; in upd78f0730_port_probe()
168 mutex_init(&private->lock); in upd78f0730_port_probe()
179 mutex_destroy(&private->lock); in upd78f0730_port_remove()
186 struct usb_serial_port *port = tty->driver_data; in upd78f0730_tiocmget()
192 mutex_lock(&private->lock); in upd78f0730_tiocmget()
193 signals = private->line_signals; in upd78f0730_tiocmget()
194 mutex_unlock(&private->lock); in upd78f0730_tiocmget()
199 dev_dbg(&port->dev, "%s - res = %x\n", __func__, res); in upd78f0730_tiocmget()
207 struct usb_serial_port *port = tty->driver_data; in upd78f0730_tiocmset()
210 struct device *dev = &port->dev; in upd78f0730_tiocmset()
215 mutex_lock(&private->lock); in upd78f0730_tiocmset()
217 private->line_signals |= UPD78F0730_DTR; in upd78f0730_tiocmset()
218 dev_dbg(dev, "%s - set DTR\n", __func__); in upd78f0730_tiocmset()
221 private->line_signals |= UPD78F0730_RTS; in upd78f0730_tiocmset()
222 dev_dbg(dev, "%s - set RTS\n", __func__); in upd78f0730_tiocmset()
225 private->line_signals &= ~UPD78F0730_DTR; in upd78f0730_tiocmset()
226 dev_dbg(dev, "%s - clear DTR\n", __func__); in upd78f0730_tiocmset()
229 private->line_signals &= ~UPD78F0730_RTS; in upd78f0730_tiocmset()
230 dev_dbg(dev, "%s - clear RTS\n", __func__); in upd78f0730_tiocmset()
233 request.params = private->line_signals; in upd78f0730_tiocmset()
236 mutex_unlock(&private->lock); in upd78f0730_tiocmset()
244 struct usb_serial_port *port = tty->driver_data; in upd78f0730_break_ctl()
246 struct device *dev = &port->dev; in upd78f0730_break_ctl()
250 mutex_lock(&private->lock); in upd78f0730_break_ctl()
252 private->line_signals |= UPD78F0730_BREAK; in upd78f0730_break_ctl()
253 dev_dbg(dev, "%s - set BREAK\n", __func__); in upd78f0730_break_ctl()
255 private->line_signals &= ~UPD78F0730_BREAK; in upd78f0730_break_ctl()
256 dev_dbg(dev, "%s - clear BREAK\n", __func__); in upd78f0730_break_ctl()
259 request.params = private->line_signals; in upd78f0730_break_ctl()
262 mutex_unlock(&private->lock); in upd78f0730_break_ctl()
267 struct tty_struct *tty = port->port.tty; in upd78f0730_dtr_rts()
287 for (i = ARRAY_SIZE(supported) - 1; i >= 0; i--) { in upd78f0730_get_baud_rate()
302 struct device *dev = &port->dev; in upd78f0730_set_termios()
306 if (old_termios && !tty_termios_hw_change(&tty->termios, old_termios)) in upd78f0730_set_termios()
311 else if (old_termios && (old_termios->c_cflag & CBAUD) == B0) in upd78f0730_set_termios()
318 dev_dbg(dev, "%s - baud rate = %d\n", __func__, baud_rate); in upd78f0730_set_termios()
323 dev_dbg(dev, "%s - 7 data bits\n", __func__); in upd78f0730_set_termios()
326 tty->termios.c_cflag &= ~CSIZE; in upd78f0730_set_termios()
327 tty->termios.c_cflag |= CS8; in upd78f0730_set_termios()
332 dev_dbg(dev, "%s - 8 data bits\n", __func__); in upd78f0730_set_termios()
339 dev_dbg(dev, "%s - odd parity\n", __func__); in upd78f0730_set_termios()
342 dev_dbg(dev, "%s - even parity\n", __func__); in upd78f0730_set_termios()
346 tty->termios.c_cflag &= ~CMSPAR; in upd78f0730_set_termios()
347 dev_warn(dev, "MARK/SPACE parity is not supported\n"); in upd78f0730_set_termios()
351 dev_dbg(dev, "%s - no parity\n", __func__); in upd78f0730_set_termios()
356 dev_dbg(dev, "%s - 2 stop bits\n", __func__); in upd78f0730_set_termios()
359 dev_dbg(dev, "%s - 1 stop bit\n", __func__); in upd78f0730_set_termios()
363 tty->termios.c_cflag &= ~CRTSCTS; in upd78f0730_set_termios()
367 tty->termios.c_iflag &= ~(IXOFF | IXON); in upd78f0730_set_termios()
371 dev_dbg(dev, "%s - no flow control\n", __func__); in upd78f0730_set_termios()