Skip to content

Commit

Permalink
serial: 8250_uniphier: fix dl_read and dl_write functions
Browse files Browse the repository at this point in the history
The register offset must be shifted by regshift, otherwise the
baudrate is not set.  I missed the issue probably because the
divisor register was already set by the boot loader.

Fixes: 1a8d290 ("serial: 8250_uniphier: add UniPhier serial driver")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Masahiro Yamada authored and Greg Kroah-Hartman committed Dec 13, 2015
1 parent 527e931 commit 7be047e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/tty/serial/8250/8250_uniphier.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,16 @@ static void uniphier_serial_out(struct uart_port *p, int offset, int value)
*/
static int uniphier_serial_dl_read(struct uart_8250_port *up)
{
return readl(up->port.membase + UNIPHIER_UART_DLR);
int offset = UNIPHIER_UART_DLR << up->port.regshift;

return readl(up->port.membase + offset);
}

static void uniphier_serial_dl_write(struct uart_8250_port *up, int value)
{
writel(value, up->port.membase + UNIPHIER_UART_DLR);
int offset = UNIPHIER_UART_DLR << up->port.regshift;

writel(value, up->port.membase + offset);
}

static int uniphier_of_serial_setup(struct device *dev, struct uart_port *port,
Expand Down

0 comments on commit 7be047e

Please sign in to comment.