diff options
author | Karthikeyan Ramasubramanian <kramasub@codeaurora.org> | 2018-05-03 16:14:38 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-14 07:44:55 -0400 |
commit | 69736b57dfe57d116cac7846006cb4b0be9ac0d0 (patch) | |
tree | 0989b1717f9b843bc918d55aa79cdcf234c50b10 | |
parent | 7fb5b8800194c0d9a5d2aa8b3983cf7bc615b3ea (diff) |
tty: serial: qcom_geni_serial: Use iowrite32_rep to write to FIFO
Use iowrite32_rep to write to the hardware FIFO so that the code does
not have to worry about the system endianness.
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/qcom_geni_serial.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 3e9de6c780d3..b0758606b676 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c | |||
@@ -600,14 +600,15 @@ static void qcom_geni_serial_handle_tx(struct uart_port *uport) | |||
600 | remaining = chunk; | 600 | remaining = chunk; |
601 | for (i = 0; i < chunk; ) { | 601 | for (i = 0; i < chunk; ) { |
602 | unsigned int tx_bytes; | 602 | unsigned int tx_bytes; |
603 | unsigned int buf = 0; | 603 | u8 buf[sizeof(u32)]; |
604 | int c; | 604 | int c; |
605 | 605 | ||
606 | memset(buf, 0, ARRAY_SIZE(buf)); | ||
606 | tx_bytes = min_t(size_t, remaining, port->tx_bytes_pw); | 607 | tx_bytes = min_t(size_t, remaining, port->tx_bytes_pw); |
607 | for (c = 0; c < tx_bytes ; c++) | 608 | for (c = 0; c < tx_bytes ; c++) |
608 | buf |= (xmit->buf[tail + c] << (c * BITS_PER_BYTE)); | 609 | buf[c] = xmit->buf[tail + c]; |
609 | 610 | ||
610 | writel_relaxed(buf, uport->membase + SE_GENI_TX_FIFOn); | 611 | iowrite32_rep(uport->membase + SE_GENI_TX_FIFOn, buf, 1); |
611 | 612 | ||
612 | i += tx_bytes; | 613 | i += tx_bytes; |
613 | tail = (tail + tx_bytes) & (UART_XMIT_SIZE - 1); | 614 | tail = (tail + tx_bytes) & (UART_XMIT_SIZE - 1); |