Lines Matching full:up
135 static inline int serial_in(struct uart_8250_port *up, int offset) in serial_in() argument
137 return up->port.serial_in(&up->port, offset); in serial_in()
140 static inline void serial_out(struct uart_8250_port *up, int offset, int value) in serial_out() argument
142 up->port.serial_out(&up->port, offset, value); in serial_out()
147 * @up: uart 8250 port
151 * up->lsr_saved_flags.
155 static inline u16 serial_lsr_in(struct uart_8250_port *up) in serial_lsr_in() argument
157 u16 lsr = up->lsr_saved_flags; in serial_lsr_in()
159 lsr |= serial_in(up, UART_LSR); in serial_lsr_in()
160 up->lsr_saved_flags = lsr & up->lsr_save_mask; in serial_lsr_in()
168 static void serial_icr_write(struct uart_8250_port *up, int offset, int value) in serial_icr_write() argument
170 serial_out(up, UART_SCR, offset); in serial_icr_write()
171 serial_out(up, UART_ICR, value); in serial_icr_write()
174 static unsigned int __maybe_unused serial_icr_read(struct uart_8250_port *up, in serial_icr_read() argument
179 serial_icr_write(up, UART_ACR, up->acr | UART_ACR_ICRRD); in serial_icr_read()
180 serial_out(up, UART_SCR, offset); in serial_icr_read()
181 value = serial_in(up, UART_ICR); in serial_icr_read()
182 serial_icr_write(up, UART_ACR, up->acr); in serial_icr_read()
189 static inline u32 serial_dl_read(struct uart_8250_port *up) in serial_dl_read() argument
191 return up->dl_read(up); in serial_dl_read()
194 static inline void serial_dl_write(struct uart_8250_port *up, u32 value) in serial_dl_write() argument
196 up->dl_write(up, value); in serial_dl_write()
199 static inline bool serial8250_set_THRI(struct uart_8250_port *up) in serial8250_set_THRI() argument
202 lockdep_assert_held_once(&up->port.lock); in serial8250_set_THRI()
204 if (up->ier & UART_IER_THRI) in serial8250_set_THRI()
206 up->ier |= UART_IER_THRI; in serial8250_set_THRI()
207 serial_out(up, UART_IER, up->ier); in serial8250_set_THRI()
211 static inline bool serial8250_clear_THRI(struct uart_8250_port *up) in serial8250_clear_THRI() argument
214 lockdep_assert_held_once(&up->port.lock); in serial8250_clear_THRI()
216 if (!(up->ier & UART_IER_THRI)) in serial8250_clear_THRI()
218 up->ier &= ~UART_IER_THRI; in serial8250_clear_THRI()
219 serial_out(up, UART_IER, up->ier); in serial8250_clear_THRI()
293 static inline void serial8250_out_MCR(struct uart_8250_port *up, int value) in serial8250_out_MCR() argument
295 serial_out(up, UART_MCR, value); in serial8250_out_MCR()
297 if (up->gpios) in serial8250_out_MCR()
298 mctrl_gpio_set(up->gpios, serial8250_MCR_to_TIOCM(value)); in serial8250_out_MCR()
301 static inline int serial8250_in_MCR(struct uart_8250_port *up) in serial8250_in_MCR() argument
305 mctrl = serial_in(up, UART_MCR); in serial8250_in_MCR()
307 if (up->gpios) { in serial8250_in_MCR()
310 mctrl_gpio = mctrl_gpio_get_outputs(up->gpios, &mctrl_gpio); in serial8250_in_MCR()
426 static inline int ns16550a_goto_highspeed(struct uart_8250_port *up) in ns16550a_goto_highspeed() argument
430 status = serial_in(up, 0x04); /* EXCR2 */ in ns16550a_goto_highspeed()
438 serial_out(up, 0x04, status); in ns16550a_goto_highspeed()