.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* |
---|
2 | 3 | * linux/include/linux/serial_8250.h |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2004 Russell King |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or modify |
---|
7 | | - * it under the terms of the GNU General Public License as published by |
---|
8 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
9 | | - * (at your option) any later version. |
---|
10 | 6 | */ |
---|
11 | 7 | #ifndef _LINUX_SERIAL_8250_H |
---|
12 | 8 | #define _LINUX_SERIAL_8250_H |
---|
13 | 9 | |
---|
| 10 | +#include <linux/atomic.h> |
---|
14 | 11 | #include <linux/serial_core.h> |
---|
15 | 12 | #include <linux/serial_reg.h> |
---|
16 | 13 | #include <linux/platform_device.h> |
---|
.. | .. |
---|
29 | 26 | unsigned char regshift; /* register shift */ |
---|
30 | 27 | unsigned char iotype; /* UPIO_* */ |
---|
31 | 28 | unsigned char hub6; |
---|
| 29 | + unsigned char has_sysrq; /* supports magic SysRq */ |
---|
32 | 30 | upf_t flags; /* UPF_* flags */ |
---|
33 | 31 | unsigned int type; /* If UPF_FIXED_TYPE */ |
---|
34 | 32 | unsigned int (*serial_in)(struct uart_port *, int); |
---|
.. | .. |
---|
84 | 82 | struct hrtimer stop_tx_timer; /* "rs485 stop tx" timer */ |
---|
85 | 83 | struct hrtimer *active_timer; /* pointer to active timer */ |
---|
86 | 84 | struct uart_8250_port *port; /* for hrtimer callbacks */ |
---|
| 85 | + unsigned int tx_stopped:1; /* tx is currently stopped */ |
---|
87 | 86 | }; |
---|
88 | 87 | |
---|
89 | 88 | /* |
---|
.. | .. |
---|
114 | 113 | * if no_console_suspend |
---|
115 | 114 | */ |
---|
116 | 115 | unsigned char probe; |
---|
| 116 | + struct mctrl_gpios *gpios; |
---|
117 | 117 | #define UART_PROBE_RSA (1 << 0) |
---|
118 | 118 | |
---|
119 | 119 | /* |
---|
.. | .. |
---|
126 | 126 | #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA |
---|
127 | 127 | unsigned char msr_saved_flags; |
---|
128 | 128 | |
---|
| 129 | + atomic_t console_printing; |
---|
| 130 | + |
---|
129 | 131 | struct uart_8250_dma *dma; |
---|
130 | 132 | const struct uart_8250_ops *ops; |
---|
131 | 133 | |
---|
.. | .. |
---|
134 | 136 | void (*dl_write)(struct uart_8250_port *, int); |
---|
135 | 137 | |
---|
136 | 138 | struct uart_8250_em485 *em485; |
---|
| 139 | + void (*rs485_start_tx)(struct uart_8250_port *); |
---|
| 140 | + void (*rs485_stop_tx)(struct uart_8250_port *); |
---|
137 | 141 | |
---|
138 | 142 | /* Serial port overrun backoff */ |
---|
139 | 143 | struct delayed_work overrun_backoff; |
---|
.. | .. |
---|
154 | 158 | |
---|
155 | 159 | extern int early_serial8250_setup(struct earlycon_device *device, |
---|
156 | 160 | const char *options); |
---|
| 161 | +extern void serial8250_update_uartclk(struct uart_port *port, |
---|
| 162 | + unsigned int uartclk); |
---|
157 | 163 | extern void serial8250_do_set_termios(struct uart_port *port, |
---|
158 | 164 | struct ktermios *termios, struct ktermios *old); |
---|
159 | 165 | extern void serial8250_do_set_ldisc(struct uart_port *port, |
---|
.. | .. |
---|
177 | 183 | void serial8250_set_defaults(struct uart_8250_port *up); |
---|
178 | 184 | void serial8250_console_write(struct uart_8250_port *up, const char *s, |
---|
179 | 185 | unsigned int count); |
---|
| 186 | +void serial8250_console_write_atomic(struct uart_8250_port *up, const char *s, |
---|
| 187 | + unsigned int count); |
---|
180 | 188 | int serial8250_console_setup(struct uart_port *port, char *options, bool probe); |
---|
| 189 | +int serial8250_console_exit(struct uart_port *port); |
---|
181 | 190 | |
---|
182 | 191 | extern void serial8250_set_isa_configurator(void (*v) |
---|
183 | 192 | (int port, struct uart_port *up, |
---|