aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Cernekee <cernekee@gmail.com>2015-04-09 16:05:18 -0400
committerRob Herring <robh@kernel.org>2015-04-14 20:35:45 -0400
commitebc5e20082160df384dedbe1c95066c3e545b689 (patch)
tree3d81fb76b1fde7b1d0764e2caa149ab933b66c2a
parentc627f2ceb692e8a9358b64ac2d139314e7bb0d17 (diff)
serial: of_serial: Support big-endian register accesses
If the device node has a "big-endian" property and 32-bit registers, tell the serial driver to use UPIO_MEM32BE instead of UPIO_MEM32. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r--drivers/tty/serial/of_serial.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 33fb94f78967..e15c443b2a3c 100644
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
@@ -115,7 +115,8 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
115 port->iotype = UPIO_MEM; 115 port->iotype = UPIO_MEM;
116 break; 116 break;
117 case 4: 117 case 4:
118 port->iotype = UPIO_MEM32; 118 port->iotype = of_device_is_big_endian(np) ?
119 UPIO_MEM32BE : UPIO_MEM32;
119 break; 120 break;
120 default: 121 default:
121 dev_warn(&ofdev->dev, "unsupported reg-io-width (%d)\n", 122 dev_warn(&ofdev->dev, "unsupported reg-io-width (%d)\n",