summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-02-24 13:00:53 +0100
committerBen Hutchings <ben@decadent.org.uk>2019-07-09 22:04:08 +0100
commit8b897efd7bfbe26205602083c8ab5e7b5f4eac91 (patch)
tree4b309e23a89c052629df95745030cbe80da8b0ba
parent5f2ec3b0fba54db9276f77f22c2fb9ceab6b1101 (diff)
downloadlinux-stable-8b897efd7bfbe26205602083c8ab5e7b5f4eac91.tar.gz
linux-stable-8b897efd7bfbe26205602083c8ab5e7b5f4eac91.tar.bz2
linux-stable-8b897efd7bfbe26205602083c8ab5e7b5f4eac91.zip
serial: 8250_of: assume reg-shift of 2 for mrvl,mmp-uart
commit f4817843e39ce78aace0195a57d4e8500a65a898 upstream. There are two other drivers that bind to mrvl,mmp-uart and both of them assume register shift of 2 bits. There are device trees that lack the property and rely on that assumption. If this driver wins the race to bind to those devices, it should behave the same as the older deprecated driver. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [bwh: Backported to 3.16: adjust filename] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--drivers/tty/serial/of_serial.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 3197872f307b..0052e4fe09a8 100644
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
@@ -93,6 +93,10 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
if (of_property_read_u32(np, "reg-offset", &prop) == 0)
port->mapbase += prop;
+ /* Compatibility with the deprecated pxa driver and 8250_pxa drivers. */
+ if (of_device_is_compatible(np, "mrvl,mmp-uart"))
+ port->regshift = 2;
+
/* Check for registers offset within the devices address range */
if (of_property_read_u32(np, "reg-shift", &prop) == 0)
port->regshift = prop;