8250.h (2b1333b80885b896807ffb6ccf4bc21d29aa65e0) 8250.h (f8ba5680a56be696b3f4343ed0a591abab807da4)
1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Driver for 8250/16550-type serial ports
4 *
5 * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
6 *
7 * Copyright (C) 2001 Russell King.
8 */

--- 109 unchanged lines hidden (view full) ---

118 return up->port.serial_in(&up->port, offset);
119}
120
121static inline void serial_out(struct uart_8250_port *up, int offset, int value)
122{
123 up->port.serial_out(&up->port, offset, value);
124}
125
1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Driver for 8250/16550-type serial ports
4 *
5 * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
6 *
7 * Copyright (C) 2001 Russell King.
8 */

--- 109 unchanged lines hidden (view full) ---

118 return up->port.serial_in(&up->port, offset);
119}
120
121static inline void serial_out(struct uart_8250_port *up, int offset, int value)
122{
123 up->port.serial_out(&up->port, offset, value);
124}
125
126/**
127 * serial_lsr_in - Read LSR register and preserve flags across reads
128 * @up: uart 8250 port
129 *
130 * Read LSR register and handle saving non-preserved flags across reads.
131 * The flags that are not preserved across reads are stored into
132 * up->lsr_saved_flags.
133 *
134 * Returns LSR value or'ed with the preserved flags (if any).
135 */
136static inline u16 serial_lsr_in(struct uart_8250_port *up)
137{
138 u16 lsr = up->lsr_saved_flags;
139
140 lsr |= serial_in(up, UART_LSR);
141 up->lsr_saved_flags = lsr & LSR_SAVE_FLAGS;
142
143 return lsr;
144}
145
126/*
127 * For the 16C950
128 */
129static void serial_icr_write(struct uart_8250_port *up, int offset, int value)
130{
131 serial_out(up, UART_SCR, offset);
132 serial_out(up, UART_ICR, value);
133}

--- 48 unchanged lines hidden (view full) ---

182
183void serial8250_rpm_get_tx(struct uart_8250_port *p);
184void serial8250_rpm_put_tx(struct uart_8250_port *p);
185
186int serial8250_em485_config(struct uart_port *port, struct serial_rs485 *rs485);
187void serial8250_em485_start_tx(struct uart_8250_port *p);
188void serial8250_em485_stop_tx(struct uart_8250_port *p);
189void serial8250_em485_destroy(struct uart_8250_port *p);
146/*
147 * For the 16C950
148 */
149static void serial_icr_write(struct uart_8250_port *up, int offset, int value)
150{
151 serial_out(up, UART_SCR, offset);
152 serial_out(up, UART_ICR, value);
153}

--- 48 unchanged lines hidden (view full) ---

202
203void serial8250_rpm_get_tx(struct uart_8250_port *p);
204void serial8250_rpm_put_tx(struct uart_8250_port *p);
205
206int serial8250_em485_config(struct uart_port *port, struct serial_rs485 *rs485);
207void serial8250_em485_start_tx(struct uart_8250_port *p);
208void serial8250_em485_stop_tx(struct uart_8250_port *p);
209void serial8250_em485_destroy(struct uart_8250_port *p);
210extern struct serial_rs485 serial8250_em485_supported;
190
191/* MCR <-> TIOCM conversion */
192static inline int serial8250_TIOCM_to_MCR(int tiocm)
193{
194 int mcr = 0;
195
196 if (tiocm & TIOCM_RTS)
197 mcr |= UART_MCR_RTS;

--- 186 unchanged lines hidden ---
211
212/* MCR <-> TIOCM conversion */
213static inline int serial8250_TIOCM_to_MCR(int tiocm)
214{
215 int mcr = 0;
216
217 if (tiocm & TIOCM_RTS)
218 mcr |= UART_MCR_RTS;

--- 186 unchanged lines hidden ---