Lines Matching +full:deep +full:- +full:touch

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
5 * Copyright (C) 2000 Deep Blue Solutions Ltd.
25 ((port)->cons && (port)->cons->index == (port)->line)
37 * struct uart_ops -- interface between serial_core and the driver
58 * - %TIOCM_RTS RTS signal.
59 * - %TIOCM_DTR DTR signal.
60 * - %TIOCM_OUT1 OUT1 signal.
61 * - %TIOCM_OUT2 OUT2 signal.
62 * - %TIOCM_LOOP Set the port into loopback mode.
68 * Locking: @port->lock taken.
78 * - %TIOCM_CAR state of DCD signal
79 * - %TIOCM_CTS state of CTS signal
80 * - %TIOCM_DSR state of DSR signal
81 * - %TIOCM_RI state of RI signal
88 * Locking: @port->lock taken.
100 * Locking: @port->lock taken.
108 * Locking: @port->lock taken.
150 * Locking: @port->lock taken.
158 * Locking: @port->lock taken.
169 * Locking: @port->lock taken.
179 * Locking: caller holds tty_port->mutex
198 * Drivers must not access @port->state once this call has completed.
211 * This will be called whenever the @port->state->xmit circular buffer is
214 * Locking: @port->lock taken.
222 * Update @port->read_status_mask and @port->ignore_status_mask to
226 * - %CSIZE - word size
227 * - %CSTOPB - 2 stop bits
228 * - %PARENB - parity enable
229 * - %PARODD - odd parity (when %PARENB is in force)
230 * - %ADDRB - address bit (changed through uart_port::rs485_config()).
231 * - %CREAD - enable reception of characters (if not set, still receive
233 * - %CRTSCTS - if set, enable CTS status change reporting.
234 * - %CLOCAL - if not set, enable modem status change reporting.
238 * - %INPCK - enable frame and parity error events to be passed to the TTY
240 * - %BRKINT / %PARMRK - both of these enable break events to be passed to
242 * - %IGNPAR - ignore parity and framing errors.
243 * - %IGNBRK - ignore break errors. If %IGNPAR is also set, ignore overrun
261 * Locking: caller holds tty_port->mutex
268 * Documentation/driver-api/tty/tty_ldisc.rst.
270 * Locking: caller holds tty_port->mutex
308 * it should return -%EBUSY on failure.
318 * @port->type should be set to the type found, or %PORT_UNKNOWN if no
353 * Locking: %tty_mutex and tty_port->mutex taken.
477 #define UPIO_MEM (SERIAL_IO_MEM) /* driver-specific */
505 * The remaining bits are serial-core specific and not modifiable by
524 /* Port has hardware-assisted h/w flow control */
528 /* Port has hardware-assisted s/w flow control */
547 #error Change mask not equivalent to userspace-visible bit defines
563 bool hw_stopped; /* sw-assisted CTS flow state */
596 * Only for console->device_lock()/_unlock() callbacks and internal
601 spin_lock_irqsave(&up->lock, *flags); in __uart_port_lock_irqsave()
605 * Only for console->device_lock()/_unlock() callbacks and internal
610 spin_unlock_irqrestore(&up->lock, flags); in __uart_port_unlock_irqrestore()
614 * uart_port_set_cons - Safely set the @cons field for a uart
618 * This function must be used to set @up->cons. It uses the port lock to
627 up->cons = con; in uart_port_set_cons()
634 lockdep_assert_held_once(&up->lock); in __uart_port_using_nbcon()
640 * @up->cons is only modified under the port lock. Therefore it is in __uart_port_using_nbcon()
643 * @up->cons->node is added/removed from the console list under the in __uart_port_using_nbcon()
645 * cannot change here, thus @up->cons->flags can be read directly. in __uart_port_using_nbcon()
647 if (hlist_unhashed_lockless(&up->cons->node) || in __uart_port_using_nbcon()
648 !(up->cons->flags & CON_NBCON) || in __uart_port_using_nbcon()
649 !up->cons->write_atomic) { in __uart_port_using_nbcon()
662 return nbcon_device_try_acquire(up->cons); in __uart_port_nbcon_try_acquire()
671 while (!nbcon_device_try_acquire(up->cons)) in __uart_port_nbcon_acquire()
681 nbcon_device_release(up->cons); in __uart_port_nbcon_release()
685 * uart_port_lock - Lock the UART port
690 spin_lock(&up->lock); in uart_port_lock()
695 * uart_port_lock_irq - Lock the UART port and disable interrupts
700 spin_lock_irq(&up->lock); in uart_port_lock_irq()
705 * uart_port_lock_irqsave - Lock the UART port, save and disable interrupts
711 spin_lock_irqsave(&up->lock, *flags); in uart_port_lock_irqsave()
716 * uart_port_trylock - Try to lock the UART port
723 if (!spin_trylock(&up->lock)) in uart_port_trylock()
727 spin_unlock(&up->lock); in uart_port_trylock()
735 * uart_port_trylock_irqsave - Try to lock the UART port, save and disable interrupts
743 if (!spin_trylock_irqsave(&up->lock, *flags)) in uart_port_trylock_irqsave()
747 spin_unlock_irqrestore(&up->lock, *flags); in uart_port_trylock_irqsave()
755 * uart_port_unlock - Unlock the UART port
761 spin_unlock(&up->lock); in uart_port_unlock()
765 * uart_port_unlock_irq - Unlock the UART port and re-enable interrupts
771 spin_unlock_irq(&up->lock); in uart_port_unlock_irq()
775 * uart_port_unlock_irqrestore - Unlock the UART port, restore interrupts
782 spin_unlock_irqrestore(&up->lock, flags); in uart_port_unlock_irqrestore()
787 return up->serial_in(up, offset); in serial_port_in()
792 up->serial_out(up, offset, value); in serial_port_out()
796 * enum uart_pm_state - power states for UARTs
827 * uart_xmit_advance - Advance xmit buffer and account Tx'ed chars
837 struct tty_port *tport = &up->state->port; in uart_xmit_advance()
839 kfifo_skip_count(&tport->xmit_fifo, chars); in uart_xmit_advance()
840 up->icount.tx += chars; in uart_xmit_advance()
846 struct tty_port *tport = &up->state->port; in uart_fifo_out()
848 chars = kfifo_out(&tport->xmit_fifo, buf, chars); in uart_fifo_out()
849 up->icount.tx += chars; in uart_fifo_out()
857 struct tty_port *tport = &up->state->port; in uart_fifo_get()
860 chars = kfifo_get(&tport->xmit_fifo, ch); in uart_fifo_get()
861 up->icount.tx += chars; in uart_fifo_get()
880 * touch these; they should be initialised to NULL
889 * enum UART_TX_FLAGS -- flags for uart_port_tx_flags()
891 * @UART_TX_NOSTOP: don't call port->ops->stop_tx() on empty buffer
901 struct tty_port *__tport = &__port->state->port; \
904 for (; (for_test) && (tx_ready); (for_post), __port->icount.tx++) { \
905 if (__port->x_char) { \
906 (ch) = __port->x_char; \
908 __port->x_char = 0; \
915 if (!kfifo_get(&__tport->xmit_fifo, &(ch))) \
923 pending = kfifo_len(&__tport->xmit_fifo); \
928 __port->ops->stop_tx(__port); \
935 * uart_port_tx_limited -- transmit helper for uart_port with count limiting
954 * action before potential invocation of ops->stop_tx() happens. If the
957 * For all of them, @port->lock is held, interrupts are locally disabled and
963 __count--); \
967 * uart_port_tx_limited_flags -- transmit helper for uart_port with count limiting with flags
981 __count--); \
985 * uart_port_tx -- transmit helper for uart_port
998 * uart_port_tx_flags -- transmit helper for uart_port with flags
1024 u64 fifo_timeout = (u64)READ_ONCE(port->frame_time) * port->fifosize; in uart_fifo_timeout()
1037 return timeout > 6 ? (timeout / 2 - 2) : 1; in uart_poll_timeout()
1090 return uart_console(port) && console_is_registered_locked(port->cons); in uart_console_registered_locked()
1095 return uart_console(port) && console_is_registered(port->cons); in uart_console_registered()
1131 struct tty_struct *tty = port->state->port.tty; in uart_tx_stopped()
1132 if ((tty && tty->flow.stopped) || port->hw_stopped) in uart_tx_stopped()
1139 return !!(uport->status & UPSTAT_CTS_ENABLE); in uart_cts_enabled()
1146 return ((uport->status & mask) == UPSTAT_CTS_ENABLE); in uart_softcts_mode()
1168 if (!port->sysrq) in uart_handle_sysrq_char()
1171 if (ch && time_before(jiffies, port->sysrq)) { in uart_handle_sysrq_char()
1174 port->sysrq = 0; in uart_handle_sysrq_char()
1180 port->sysrq = 0; in uart_handle_sysrq_char()
1187 if (!port->sysrq) in uart_prepare_sysrq_char()
1190 if (ch && time_before(jiffies, port->sysrq)) { in uart_prepare_sysrq_char()
1192 port->sysrq_ch = ch; in uart_prepare_sysrq_char()
1193 port->sysrq = 0; in uart_prepare_sysrq_char()
1199 port->sysrq = 0; in uart_prepare_sysrq_char()
1208 if (!port->has_sysrq) { in uart_unlock_and_check_sysrq()
1213 sysrq_ch = port->sysrq_ch; in uart_unlock_and_check_sysrq()
1214 port->sysrq_ch = 0; in uart_unlock_and_check_sysrq()
1227 if (!port->has_sysrq) { in uart_unlock_and_check_sysrq_irqrestore()
1232 sysrq_ch = port->sysrq_ch; in uart_unlock_and_check_sysrq_irqrestore()
1233 port->sysrq_ch = 0; in uart_unlock_and_check_sysrq_irqrestore()
1265 struct uart_state *state = port->state; in uart_handle_break()
1267 if (port->handle_break) in uart_handle_break()
1268 port->handle_break(port); in uart_handle_break()
1271 if (port->has_sysrq && uart_console(port)) { in uart_handle_break()
1272 if (!port->sysrq) { in uart_handle_break()
1273 port->sysrq = jiffies + SYSRQ_TIMEOUT; in uart_handle_break()
1276 port->sysrq = 0; in uart_handle_break()
1279 if (port->flags & UPF_SAK) in uart_handle_break()
1280 do_SAK(state->port.tty); in uart_handle_break()
1285 * UART_ENABLE_MS - determine if port should enable modem status irqs
1287 #define UART_ENABLE_MS(port,cflag) ((port)->flags & UPF_HARDPPS_CD || \