Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38fcb830 authored by Roland Koebler's avatar Roland Koebler Committed by Greg Kroah-Hartman
Browse files

USB: serial: ftdi_sio: add space/mark parity



Add mark and space parity, since the device supports it.

Signed-off-by: default avatarRoland Koebler <r.koebler@yahoo.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d71cb81a
Loading
Loading
Loading
Loading
+12 −6
Original line number Original line Diff line number Diff line
@@ -2195,15 +2195,21 @@ static void ftdi_set_termios(struct tty_struct *tty,


	/* Set number of data bits, parity, stop bits */
	/* Set number of data bits, parity, stop bits */


	termios->c_cflag &= ~CMSPAR;

	urb_value = 0;
	urb_value = 0;
	urb_value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 :
	urb_value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 :
		      FTDI_SIO_SET_DATA_STOP_BITS_1);
		      FTDI_SIO_SET_DATA_STOP_BITS_1);
	urb_value |= (cflag & PARENB ?
	if (cflag & PARENB) {
		      (cflag & PARODD ? FTDI_SIO_SET_DATA_PARITY_ODD :
		if (cflag & CMSPAR)
		       FTDI_SIO_SET_DATA_PARITY_EVEN) :
			urb_value |= cflag & PARODD ?
		      FTDI_SIO_SET_DATA_PARITY_NONE);
				     FTDI_SIO_SET_DATA_PARITY_MARK :
				     FTDI_SIO_SET_DATA_PARITY_SPACE;
		else
			urb_value |= cflag & PARODD ?
				     FTDI_SIO_SET_DATA_PARITY_ODD :
				     FTDI_SIO_SET_DATA_PARITY_EVEN;
	} else {
		urb_value |= FTDI_SIO_SET_DATA_PARITY_NONE;
	}
	if (cflag & CSIZE) {
	if (cflag & CSIZE) {
		switch (cflag & CSIZE) {
		switch (cflag & CSIZE) {
		case CS5: urb_value |= 5; dbg("Setting CS5"); break;
		case CS5: urb_value |= 5; dbg("Setting CS5"); break;