summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/8250/8250_dwlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/8250/8250_dwlib.h')
-rw-r--r--drivers/tty/serial/8250/8250_dwlib.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250_dwlib.h b/drivers/tty/serial/8250/8250_dwlib.h
new file mode 100644
index 000000000000..7dd2a8e7b780
--- /dev/null
+++ b/drivers/tty/serial/8250/8250_dwlib.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Synopsys DesignWare 8250 library header file. */
+
+#include <linux/io.h>
+#include <linux/types.h>
+
+#include "8250.h"
+
+struct dw8250_port_data {
+ /* Port properties */
+ int line;
+
+ /* DMA operations */
+ struct uart_8250_dma dma;
+
+ /* Hardware configuration */
+ u32 cpr_value;
+ u8 dlf_size;
+
+ /* RS485 variables */
+ bool hw_rs485_support;
+};
+
+void dw8250_do_set_termios(struct uart_port *p, struct ktermios *termios, const struct ktermios *old);
+void dw8250_setup_port(struct uart_port *p);
+
+static inline u32 dw8250_readl_ext(struct uart_port *p, int offset)
+{
+ if (p->iotype == UPIO_MEM32BE)
+ return ioread32be(p->membase + offset);
+ return readl(p->membase + offset);
+}
+
+static inline void dw8250_writel_ext(struct uart_port *p, int offset, u32 reg)
+{
+ if (p->iotype == UPIO_MEM32BE)
+ iowrite32be(reg, p->membase + offset);
+ else
+ writel(reg, p->membase + offset);
+}