1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /* Synopsys DesignWare 8250 library header file. */
5 #include <linux/notifier.h>
6 #include <linux/types.h>
7 #include <linux/workqueue.h>
14 struct dw8250_port_data {
19 struct uart_8250_dma dma;
21 /* Hardware configuration */
25 bool hw_rs485_support;
28 struct dw8250_platform_data {
35 struct dw8250_port_data data;
36 const struct dw8250_platform_data *pdata;
42 struct notifier_block clk_notifier;
43 struct work_struct clk_work;
44 struct reset_control *rst;
46 unsigned int skip_autocfg:1;
47 unsigned int uart_16550_compatible:1;
50 void dw8250_do_set_termios(struct uart_port *p, struct ktermios *termios, const struct ktermios *old);
51 void dw8250_setup_port(struct uart_port *p);
53 static inline struct dw8250_data *to_dw8250_data(struct dw8250_port_data *data)
55 return container_of(data, struct dw8250_data, data);
58 static inline u32 dw8250_readl_ext(struct uart_port *p, int offset)
60 if (p->iotype == UPIO_MEM32BE)
61 return ioread32be(p->membase + offset);
62 return readl(p->membase + offset);
65 static inline void dw8250_writel_ext(struct uart_port *p, int offset, u32 reg)
67 if (p->iotype == UPIO_MEM32BE)
68 iowrite32be(reg, p->membase + offset);
70 writel(reg, p->membase + offset);