serial_txx9.c (14e77332e74603efab8347c89d3cda447c3b97c9) serial_txx9.c (d11cc8c3c4b65e00e01f20a920c5fa412415204a)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Derived from many drivers using generic_serial interface,
4 * especially serial_tx3912.c by Steven J. Hill and r39xx_serial.c
5 * (was in Linux/VR tree) by Jim Pick.
6 *
7 * Copyright (C) 1999 Harald Koerfgen
8 * Copyright (C) 2000 Jim Pick <jim@jimpick.com>

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

316
317 tty_flip_buffer_push(&up->state->port);
318
319 *status = disr;
320}
321
322static inline void transmit_chars(struct uart_port *up)
323{
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Derived from many drivers using generic_serial interface,
4 * especially serial_tx3912.c by Steven J. Hill and r39xx_serial.c
5 * (was in Linux/VR tree) by Jim Pick.
6 *
7 * Copyright (C) 1999 Harald Koerfgen
8 * Copyright (C) 2000 Jim Pick <jim@jimpick.com>

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

316
317 tty_flip_buffer_push(&up->state->port);
318
319 *status = disr;
320}
321
322static inline void transmit_chars(struct uart_port *up)
323{
324 struct circ_buf *xmit = &up->state->xmit;
325 int count;
324 u8 ch;
326
325
327 if (up->x_char) {
328 sio_out(up, TXX9_SITFIFO, up->x_char);
329 up->icount.tx++;
330 up->x_char = 0;
331 return;
332 }
333 if (uart_circ_empty(xmit) || uart_tx_stopped(up)) {
334 serial_txx9_stop_tx(up);
335 return;
336 }
337
338 count = TXX9_SIO_TX_FIFO;
339 do {
340 sio_out(up, TXX9_SITFIFO, xmit->buf[xmit->tail]);
341 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
342 up->icount.tx++;
343 if (uart_circ_empty(xmit))
344 break;
345 } while (--count > 0);
346
347 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
348 uart_write_wakeup(up);
349
350 if (uart_circ_empty(xmit))
351 serial_txx9_stop_tx(up);
326 uart_port_tx_limited(up, ch, TXX9_SIO_TX_FIFO,
327 true,
328 sio_out(up, TXX9_SITFIFO, ch),
329 ({}));
352}
353
354static irqreturn_t serial_txx9_interrupt(int irq, void *dev_id)
355{
356 int pass_counter = 0;
357 struct uart_port *up = dev_id;
358 unsigned int status;
359

--- 932 unchanged lines hidden ---
330}
331
332static irqreturn_t serial_txx9_interrupt(int irq, void *dev_id)
333{
334 int pass_counter = 0;
335 struct uart_port *up = dev_id;
336 unsigned int status;
337

--- 932 unchanged lines hidden ---