Skip to content

Commit

Permalink
serial: of_serial: Support big-endian register accesses
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kevin Cernekee authored and Rob Herring committed Apr 15, 2015
1 parent c627f2c commit ebc5e20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/tty/serial/of_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
port->iotype = UPIO_MEM;
break;
case 4:
port->iotype = UPIO_MEM32;
port->iotype = of_device_is_big_endian(np) ?
UPIO_MEM32BE : UPIO_MEM32;
break;
default:
dev_warn(&ofdev->dev, "unsupported reg-io-width (%d)\n",
Expand Down

0 comments on commit ebc5e20

Please sign in to comment.