From patchwork Sat Jul 21 14:34:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshinori Sato X-Patchwork-Id: 10538933 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DDFF660311 for ; Sat, 21 Jul 2018 14:43:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7186628C2D for ; Sat, 21 Jul 2018 14:43:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63AA628C42; Sat, 21 Jul 2018 14:43:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 024B128C2D for ; Sat, 21 Jul 2018 14:43:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727979AbeGUPgp (ORCPT ); Sat, 21 Jul 2018 11:36:45 -0400 Received: from mail02.asahi-net.or.jp ([202.224.55.14]:55109 "EHLO mail02.asahi-net.or.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727973AbeGUPgp (ORCPT ); Sat, 21 Jul 2018 11:36:45 -0400 X-Greylist: delayed 521 seconds by postgrey-1.27 at vger.kernel.org; Sat, 21 Jul 2018 11:36:44 EDT Received: from ysato.dip.jp (ZM028236.ppp.dion.ne.jp [222.8.28.236]) (Authenticated sender: PQ4Y-STU) by mail02.asahi-net.or.jp (Postfix) with ESMTPA id CD2B6F7AAB; Sat, 21 Jul 2018 23:35:01 +0900 (JST) Received: by ysato.dip.jp (Postfix, from userid 1000) id 0EFF82C1391; Sat, 21 Jul 2018 23:35:01 +0900 (JST) From: Yoshinori Sato To: linux-sh@vger.kernel.org Cc: geert@linux-m68k.org, laurent.pinchart+renesas@ideasonboard.com, Yoshinori Sato Subject: [PATCH v2] serial: sh-sci: byte allocated register support Date: Sat, 21 Jul 2018 23:34:36 +0900 Message-Id: <20180721143436.43675-1-ysato@users.sourceforge.jp> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180711114121.10735-1-ysato@users.sourceforge.jp> References: <20180711114121.10735-1-ysato@users.sourceforge.jp> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP H8/300 SCI registers allocated byte address. It must support to the case where shift count is 0. Changes v2. more simply code. Signed-off-by: Yoshinori Sato --- drivers/tty/serial/sh-sci.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index c181eb37f985..3c7326e11d37 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -2863,10 +2863,12 @@ static int sci_init_single(struct platform_device *dev, port->fifosize = sci_port->params->fifosize; if (port->type == PORT_SCI) { - if (sci_port->reg_size >= 0x20) - port->regshift = 2; - else - port->regshift = 1; + /* + * reg_size < 0x10: BYTE aligned (scale factor=1). + * reg_size >= 0x10 and < 0x20: WORD aligned (scale factor=2). + * reg_size >= 0x20: DWORD aligned (scale factor=4). + */ + port->regshift = sci_port->reg_size >> 4; } /*