hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/serial_8250.h
....@@ -1,16 +1,13 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * linux/include/linux/serial_8250.h
34 *
45 * 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.
106 */
117 #ifndef _LINUX_SERIAL_8250_H
128 #define _LINUX_SERIAL_8250_H
139
10
+#include <linux/atomic.h>
1411 #include <linux/serial_core.h>
1512 #include <linux/serial_reg.h>
1613 #include <linux/platform_device.h>
....@@ -29,6 +26,7 @@
2926 unsigned char regshift; /* register shift */
3027 unsigned char iotype; /* UPIO_* */
3128 unsigned char hub6;
29
+ unsigned char has_sysrq; /* supports magic SysRq */
3230 upf_t flags; /* UPF_* flags */
3331 unsigned int type; /* If UPF_FIXED_TYPE */
3432 unsigned int (*serial_in)(struct uart_port *, int);
....@@ -84,6 +82,7 @@
8482 struct hrtimer stop_tx_timer; /* "rs485 stop tx" timer */
8583 struct hrtimer *active_timer; /* pointer to active timer */
8684 struct uart_8250_port *port; /* for hrtimer callbacks */
85
+ unsigned int tx_stopped:1; /* tx is currently stopped */
8786 };
8887
8988 /*
....@@ -114,6 +113,7 @@
114113 * if no_console_suspend
115114 */
116115 unsigned char probe;
116
+ struct mctrl_gpios *gpios;
117117 #define UART_PROBE_RSA (1 << 0)
118118
119119 /*
....@@ -126,6 +126,8 @@
126126 #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
127127 unsigned char msr_saved_flags;
128128
129
+ atomic_t console_printing;
130
+
129131 struct uart_8250_dma *dma;
130132 const struct uart_8250_ops *ops;
131133
....@@ -134,6 +136,8 @@
134136 void (*dl_write)(struct uart_8250_port *, int);
135137
136138 struct uart_8250_em485 *em485;
139
+ void (*rs485_start_tx)(struct uart_8250_port *);
140
+ void (*rs485_stop_tx)(struct uart_8250_port *);
137141
138142 /* Serial port overrun backoff */
139143 struct delayed_work overrun_backoff;
....@@ -154,6 +158,8 @@
154158
155159 extern int early_serial8250_setup(struct earlycon_device *device,
156160 const char *options);
161
+extern void serial8250_update_uartclk(struct uart_port *port,
162
+ unsigned int uartclk);
157163 extern void serial8250_do_set_termios(struct uart_port *port,
158164 struct ktermios *termios, struct ktermios *old);
159165 extern void serial8250_do_set_ldisc(struct uart_port *port,
....@@ -177,7 +183,10 @@
177183 void serial8250_set_defaults(struct uart_8250_port *up);
178184 void serial8250_console_write(struct uart_8250_port *up, const char *s,
179185 unsigned int count);
186
+void serial8250_console_write_atomic(struct uart_8250_port *up, const char *s,
187
+ unsigned int count);
180188 int serial8250_console_setup(struct uart_port *port, char *options, bool probe);
189
+int serial8250_console_exit(struct uart_port *port);
181190
182191 extern void serial8250_set_isa_configurator(void (*v)
183192 (int port, struct uart_port *up,