summaryrefslogtreecommitdiffstats
path: root/include/linux/serial_8250.h
diff options
context:
space:
mode:
authorSerge Semin <Sergey.Semin@baikalelectronics.ru>2020-07-23 03:33:54 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-29 17:14:38 +0200
commit868f3ee6e452bc2b89e68183a1700fcbbe0807b1 (patch)
tree700afcd0bd5bb9e28082f9a9245bc498cb464b7d /include/linux/serial_8250.h
parent699cc4dfd14071e4843e2fde8ce01f09871eb318 (diff)
downloadlinux-stable-868f3ee6e452bc2b89e68183a1700fcbbe0807b1.tar.gz
linux-stable-868f3ee6e452bc2b89e68183a1700fcbbe0807b1.tar.bz2
linux-stable-868f3ee6e452bc2b89e68183a1700fcbbe0807b1.zip
serial: 8250: Add 8250 port clock update method
Some platforms can be designed in a way so the UART port reference clock might be asynchronously changed at some point. In Baikal-T1 SoC this may happen due to the reference clock being shared between two UART ports, on the Allwinner SoC the reference clock is derived from the CPU clock, so any CPU frequency change should get to be known/reflected by/in the UART controller as well. But it's not enough to just update the uart_port->uartclk field of the corresponding UART port, the 8250 controller reference clock divisor should be altered so to preserve current baud rate setting. All of these things is done in a coherent way by calling the serial8250_update_uartclk() method provided in this patch. Though note that it isn't supposed to be called from within the UART port callbacks because the locks using to the protect the UART port data are already taken in there. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Link: https://lore.kernel.org/r/20200723003357.26897-2-Sergey.Semin@baikalelectronics.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/serial_8250.h')
-rw-r--r--include/linux/serial_8250.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 6545f8cfc8fa..2b70f736b091 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -155,6 +155,8 @@ extern int early_serial_setup(struct uart_port *port);
extern int early_serial8250_setup(struct earlycon_device *device,
const char *options);
+extern void serial8250_update_uartclk(struct uart_port *port,
+ unsigned int uartclk);
extern void serial8250_do_set_termios(struct uart_port *port,
struct ktermios *termios, struct ktermios *old);
extern void serial8250_do_set_ldisc(struct uart_port *port,