aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/serial_8250.h
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2023-05-11 15:10:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-13 19:47:26 +0900
commitb334214ea08d941af376fec853621d856b12bc81 (patch)
tree730476e5b7ed66c592d60f50eb949ce20c6274e8 /include/linux/serial_8250.h
parentserial: 8250: Add dl_read/write, bugs and mapsize into plat_serial8250_port (diff)
downloadwireguard-linux-b334214ea08d941af376fec853621d856b12bc81.tar.xz
wireguard-linux-b334214ea08d941af376fec853621d856b12bc81.zip
serial: 8250: RT288x/Au1xxx code away from core
A non-trivial amount of RT288x/Au1xxx code is encapsulated into ifdeffery in 8250_port / 8250_early and some if UPIO_AU blocks. Create a separate file from them. Also handle errors properly in the cases where RT288x/Au1xxx code is not configured. It seems that 0x1000 mapsize is likely overkill but I've kept it the same as previously (the value was shrunk to that value in commit b2b13cdfd05e ("SERIAL 8250: Fixes for Alchemy UARTs.")). Seemingly, the driver only needs to access register at 0x28 for the divisor latch. The Kconfig side is a bit tricky. As SERIAL_8250_RT288X is bool it can only be =y. It is possible to have SERIAL_8250=m + SERIAL_8250_RT288X=y which required altering when 8250/ is included or the rt288x would not be built. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20230511121029.13128-5-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/serial_8250.h')
-rw-r--r--include/linux/serial_8250.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 42fc8f64f48e..eb44420b39ec 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -7,6 +7,7 @@
#ifndef _LINUX_SERIAL_8250_H
#define _LINUX_SERIAL_8250_H
+#include <linux/errno.h>
#include <linux/serial_core.h>
#include <linux/serial_reg.h>
#include <linux/platform_device.h>
@@ -211,8 +212,11 @@ void serial8250_set_isa_configurator(void (*v)(int port, struct uart_port *up,
u32 *capabilities));
#ifdef CONFIG_SERIAL_8250_RT288X
-unsigned int au_serial_in(struct uart_port *p, int offset);
-void au_serial_out(struct uart_port *p, int offset, int value);
+int rt288x_setup(struct uart_port *p);
+int au_platform_setup(struct plat_serial8250_port *p);
+#else
+static inline int rt288x_setup(struct uart_port *p) { return -ENODEV; }
+static inline int au_platform_setup(struct plat_serial8250_port *p) { return -ENODEV; }
#endif
#endif