Lines Matching refs:port
24 #define uart_console(port) \ argument
25 ((port)->cons && (port)->cons->index == (port)->line)
27 #define uart_console(port) ({ (void)port; 0; }) argument
453 int (*startup)(struct uart_port *port);
454 void (*shutdown)(struct uart_port *port);
455 void (*throttle)(struct uart_port *port);
456 void (*unthrottle)(struct uart_port *port);
704 struct tty_port port; member
759 void uart_write_wakeup(struct uart_port *port);
832 #define uart_port_tx_limited(port, ch, count, tx_ready, put_char, tx_done) ({ \ argument
834 __uart_port_tx(port, ch, 0, tx_ready, put_char, tx_done, __count, \
850 #define uart_port_tx_limited_flags(port, ch, flags, count, tx_ready, put_char, tx_done) ({ \ argument
852 __uart_port_tx(port, ch, flags, tx_ready, put_char, tx_done, __count, \
865 #define uart_port_tx(port, ch, tx_ready, put_char) \ argument
866 __uart_port_tx(port, ch, 0, tx_ready, put_char, ({}), true, ({}))
879 #define uart_port_tx_flags(port, ch, flags, tx_ready, put_char) \ argument
880 __uart_port_tx(port, ch, flags, tx_ready, put_char, ({}), true, ({}))
884 void uart_update_timeout(struct uart_port *port, unsigned int cflag,
886 unsigned int uart_get_baud_rate(struct uart_port *port, struct ktermios *termios,
889 unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud);
894 static inline unsigned long uart_fifo_timeout(struct uart_port *port) in uart_fifo_timeout() argument
896 u64 fifo_timeout = (u64)READ_ONCE(port->frame_time) * port->fifosize; in uart_fifo_timeout()
905 static inline int uart_poll_timeout(struct uart_port *port) in uart_poll_timeout() argument
907 int timeout = uart_fifo_timeout(port); in uart_poll_timeout()
917 struct uart_port port; member
960 static inline bool uart_console_registered_locked(struct uart_port *port) in uart_console_registered_locked() argument
962 return uart_console(port) && console_is_registered_locked(port->cons); in uart_console_registered_locked()
965 static inline bool uart_console_registered(struct uart_port *port) in uart_console_registered() argument
967 return uart_console(port) && console_is_registered(port->cons); in uart_console_registered()
976 int uart_set_options(struct uart_port *port, struct console *co, int baud,
979 void uart_console_write(struct uart_port *port, const char *s,
988 int uart_add_one_port(struct uart_driver *reg, struct uart_port *port);
989 void uart_remove_one_port(struct uart_driver *reg, struct uart_port *port);
990 int uart_read_port_properties(struct uart_port *port);
991 int uart_read_and_validate_port_properties(struct uart_port *port);
998 int uart_suspend_port(struct uart_driver *reg, struct uart_port *port);
999 int uart_resume_port(struct uart_driver *reg, struct uart_port *port);
1010 static inline int uart_tx_stopped(struct uart_port *port) in uart_tx_stopped() argument
1012 struct tty_struct *tty = port->state->port.tty; in uart_tx_stopped()
1013 if ((tty && tty->flow.stopped) || port->hw_stopped) in uart_tx_stopped()
1037 void uart_insert_char(struct uart_port *port, unsigned int status,
1045 bool uart_try_toggle_sysrq(struct uart_port *port, u8 ch);
1047 static inline int uart_handle_sysrq_char(struct uart_port *port, u8 ch) in uart_handle_sysrq_char() argument
1049 if (!port->sysrq) in uart_handle_sysrq_char()
1052 if (ch && time_before(jiffies, port->sysrq)) { in uart_handle_sysrq_char()
1055 port->sysrq = 0; in uart_handle_sysrq_char()
1058 if (uart_try_toggle_sysrq(port, ch)) in uart_handle_sysrq_char()
1061 port->sysrq = 0; in uart_handle_sysrq_char()
1066 static inline int uart_prepare_sysrq_char(struct uart_port *port, u8 ch) in uart_prepare_sysrq_char() argument
1068 if (!port->sysrq) in uart_prepare_sysrq_char()
1071 if (ch && time_before(jiffies, port->sysrq)) { in uart_prepare_sysrq_char()
1073 port->sysrq_ch = ch; in uart_prepare_sysrq_char()
1074 port->sysrq = 0; in uart_prepare_sysrq_char()
1077 if (uart_try_toggle_sysrq(port, ch)) in uart_prepare_sysrq_char()
1080 port->sysrq = 0; in uart_prepare_sysrq_char()
1085 static inline void uart_unlock_and_check_sysrq(struct uart_port *port) in uart_unlock_and_check_sysrq() argument
1089 if (!port->has_sysrq) { in uart_unlock_and_check_sysrq()
1090 spin_unlock(&port->lock); in uart_unlock_and_check_sysrq()
1094 sysrq_ch = port->sysrq_ch; in uart_unlock_and_check_sysrq()
1095 port->sysrq_ch = 0; in uart_unlock_and_check_sysrq()
1097 spin_unlock(&port->lock); in uart_unlock_and_check_sysrq()
1103 static inline void uart_unlock_and_check_sysrq_irqrestore(struct uart_port *port, in uart_unlock_and_check_sysrq_irqrestore() argument
1108 if (!port->has_sysrq) { in uart_unlock_and_check_sysrq_irqrestore()
1109 spin_unlock_irqrestore(&port->lock, flags); in uart_unlock_and_check_sysrq_irqrestore()
1113 sysrq_ch = port->sysrq_ch; in uart_unlock_and_check_sysrq_irqrestore()
1114 port->sysrq_ch = 0; in uart_unlock_and_check_sysrq_irqrestore()
1116 spin_unlock_irqrestore(&port->lock, flags); in uart_unlock_and_check_sysrq_irqrestore()
1122 static inline int uart_handle_sysrq_char(struct uart_port *port, u8 ch) in uart_handle_sysrq_char() argument
1126 static inline int uart_prepare_sysrq_char(struct uart_port *port, u8 ch) in uart_prepare_sysrq_char() argument
1130 static inline void uart_unlock_and_check_sysrq(struct uart_port *port) in uart_unlock_and_check_sysrq() argument
1132 spin_unlock(&port->lock); in uart_unlock_and_check_sysrq()
1134 static inline void uart_unlock_and_check_sysrq_irqrestore(struct uart_port *port, in uart_unlock_and_check_sysrq_irqrestore() argument
1137 spin_unlock_irqrestore(&port->lock, flags); in uart_unlock_and_check_sysrq_irqrestore()
1144 static inline int uart_handle_break(struct uart_port *port) in uart_handle_break() argument
1146 struct uart_state *state = port->state; in uart_handle_break()
1148 if (port->handle_break) in uart_handle_break()
1149 port->handle_break(port); in uart_handle_break()
1152 if (port->has_sysrq && uart_console(port)) { in uart_handle_break()
1153 if (!port->sysrq) { in uart_handle_break()
1154 port->sysrq = jiffies + SYSRQ_TIMEOUT; in uart_handle_break()
1157 port->sysrq = 0; in uart_handle_break()
1160 if (port->flags & UPF_SAK) in uart_handle_break()
1161 do_SAK(state->port.tty); in uart_handle_break()
1168 #define UART_ENABLE_MS(port,cflag) ((port)->flags & UPF_HARDPPS_CD || \ argument
1172 int uart_get_rs485_mode(struct uart_port *port);