On Mon, Oct 31, 2016 at 05:26:47PM +0000, Ed Blake wrote: > Add a set_ldisc function to enable/disable IrDA SIR mode according to > the new line discipline, if IrDA SIR mode is supported by the hardware > configuration. > > Signed-off-by: Ed Blake <ed.blake@xxxxxxxxxx> > --- > drivers/tty/serial/8250/8250_dw.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c > index 459d726..c89fafc 100644 > --- a/drivers/tty/serial/8250/8250_dw.c > +++ b/drivers/tty/serial/8250/8250_dw.c > @@ -53,6 +53,8 @@ > /* Helper for fifo size calculation */ > #define DW_UART_CPR_FIFO_SIZE(a) (((a >> 16) & 0xff) * 16) > > +/* DesignWare specific register fields */ > +#define DW_UART_MCR_SIRE BIT(6) > > struct dw8250_data { > u8 usr_reg; > @@ -254,6 +256,22 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios, > serial8250_do_set_termios(p, termios, old); > } > > +static void dw8250_set_ldisc(struct uart_port *p, struct ktermios *termios) > +{ > + struct uart_8250_port *up = up_to_u8250p(p); > + unsigned int mcr = p->serial_in(p, UART_MCR); > + > + if (up->capabilities & UART_CAP_IRDA) { > + if (termios->c_line == N_IRDA) > + mcr |= DW_UART_MCR_SIRE; > + else > + mcr &= ~DW_UART_MCR_SIRE; > + > + p->serial_out(p, UART_MCR, mcr); > + } > + serial8250_do_set_ldisc(p, termios); > +} Ah, nevermind on the previous question, it's used here... thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html