Skip to content

Commit ffd8e8b

Browse files
andy-shevgregkh
authored andcommitted
serial: 8250: Extract platform driver
Extract platform driver to a separate module for better maintenance and to reduce churn on 8250_core part changes when it's solely related to the former. No functional changes intended. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Sunil V L <[email protected]> Tested-by: Sunil V L <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c0e1aa6 commit ffd8e8b

File tree

4 files changed

+369
-339
lines changed

4 files changed

+369
-339
lines changed

drivers/tty/serial/8250/8250.h

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include <linux/bits.h>
1111
#include <linux/serial_8250.h>
12-
#include <linux/serial_reg.h>
12+
#include <linux/serial_core.h>
1313
#include <linux/dmaengine.h>
1414

1515
#include "../serial_mctrl_gpio.h"
@@ -93,13 +93,20 @@ struct serial8250_config {
9393
#define UART_BUG_THRE BIT(3) /* UART has buggy THRE reassertion */
9494
#define UART_BUG_TXRACE BIT(5) /* UART Tx fails to set remote DR */
9595

96+
/* Module parameters */
97+
#define UART_NR CONFIG_SERIAL_8250_NR_UARTS
98+
99+
extern unsigned int nr_uarts;
96100

97101
#ifdef CONFIG_SERIAL_8250_SHARE_IRQ
98102
#define SERIAL8250_SHARE_IRQS 1
99103
#else
100104
#define SERIAL8250_SHARE_IRQS 0
101105
#endif
102106

107+
extern unsigned int share_irqs;
108+
extern unsigned int skip_txen_test;
109+
103110
#define SERIAL8250_PORT_FLAGS(_base, _irq, _flags) \
104111
{ \
105112
.iobase = _base, \
@@ -111,7 +118,19 @@ struct serial8250_config {
111118

112119
#define SERIAL8250_PORT(_base, _irq) SERIAL8250_PORT_FLAGS(_base, _irq, 0)
113120

121+
extern struct uart_driver serial8250_reg;
122+
void serial8250_register_ports(struct uart_driver *drv, struct device *dev);
123+
124+
/* Legacy ISA bus related APIs */
125+
typedef void (*serial8250_isa_config_fn)(int, struct uart_port *, u32 *);
126+
extern serial8250_isa_config_fn serial8250_isa_config;
127+
128+
void serial8250_isa_init_ports(void);
129+
130+
extern struct platform_device *serial8250_isa_devs;
131+
114132
extern const struct uart_ops *univ8250_port_base_ops;
133+
extern struct uart_ops univ8250_port_ops;
115134

116135
static inline int serial_in(struct uart_8250_port *up, int offset)
117136
{
@@ -201,6 +220,7 @@ static inline bool serial8250_clear_THRI(struct uart_8250_port *up)
201220
return true;
202221
}
203222

223+
struct uart_8250_port *serial8250_setup_port(int index);
204224
struct uart_8250_port *serial8250_get_port(int line);
205225

206226
void serial8250_rpm_get(struct uart_8250_port *p);

0 commit comments

Comments
 (0)