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

Commit 0ab84da2 authored by Aaron Sierra's avatar Aaron Sierra Committed by Greg Kroah-Hartman
Browse files

serial: 8250: Preserve DLD[7:4] for PORT_XR17V35X



The upper four bits of the XR17V35x fractional divisor register (DLD)
control general chip function (RS-485 direction pin polarity, multidrop
mode, XON/XOFF parity check, and fast IR mode). Don't allow these bits
to be clobbered when setting the baudrate.

Signed-off-by: default avatarAaron Sierra <asierra@xes-inc.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8ffb8209
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -2586,9 +2586,12 @@ static void serial8250_set_divisor(struct uart_port *port, unsigned int baud,
	serial_dl_write(up, quot);
	serial_dl_write(up, quot);


	/* XR17V35x UARTs have an extra fractional divisor register (DLD) */
	/* XR17V35x UARTs have an extra fractional divisor register (DLD) */
	if (up->port.type == PORT_XR17V35X)
	if (up->port.type == PORT_XR17V35X) {
		/* Preserve bits not related to baudrate; DLD[7:4]. */
		quot_frac |= serial_port_in(port, 0x2) & 0xf0;
		serial_port_out(port, 0x2, quot_frac);
		serial_port_out(port, 0x2, quot_frac);
	}
	}
}


static unsigned int serial8250_get_baud_rate(struct uart_port *port,
static unsigned int serial8250_get_baud_rate(struct uart_port *port,
					     struct ktermios *termios,
					     struct ktermios *termios,