From patchwork Tue Jun 13 02:55:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 9783027 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 8E4DB602C9 for ; Tue, 13 Jun 2017 03:03:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8089028583 for ; Tue, 13 Jun 2017 03:03:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 717D3285A4; Tue, 13 Jun 2017 03:03:27 +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=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 96ED828583 for ; Tue, 13 Jun 2017 03:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tU+rlvhC7cl7+QbKVO9dKUSX015OQdkDe2cxQa0ir2Y=; b=OFEd8FSplR0tMG Zj0fvDhLp/23YIU26XstSsPllCyxy9zDs4qGzbcgmllUFEjCMMgscy4oTzuiwzbexxQxj09+MtFbR I+7RI8YSAG+vaiviu4+OmFaZ02Ew/QM+KT1eiDKG9/ZzQsDIgalyHAiovecWgq5N/cIuG5d/uHHnY u3wKncrAF/VkTzJXAhye4+yS/BhdIpu3xWjmQS4BSUZgB5b9CqS0ujyq+52opbBR1E7yw7atm/jJs /RozrS62UrQMuob95PqQfWkfw7jIHsO0RNk273/eDv4nP+oGdin8NB7uFTOwkftV82O6aV+5qjCdT 8UDLNiGWLQRDDb5M/7FQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dKc73-0006rh-Qu; Tue, 13 Jun 2017 03:03:25 +0000 Received: from mail-bn3nam01on0630.outbound.protection.outlook.com ([2a01:111:f400:fe41::630] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dKc09-0002Yz-QE for linux-arm-kernel@lists.infradead.org; Tue, 13 Jun 2017 02:56:21 +0000 Received: from BN3PR03CA0115.namprd03.prod.outlook.com (2603:10b6:400:4::33) by DM2PR0301MB0911.namprd03.prod.outlook.com (2a01:111:e400:501d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Tue, 13 Jun 2017 02:55:49 +0000 Received: from BN1BFFO11FD048.protection.gbl (2a01:111:f400:7c10::1:133) by BN3PR03CA0115.outlook.office365.com (2603:10b6:400:4::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12 via Frontend Transport; Tue, 13 Jun 2017 02:55:49 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD048.mail.protection.outlook.com (10.58.145.3) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1143.11 via Frontend Transport; Tue, 13 Jun 2017 02:55:49 +0000 Received: from b29396-OptiPlex-7040.ap.freescale.net (b29396-OptiPlex-7040.ap.freescale.net [10.192.242.182]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v5D2tZTY012328; Mon, 12 Jun 2017 19:55:44 -0700 From: Dong Aisheng To: Subject: [PATCH V4 2/7] tty: serial: lpuart: refactor lpuart32_{read|write} prototype Date: Tue, 13 Jun 2017 10:55:49 +0800 Message-ID: <1497322554-24463-3-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497322554-24463-1-git-send-email-aisheng.dong@nxp.com> References: <1497322554-24463-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131417961494100761; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39380400002)(39860400002)(39850400002)(39400400002)(39410400002)(39840400002)(39450400003)(2980300002)(1110001)(1109001)(339900001)(199003)(54534003)(189002)(9170700003)(8936002)(86362001)(356003)(7416002)(53936002)(38730400002)(8676002)(77096006)(575784001)(50226002)(81166006)(4326008)(110136004)(48376002)(498600001)(36756003)(189998001)(5660300001)(54906002)(8656002)(39060400002)(305945005)(6916009)(33646002)(85426001)(105606002)(2950100002)(5003940100001)(2351001)(106466001)(2906002)(47776003)(76176999)(50466002)(50986999)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0911; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD048; 1:Z2q63OwXHTa5MWH+DgnFGujRZ9B1C9+0jRNLjpSlzRxrqHQUvJiVYCByBkQYjNbrpqoFHVqPrnMCflKn4jfd6RvQAWC8rEdh8izDSDs0UCy9bRig1Gm/t1X5QYz3ehYNOhqAsM2NLTUewu+EmVWhBFg4O1pFtwvO56iSMQDKghdeYXWRtZ0XYtR6TCyiNzEtRfNmGfEDs1b6WVOpd+pvvS60cu9DLXDY1DHFytbB2P3g9n2dcifDnAh87lXaS2xEwb+JkaKi7Y93ged5JOXqRt3ruP+8rkmD7mA4NeOKmHvo7ecdjmH0zQZV2wL3mh9E8orlrlItV6I5hMnEBLEbrC+pYED0El9dvBAuep6K/pL1sc2SaAUEQn1qBvNmlbhokRu/4At05vlIVmrD8PwIdA2+geHkytmJXePYWVOMcMLbIAKZ3pGFmClDBBE7NKy2YpnNZ2svM3wRvgN5yWwWp7urasfkd+BqFW9r1Ybs/erPPWq46zjA5nO9McOYehkpj1kwC3atgZ9rDhccTuzh0Rzbx6rUJ3kKUeXImQKuVqTuzqh6uKgekTdW23R2JEy/aqzi3hs0UC1wsaeq3rEkrkDUPnnY+JlEnECTYCCMfDNV6/ZSWep2t0huEs/vkc2o9Lne9M75AeldEpvruXFOBXqF6HBbik8iqNAcpamKzAt4zX/3cRIjvIA4BtryPBpO MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM2PR0301MB0911: X-MS-Office365-Filtering-Correlation-Id: fcdcdd0f-50ea-4c2d-3029-08d4b207b25a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:DM2PR0301MB0911; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0911; 3:2Bc3XRleNXxGcfmw3o2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TgaGhkBilswxeM+/cA4QoCNvW8BFc1BfBli1K/SJNAvY1jPoh7RrQAezi+OPKR/UyUbjvGOintV4YTJ7frdlvm/D8HL/wrTlXZEBS5aDZCqrQ+WBnOAtuwV58UJBNBoGeQ99pUhPXIw8pCLb9YEB20U5QmWGYA/MgD6CPspoxBMPEV8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(13016025)(8121501046)(13018025)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123561025)(20161123559100)(20161123556025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123563025)(20161123565025)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR0301MB0911; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR0301MB0911; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0911; 4:0FyMYU6m52d8OcptMJeiIjARK7zsAmiLxAVJVFoM?= =?us-ascii?Q?eXyTdymGcgXYShxoSRqMZlxIAGELVS4nixR2P/ZiMT7Pp7H2KMXUAQceLYYh?= =?us-ascii?Q?KH1yUpEBfOGXuJpCV1Vi1p4g59kBILMLYAQlFug0kJRklea4mpOv+4EOR9Y4?= =?us-ascii?Q?UieqO5PnMIegtyzv4CxWlbpaEKI9WaE0UM+CN8fs+wf0JIr0AmGLWO4BdNG9?= =?us-ascii?Q?e9Nog+BYtMW0fV043QIuO222/rB5N9QxVCMHRqRQvnyVQQkiKwQvTcAmMa07?= =?us-ascii?Q?xTlhP7UooRuhPMSTuGZCOeQvT2z/nUPWnkT2qDKjJ9GbtbMHpQu3fWeVk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GNtC+D6Q7grXv5HfU8ZgE3Wt6bhZ6cLIWqe6gOFPoD/ik?= =?us-ascii?Q?Tv2YFzS6qA4VluKPimiaQddkYErLtKF6xPF82gHq?= X-Forefront-PRVS: 0337AFFE9A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0911; 23:3vqVb3Fm6+m7O6Gecfg27sWPDq749v4qp3nbFPu?= =?us-ascii?Q?LmmOYNSGOD3Vu4/FtkBroEzw7lVOXszB4PQdn6m7qxVuU3UVukYiglFEbrcR?= =?us-ascii?Q?IQcppHty9f/Z68VjshDWculZ0BYjfMhSv2PObF43nMTXG1Ak5k70UzKKlpqV?= =?us-ascii?Q?RIwxe3xGqYWKL6dkPYRoVY2ydQV+igM9zBzyCjKvkLQJtUnb5KP/33oQM53Q?= =?us-ascii?Q?lswU4kyTfnZCV+CBQCPxdbNn3Yk7EMBhj66FyzQ8XAfz4b1p4sADkbLiS4Pw?= =?us-ascii?Q?X/dvtbKtiwmxmHzzR/AEihhxSIvOauaUEnHBk2XdbM0NYD3Vlp75OrLC2ffh?= =?us-ascii?Q?zw3RVpweuk+76jsiVqO7UKSH1R/PkUAV4rLjethAXXay3XMDzIeY37RR0Ef2?= =?us-ascii?Q?pho5gAGd2QJqStd4BIE9a1aLbqPIwIVuUP+SyowAxFmZaQx6bEYd30JOY+0H?= =?us-ascii?Q?6BRWgSpy8vXlew/a2UljWZhsRWmHuAmyRymZzdCR1Cy4jyh6siYsVtgTtixI?= =?us-ascii?Q?ZY1/DF6//f00FgQFMj9bzby2CoiH4Xtk4lur0V9YiNBOdp3hb5fxD7f2hXsD?= =?us-ascii?Q?LyAnHKb8JJwZM93IrF76bdtUELR3e5kS2FmyMP4uvskeNbuy9fqrPNZ+kH0q?= =?us-ascii?Q?dMkdWYWji/jAYSAl73j2cGYHk6uI1Lm8TOuiKo0CiVkxmf1t6wVC01MkMlo3?= =?us-ascii?Q?yir5VYfTSCA1F8Zp7ntYNz+xdCOUBI+ZtJm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5XOMECL+WjYtKjoEp0qD0TjHTp3UqnIxm2WKBjnQBrUIY9s+nXymPPrBDce36ol+Tl3GWfzwVtM38wU2fslXFjCvojG++oPmiK1HctRECWhBFb1W+a1JaDFElcscenEzqrDBFZFsl+evzTMhVYNQ0qpg271sp5pz+XkHyxYvLzENL27HBGerlLqaqaexaJwMyQJPp6sO/KRJoLp0P7qhWC/XiHgV0VtBB3iVKbjBjA== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0911; 5:lDUV3PM9sCwKnvLZn0xvYToQIn5Jgmhh6xtZ3WBBgNDSW994DYPZztuTa4aMMn2pFbvsoUOeyM4CAdUV6zcqQEnI2oiCIJhzEbuZ8B6cPAAlem49psMa4PMkE16pGNLTz2eDQHXxwVHwZlZW7rOwVQTqEqc/ZqlWOJmNzAoKjucA1XR/qLE1fyoZXpLIFQ4YIQ3wVZAGPzwzg0OKZR0K2I6//S4MTpiz0AEWDFJoQX5nngs+60d6hs73CZjXqviX2HjfdXsCdQAjGk5bJvnx1kd6ZGFmttn4KYauKNz9gVEogf4UH3vVysX7zDChHyOtCp0yyDy5H9D/kwM09dfgigQe7FebdS4Y2rTvEZAa9HkF45bjX8r7VWnKv5fZ31ir3n+Y1XF6EY12YjhIKaB0Hbo08WjBQbhYNpN11IwOe0dgWGPuo8MxKvwr6dstSq/JAwxZ9dpWD12q++I0FUyIm3TpJ69MQplH/KZhQsH1eCBtWJMZ/QCoA0+aKMr/+N4WY5TqpdAwmQ9jVpjjdBWSwA==; 24:FrFHYLCNsuIs2yox02oORGVVKls/AQGkvjnjVHEZdVdnZUcqP5gQtjBKbkjA5hJFVN+2thRetZJQ27JBfr5fq8om1bkv0IRXmYJ4JiZsQ6E= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0911; 7:Ye7HbbHxxwhJsF0FJVszNMqqaWT8n786SPtHZokSclKOVRiNL83ao8SNNp1SfmSL0GDjKbF7l7t0dyUGe1QJomUTuU3nIxC7CRT8QW84GtEwgp/XXqtavijRDalNZlm+AdY5TSaV17Yk+pOfnBYpEX5YMZQAG3/hpaAqbdxxxSOaA+yQ8rHm0jC8bomr12crmn+feuSbk+JbkU6Gn1HOmAghTl0OwgHU99usoNV0UEiadr+qdhkbzU5Yoqh5u6+rEL+Zv4JdWbvLGll25ey4W4wtY+xf71Ujth8el98qpZW9tPlJyuCSHoL0Njpqioi/vB9RokYFHR8GA7gA5pZnJQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2017 02:55:49.0668 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0911 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170612_195618_783903_591C0141 X-CRM114-Status: GOOD ( 13.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nikita.yoush@cogentembedded.com, Dong Aisheng , fugang.duan@nxp.com, dongas86@gmail.com, gregkh@linuxfoundation.org, yangbo.lu@nxp.com, linux-kernel@vger.kernel.org, stefan@agner.ch, andy.shevchenko@gmail.com, Mingkai.Hu@nxp.com, jslaby@suse.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Due to the original lpuart32_read/write takes no port specific information arguments, it's hard to distinguish port difference within the API. Although it works before, but not suitable anymore when adding more new chips support. So let's convert it to accept a new struct uart_port argument to make it be able to retrieve more port specific information. This is a preparation for the later adding new chips support more easily. No functions changes. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Stefan Agner Cc: Mingkai Hu Cc: Yangbo Lu Cc: Fugang Duan Cc: Andy Shevchenko Cc: Nikita Yushchenko Signed-off-by: Dong Aisheng --- ChangeLog: v3->v4: * No changes v2->v3: * newly introduced --- drivers/tty/serial/fsl_lpuart.c | 123 ++++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 61 deletions(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index c17a0ea..32d479b 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -279,14 +279,15 @@ MODULE_DEVICE_TABLE(of, lpuart_dt_ids); /* Forward declare this for the dma callbacks*/ static void lpuart_dma_tx_complete(void *arg); -static u32 lpuart32_read(void __iomem *addr) +static inline u32 lpuart32_read(struct uart_port *port, u32 reg_off) { - return ioread32be(addr); + return ioread32be(port->membase + reg_off); } -static void lpuart32_write(u32 val, void __iomem *addr) +static inline void lpuart32_write(struct uart_port *port, u32 val, + u32 reg_off) { - iowrite32be(val, addr); + iowrite32be(val, port->membase + reg_off); } static void lpuart_stop_tx(struct uart_port *port) @@ -302,9 +303,9 @@ static void lpuart32_stop_tx(struct uart_port *port) { unsigned long temp; - temp = lpuart32_read(port->membase + UARTCTRL); + temp = lpuart32_read(port, UARTCTRL); temp &= ~(UARTCTRL_TIE | UARTCTRL_TCIE); - lpuart32_write(temp, port->membase + UARTCTRL); + lpuart32_write(port, temp, UARTCTRL); } static void lpuart_stop_rx(struct uart_port *port) @@ -319,8 +320,8 @@ static void lpuart32_stop_rx(struct uart_port *port) { unsigned long temp; - temp = lpuart32_read(port->membase + UARTCTRL); - lpuart32_write(temp & ~UARTCTRL_RE, port->membase + UARTCTRL); + temp = lpuart32_read(port, UARTCTRL); + lpuart32_write(port, temp & ~UARTCTRL_RE, UARTCTRL); } static void lpuart_dma_tx(struct lpuart_port *sport) @@ -519,14 +520,14 @@ static inline void lpuart32_transmit_buffer(struct lpuart_port *sport) struct circ_buf *xmit = &sport->port.state->xmit; unsigned long txcnt; - txcnt = lpuart32_read(sport->port.membase + UARTWATER); + txcnt = lpuart32_read(&sport->port, UARTWATER); txcnt = txcnt >> UARTWATER_TXCNT_OFF; txcnt &= UARTWATER_COUNT_MASK; while (!uart_circ_empty(xmit) && (txcnt < sport->txfifo_size)) { - lpuart32_write(xmit->buf[xmit->tail], sport->port.membase + UARTDATA); + lpuart32_write(&sport->port, xmit->buf[xmit->tail], UARTDATA); xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); sport->port.icount.tx++; - txcnt = lpuart32_read(sport->port.membase + UARTWATER); + txcnt = lpuart32_read(&sport->port, UARTWATER); txcnt = txcnt >> UARTWATER_TXCNT_OFF; txcnt &= UARTWATER_COUNT_MASK; } @@ -562,10 +563,10 @@ static void lpuart32_start_tx(struct uart_port *port) struct lpuart_port *sport = container_of(port, struct lpuart_port, port); unsigned long temp; - temp = lpuart32_read(port->membase + UARTCTRL); - lpuart32_write(temp | UARTCTRL_TIE, port->membase + UARTCTRL); + temp = lpuart32_read(port, UARTCTRL); + lpuart32_write(port, temp | UARTCTRL_TIE, UARTCTRL); - if (lpuart32_read(port->membase + UARTSTAT) & UARTSTAT_TDRE) + if (lpuart32_read(port, UARTSTAT) & UARTSTAT_TDRE) lpuart32_transmit_buffer(sport); } @@ -588,7 +589,7 @@ static unsigned int lpuart_tx_empty(struct uart_port *port) static unsigned int lpuart32_tx_empty(struct uart_port *port) { - return (lpuart32_read(port->membase + UARTSTAT) & UARTSTAT_TC) ? + return (lpuart32_read(port, UARTSTAT) & UARTSTAT_TC) ? TIOCSER_TEMT : 0; } @@ -601,7 +602,7 @@ static irqreturn_t lpuart_txint(int irq, void *dev_id) spin_lock_irqsave(&sport->port.lock, flags); if (sport->port.x_char) { if (sport->port.iotype & UPIO_MEM32BE) - lpuart32_write(sport->port.x_char, sport->port.membase + UARTDATA); + lpuart32_write(&sport->port, sport->port.x_char, UARTDATA); else writeb(sport->port.x_char, sport->port.membase + UARTDR); goto out; @@ -701,15 +702,15 @@ static irqreturn_t lpuart32_rxint(int irq, void *dev_id) spin_lock_irqsave(&sport->port.lock, flags); - while (!(lpuart32_read(sport->port.membase + UARTFIFO) & UARTFIFO_RXEMPT)) { + while (!(lpuart32_read(&sport->port, UARTFIFO) & UARTFIFO_RXEMPT)) { flg = TTY_NORMAL; sport->port.icount.rx++; /* * to clear the FE, OR, NF, FE, PE flags, * read STAT then read DATA reg */ - sr = lpuart32_read(sport->port.membase + UARTSTAT); - rx = lpuart32_read(sport->port.membase + UARTDATA); + sr = lpuart32_read(&sport->port, UARTSTAT); + rx = lpuart32_read(&sport->port, UARTDATA); rx &= 0x3ff; if (uart_handle_sysrq_char(&sport->port, (unsigned char)rx)) @@ -776,18 +777,18 @@ static irqreturn_t lpuart32_int(int irq, void *dev_id) struct lpuart_port *sport = dev_id; unsigned long sts, rxcount; - sts = lpuart32_read(sport->port.membase + UARTSTAT); - rxcount = lpuart32_read(sport->port.membase + UARTWATER); + sts = lpuart32_read(&sport->port, UARTSTAT); + rxcount = lpuart32_read(&sport->port, UARTWATER); rxcount = rxcount >> UARTWATER_RXCNT_OFF; if (sts & UARTSTAT_RDRF || rxcount > 0) lpuart32_rxint(irq, dev_id); if ((sts & UARTSTAT_TDRE) && - !(lpuart32_read(sport->port.membase + UARTBAUD) & UARTBAUD_TDMAE)) + !(lpuart32_read(&sport->port, UARTBAUD) & UARTBAUD_TDMAE)) lpuart_txint(irq, dev_id); - lpuart32_write(sts, sport->port.membase + UARTSTAT); + lpuart32_write(&sport->port, sts, UARTSTAT); return IRQ_HANDLED; } @@ -1048,7 +1049,7 @@ static unsigned int lpuart32_get_mctrl(struct uart_port *port) unsigned int temp = 0; unsigned long reg; - reg = lpuart32_read(port->membase + UARTMODIR); + reg = lpuart32_read(port, UARTMODIR); if (reg & UARTMODIR_TXCTSE) temp |= TIOCM_CTS; @@ -1083,7 +1084,7 @@ static void lpuart32_set_mctrl(struct uart_port *port, unsigned int mctrl) { unsigned long temp; - temp = lpuart32_read(port->membase + UARTMODIR) & + temp = lpuart32_read(port, UARTMODIR) & ~(UARTMODIR_RXRTSE | UARTMODIR_TXCTSE); if (mctrl & TIOCM_RTS) @@ -1092,7 +1093,7 @@ static void lpuart32_set_mctrl(struct uart_port *port, unsigned int mctrl) if (mctrl & TIOCM_CTS) temp |= UARTMODIR_TXCTSE; - lpuart32_write(temp, port->membase + UARTMODIR); + lpuart32_write(port, temp, UARTMODIR); } static void lpuart_break_ctl(struct uart_port *port, int break_state) @@ -1111,12 +1112,12 @@ static void lpuart32_break_ctl(struct uart_port *port, int break_state) { unsigned long temp; - temp = lpuart32_read(port->membase + UARTCTRL) & ~UARTCTRL_SBK; + temp = lpuart32_read(port, UARTCTRL) & ~UARTCTRL_SBK; if (break_state != 0) temp |= UARTCTRL_SBK; - lpuart32_write(temp, port->membase + UARTCTRL); + lpuart32_write(port, temp, UARTCTRL); } static void lpuart_setup_watermark(struct lpuart_port *sport) @@ -1156,24 +1157,24 @@ static void lpuart32_setup_watermark(struct lpuart_port *sport) unsigned long val, ctrl; unsigned long ctrl_saved; - ctrl = lpuart32_read(sport->port.membase + UARTCTRL); + ctrl = lpuart32_read(&sport->port, UARTCTRL); ctrl_saved = ctrl; ctrl &= ~(UARTCTRL_TIE | UARTCTRL_TCIE | UARTCTRL_TE | UARTCTRL_RIE | UARTCTRL_RE); - lpuart32_write(ctrl, sport->port.membase + UARTCTRL); + lpuart32_write(&sport->port, ctrl, UARTCTRL); /* enable FIFO mode */ - val = lpuart32_read(sport->port.membase + UARTFIFO); + val = lpuart32_read(&sport->port, UARTFIFO); val |= UARTFIFO_TXFE | UARTFIFO_RXFE; val |= UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH; - lpuart32_write(val, sport->port.membase + UARTFIFO); + lpuart32_write(&sport->port, val, UARTFIFO); /* set the watermark */ val = (0x1 << UARTWATER_RXWATER_OFF) | (0x0 << UARTWATER_TXWATER_OFF); - lpuart32_write(val, sport->port.membase + UARTWATER); + lpuart32_write(&sport->port, val, UARTWATER); /* Restore cr2 */ - lpuart32_write(ctrl_saved, sport->port.membase + UARTCTRL); + lpuart32_write(&sport->port, ctrl_saved, UARTCTRL); } static void rx_dma_timer_init(struct lpuart_port *sport) @@ -1249,7 +1250,7 @@ static int lpuart32_startup(struct uart_port *port) unsigned long temp; /* determine FIFO size */ - temp = lpuart32_read(sport->port.membase + UARTFIFO); + temp = lpuart32_read(&sport->port, UARTFIFO); sport->txfifo_size = 0x1 << (((temp >> UARTFIFO_TXSIZE_OFF) & UARTFIFO_FIFOSIZE_MASK) - 1); @@ -1266,10 +1267,10 @@ static int lpuart32_startup(struct uart_port *port) lpuart32_setup_watermark(sport); - temp = lpuart32_read(sport->port.membase + UARTCTRL); + temp = lpuart32_read(&sport->port, UARTCTRL); temp |= (UARTCTRL_RIE | UARTCTRL_TIE | UARTCTRL_RE | UARTCTRL_TE); temp |= UARTCTRL_ILIE; - lpuart32_write(temp, sport->port.membase + UARTCTRL); + lpuart32_write(&sport->port, temp, UARTCTRL); spin_unlock_irqrestore(&sport->port.lock, flags); return 0; @@ -1318,10 +1319,10 @@ static void lpuart32_shutdown(struct uart_port *port) spin_lock_irqsave(&port->lock, flags); /* disable Rx/Tx and interrupts */ - temp = lpuart32_read(port->membase + UARTCTRL); + temp = lpuart32_read(port, UARTCTRL); temp &= ~(UARTCTRL_TE | UARTCTRL_RE | UARTCTRL_TIE | UARTCTRL_TCIE | UARTCTRL_RIE); - lpuart32_write(temp, port->membase + UARTCTRL); + lpuart32_write(port, temp, UARTCTRL); spin_unlock_irqrestore(&port->lock, flags); @@ -1496,9 +1497,9 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, unsigned int old_csize = old ? old->c_cflag & CSIZE : CS8; unsigned int sbr; - ctrl = old_ctrl = lpuart32_read(sport->port.membase + UARTCTRL); - bd = lpuart32_read(sport->port.membase + UARTBAUD); - modem = lpuart32_read(sport->port.membase + UARTMODIR); + ctrl = old_ctrl = lpuart32_read(&sport->port, UARTCTRL); + bd = lpuart32_read(&sport->port, UARTBAUD); + modem = lpuart32_read(&sport->port, UARTMODIR); /* * only support CS8 and CS7, and for CS7 must enable PE. * supported mode: @@ -1584,21 +1585,21 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, uart_update_timeout(port, termios->c_cflag, baud); /* wait transmit engin complete */ - while (!(lpuart32_read(sport->port.membase + UARTSTAT) & UARTSTAT_TC)) + while (!(lpuart32_read(&sport->port, UARTSTAT) & UARTSTAT_TC)) barrier(); /* disable transmit and receive */ - lpuart32_write(old_ctrl & ~(UARTCTRL_TE | UARTCTRL_RE), - sport->port.membase + UARTCTRL); + lpuart32_write(&sport->port, old_ctrl & ~(UARTCTRL_TE | UARTCTRL_RE), + UARTCTRL); sbr = sport->port.uartclk / (16 * baud); bd &= ~UARTBAUD_SBR_MASK; bd |= sbr & UARTBAUD_SBR_MASK; bd |= UARTBAUD_BOTHEDGE; bd &= ~(UARTBAUD_TDMAE | UARTBAUD_RDMAE); - lpuart32_write(bd, sport->port.membase + UARTBAUD); - lpuart32_write(modem, sport->port.membase + UARTMODIR); - lpuart32_write(ctrl, sport->port.membase + UARTCTRL); + lpuart32_write(&sport->port, bd, UARTBAUD); + lpuart32_write(&sport->port, modem, UARTMODIR); + lpuart32_write(&sport->port, ctrl, UARTCTRL); /* restore control register */ spin_unlock_irqrestore(&sport->port.lock, flags); @@ -1701,10 +1702,10 @@ static void lpuart_console_putchar(struct uart_port *port, int ch) static void lpuart32_console_putchar(struct uart_port *port, int ch) { - while (!(lpuart32_read(port->membase + UARTSTAT) & UARTSTAT_TDRE)) + while (!(lpuart32_read(port, UARTSTAT) & UARTSTAT_TDRE)) barrier(); - lpuart32_write(ch, port->membase + UARTDATA); + lpuart32_write(port, ch, UARTDATA); } static void @@ -1752,18 +1753,18 @@ lpuart32_console_write(struct console *co, const char *s, unsigned int count) spin_lock_irqsave(&sport->port.lock, flags); /* first save CR2 and then disable interrupts */ - cr = old_cr = lpuart32_read(sport->port.membase + UARTCTRL); + cr = old_cr = lpuart32_read(&sport->port, UARTCTRL); cr |= (UARTCTRL_TE | UARTCTRL_RE); cr &= ~(UARTCTRL_TIE | UARTCTRL_TCIE | UARTCTRL_RIE); - lpuart32_write(cr, sport->port.membase + UARTCTRL); + lpuart32_write(&sport->port, cr, UARTCTRL); uart_console_write(&sport->port, s, count, lpuart32_console_putchar); /* wait for transmitter finish complete and restore CR2 */ - while (!(lpuart32_read(sport->port.membase + UARTSTAT) & UARTSTAT_TC)) + while (!(lpuart32_read(&sport->port, UARTSTAT) & UARTSTAT_TC)) barrier(); - lpuart32_write(old_cr, sport->port.membase + UARTCTRL); + lpuart32_write(&sport->port, old_cr, UARTCTRL); if (locked) spin_unlock_irqrestore(&sport->port.lock, flags); @@ -1829,14 +1830,14 @@ lpuart32_console_get_options(struct lpuart_port *sport, int *baud, unsigned long cr, bd; unsigned int sbr, uartclk, baud_raw; - cr = lpuart32_read(sport->port.membase + UARTCTRL); + cr = lpuart32_read(&sport->port, UARTCTRL); cr &= UARTCTRL_TE | UARTCTRL_RE; if (!cr) return; /* ok, the port was enabled */ - cr = lpuart32_read(sport->port.membase + UARTCTRL); + cr = lpuart32_read(&sport->port, UARTCTRL); *parity = 'n'; if (cr & UARTCTRL_PE) { @@ -1851,7 +1852,7 @@ lpuart32_console_get_options(struct lpuart_port *sport, int *baud, else *bits = 8; - bd = lpuart32_read(sport->port.membase + UARTBAUD); + bd = lpuart32_read(&sport->port, UARTBAUD); bd &= UARTBAUD_SBR_MASK; sbr = bd; uartclk = clk_get_rate(sport->clk); @@ -2095,9 +2096,9 @@ static int lpuart_suspend(struct device *dev) if (sport->port.iotype & UPIO_MEM32BE) { /* disable Rx/Tx and interrupts */ - temp = lpuart32_read(sport->port.membase + UARTCTRL); + temp = lpuart32_read(&sport->port, UARTCTRL); temp &= ~(UARTCTRL_TE | UARTCTRL_TIE | UARTCTRL_TCIE); - lpuart32_write(temp, sport->port.membase + UARTCTRL); + lpuart32_write(&sport->port, temp, UARTCTRL); } else { /* disable Rx/Tx and interrupts */ temp = readb(sport->port.membase + UARTCR2); @@ -2146,10 +2147,10 @@ static int lpuart_resume(struct device *dev) if (sport->port.iotype & UPIO_MEM32BE) { lpuart32_setup_watermark(sport); - temp = lpuart32_read(sport->port.membase + UARTCTRL); + temp = lpuart32_read(&sport->port, UARTCTRL); temp |= (UARTCTRL_RIE | UARTCTRL_TIE | UARTCTRL_RE | UARTCTRL_TE | UARTCTRL_ILIE); - lpuart32_write(temp, sport->port.membase + UARTCTRL); + lpuart32_write(&sport->port, temp, UARTCTRL); } else { lpuart_setup_watermark(sport); temp = readb(sport->port.membase + UARTCR2);