From 4a04cc976e2e82ed81bd196c88010c43abcbb9da Mon Sep 17 00:00:00 2001 From: Yoshinori Sato Date: Sat, 29 Dec 2018 00:04:46 +0900 Subject: [PATCH] fix 8bit register --- drivers/tty/serial/sh-sci.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 39b82449d20f..ce1b37e87547 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -2959,12 +2959,13 @@ static int sci_init_single(struct platform_device *dev, port->flags = UPF_FIXED_PORT | UPF_BOOT_AUTOCONF | p->flags; port->fifosize = sci_port->params->fifosize; - if (port->type == PORT_SCI) { - if (sci_port->reg_size >= 0x20) - port->regshift = 2; - else - port->regshift = 1; - } + if (port->type == PORT_SCI) + /* + < 0x10: 8bit alignment + >= 0x10 && < 0x20: 16bit alignment + >= 0x20: 32bit alignment + */ + port->regshift = (sci_port->reg_size >> 4); /* * The UART port needs an IRQ value, so we peg this to the RX IRQ -- 2.11.0