]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.31/serial-8250_of-assume-reg-shift-of-2-for-mrvl-mmp-uart.patch
Linux 4.19.31
[thirdparty/kernel/stable-queue.git] / releases / 4.19.31 / serial-8250_of-assume-reg-shift-of-2-for-mrvl-mmp-uart.patch
CommitLineData
0cb42a7c
GKH
1From f4817843e39ce78aace0195a57d4e8500a65a898 Mon Sep 17 00:00:00 2001
2From: Lubomir Rintel <lkundrak@v3.sk>
3Date: Sun, 24 Feb 2019 13:00:53 +0100
4Subject: serial: 8250_of: assume reg-shift of 2 for mrvl,mmp-uart
5
6From: Lubomir Rintel <lkundrak@v3.sk>
7
8commit f4817843e39ce78aace0195a57d4e8500a65a898 upstream.
9
10There are two other drivers that bind to mrvl,mmp-uart and both of them
11assume register shift of 2 bits. There are device trees that lack the
12property and rely on that assumption.
13
14If this driver wins the race to bind to those devices, it should behave
15the same as the older deprecated driver.
16
17Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
18Cc: stable@vger.kernel.org
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21---
22 drivers/tty/serial/8250/8250_of.c | 4 ++++
23 1 file changed, 4 insertions(+)
24
25--- a/drivers/tty/serial/8250/8250_of.c
26+++ b/drivers/tty/serial/8250/8250_of.c
27@@ -130,6 +130,10 @@ static int of_platform_serial_setup(stru
28 port->flags |= UPF_IOREMAP;
29 }
30
31+ /* Compatibility with the deprecated pxa driver and 8250_pxa drivers. */
32+ if (of_device_is_compatible(np, "mrvl,mmp-uart"))
33+ port->regshift = 2;
34+
35 /* Check for registers offset within the devices address range */
36 if (of_property_read_u32(np, "reg-shift", &prop) == 0)
37 port->regshift = prop;