* [PATCH V3] serial: 8250_pnp: Support configurable clock frequency
@ 2021-07-15 6:16 Huacai Chen
0 siblings, 0 replies; only message in thread
From: Huacai Chen @ 2021-07-15 6:16 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-serial, Xuefeng Li, Huacai Chen, Jiaxun Yang, Jianmin Lv,
Huacai Chen
From: Jianmin Lv <lvjianmin@loongson.cn>
ACPI-based Loongson boards need configurable rather than fixed clock
frequency for serial ports.
Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
V2: Remove unnecessary braces for single statement blocks
V3: Remove unnecessary conditional statement
drivers/tty/serial/8250/8250_pnp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c
index de90d681b64c..98e5ee4d0d08 100644
--- a/drivers/tty/serial/8250/8250_pnp.c
+++ b/drivers/tty/serial/8250/8250_pnp.c
@@ -13,6 +13,7 @@
#include <linux/pnp.h>
#include <linux/string.h>
#include <linux/kernel.h>
+#include <linux/property.h>
#include <linux/serial_core.h>
#include <linux/bitops.h>
@@ -475,6 +476,7 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
if (pnp_irq_flags(dev, 0) & IORESOURCE_IRQ_SHAREABLE)
uart.port.flags |= UPF_SHARE_IRQ;
uart.port.uartclk = 1843200;
+ device_property_read_u32(&dev->dev, "clock-frequency", &uart.port.uartclk);
uart.port.dev = &dev->dev;
line = serial8250_register_8250_port(&uart);
--
2.27.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-15 6:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 6:16 [PATCH V3] serial: 8250_pnp: Support configurable clock frequency Huacai Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).