]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.0/serial-8250_of-assume-reg-shift-of-2-for-mrvl-mmp-uart.patch
Linux 4.19.31
[thirdparty/kernel/stable-queue.git] / queue-5.0 / serial-8250_of-assume-reg-shift-of-2-for-mrvl-mmp-uart.patch
1 From f4817843e39ce78aace0195a57d4e8500a65a898 Mon Sep 17 00:00:00 2001
2 From: Lubomir Rintel <lkundrak@v3.sk>
3 Date: Sun, 24 Feb 2019 13:00:53 +0100
4 Subject: serial: 8250_of: assume reg-shift of 2 for mrvl,mmp-uart
5
6 From: Lubomir Rintel <lkundrak@v3.sk>
7
8 commit f4817843e39ce78aace0195a57d4e8500a65a898 upstream.
9
10 There are two other drivers that bind to mrvl,mmp-uart and both of them
11 assume register shift of 2 bits. There are device trees that lack the
12 property and rely on that assumption.
13
14 If this driver wins the race to bind to those devices, it should behave
15 the same as the older deprecated driver.
16
17 Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
18 Cc: stable@vger.kernel.org
19 Signed-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;