diff mbox series

[2/4] serial: 8250_dw: Add MStar MSC313 quirk

Message ID 20220324124402.3631379-3-daniel@0x0f.com (mailing list archive)
State New, archived
Headers show
Series Add support for MStar MSC313 uarts | expand

Commit Message

Daniel Palmer March 24, 2022, 12:44 p.m. UTC
The version of the IP used on the MStar MSC313 and later
MStar and SigmaStar SoCs has the USR register at a different
location. Add a quirk for this.

Signed-off-by: Daniel Palmer <daniel@0x0f.com>
---
 drivers/tty/serial/8250/8250_dw.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Andy Shevchenko March 24, 2022, 1:58 p.m. UTC | #1
On Thu, Mar 24, 2022 at 09:44:00PM +0900, Daniel Palmer wrote:
> The version of the IP used on the MStar MSC313 and later
> MStar and SigmaStar SoCs has the USR register at a different
> location. Add a quirk for this.

I'm fine with the change if it goes before [1]. Otherwise
you will need to rebase.

[1]: https://lore.kernel.org/linux-serial/20220317174627.360815-1-miquel.raynal@bootlin.com/
diff mbox series

Patch

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 1769808031c5..01737e5706a5 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -416,6 +416,10 @@  static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
 			p->serial_out = dw8250_serial_out38x;
 		if (of_device_is_compatible(np, "starfive,jh7100-uart"))
 			p->set_termios = dw8250_do_set_termios;
+		if (of_device_is_compatible(np, "mstar,msc313-uart")) {
+			data->usr_reg = 0x7;
+			data->skip_autocfg = true;
+		}
 
 	} else if (acpi_dev_present("APMC0D08", NULL, -1)) {
 		p->iotype = UPIO_MEM32;
@@ -699,6 +703,7 @@  static const struct of_device_id dw8250_of_match[] = {
 	{ .compatible = "marvell,armada-38x-uart" },
 	{ .compatible = "renesas,rzn1-uart" },
 	{ .compatible = "starfive,jh7100-uart" },
+	{ .compatible = "mstar,msc313-uart" },
 	{ /* Sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, dw8250_of_match);