From patchwork Tue Jul 19 07:43:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhuvanchandra DV X-Patchwork-Id: 9236245 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 0415B6075D for ; Tue, 19 Jul 2016 07:47:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAEAB2015F for ; Tue, 19 Jul 2016 07:47:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF55C2074F; Tue, 19 Jul 2016 07:47:30 +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=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 727CD2015F for ; Tue, 19 Jul 2016 07:47:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bPPj4-0007sQ-Se; Tue, 19 Jul 2016 07:45:58 +0000 Received: from mail-ve1eur01on0138.outbound.protection.outlook.com ([104.47.1.138] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bPPi8-0006IE-Uw for linux-arm-kernel@lists.infradead.org; Tue, 19 Jul 2016 07:45:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.onmicrosoft.com; s=selector1-toradex-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=kG11VuPUB99j+3lQTRb1aY4k8MJIPDetr3J3iQhWojY=; b=syiE5YFIlxE8GaXapEOTQv6iDS6pofg43q+FACAYtl2N3UcxNyjQjfWgbFidhZoCozzFc35Ab2MoHBwaU/QFKK+38gfP629iEKpLvbHbmtvSUxCLLshiJldxYIe9DZktLX0LHjB3YXrV3pV2BaoYVHgnolxi1VY64f6ndgF5eS0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=bhuvanchandra.dv@toradex.com; Received: from tdx-in-nb-0014.toradex.ext (115.115.243.34) by DB6PR0501MB2087.eurprd05.prod.outlook.com (10.168.9.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.544.10; Tue, 19 Jul 2016 07:44:46 +0000 From: Bhuvanchandra DV To: Subject: [PATCH RESEND v2 4/8] tty: serial: fsl_lpuart: Fix broken 8m/s1 support Date: Tue, 19 Jul 2016 13:13:06 +0530 Message-ID: <20160719074310.16872-5-bhuvanchandra.dv@toradex.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160719074310.16872-1-bhuvanchandra.dv@toradex.com> References: <20160719074310.16872-1-bhuvanchandra.dv@toradex.com> MIME-Version: 1.0 X-Originating-IP: [115.115.243.34] X-ClientProxiedBy: MA1PR01CA0045.INDPRD01.PROD.OUTLOOK.COM (10.164.116.145) To DB6PR0501MB2087.eurprd05.prod.outlook.com (10.168.9.139) X-MS-Office365-Filtering-Correlation-Id: 219512ec-b385-4251-fd2b-08d3afa88fae X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2087; 2:DnuyDugcE3RXu5/s0xiCx0okBwWvzy7j0A4AufCUb474fvG+aayvNlu1QrpfqbMNQ/3718A2tJGrnBTLqC13P4hcqO8KbPmuXN9DaEoRBqMX+EuSzsk2Udu3VC2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fVy++tNj0mtyPDgVHmBrrF2wD/AioAYzHyChge/p1g0b+dgiKU2ycbY2clQb4Hyow8lRK8I0mnNkKVCtdaex6CVCfoalDXeuv9slYHhEO01FRV2CHc3G2HXGffiBB5rGax/RePI36Cp5WRtcfuJP1sIHXASPMJDp98k0Af56+bOresuWiJnPpNOluQHdPosBDfYCrTm3yCwtPif/Q88rMqzfBo2XBzy6mhKUYA==; 4:uJgKwHugLMIqNNKg/iosw7bQ7A+NnyQwqUxc/V8e8KuFLzyKAUyMB3PztGOGJrB0908hVNDK576nws6pWbSpZUTJNYBMl4XOPr+pno/XkiEcPkHbxRsomOueBDsJfuQwrxmnRKvvzoDQb5NFXc4mMx0rkbfVrgtHGW/fM8UYNeb1idq4NWtv5at4nrDHC7Ei4TaZp/JbYAOfSTBw9R0BRd4Gx3feTzU3TF3rVYzQAoh5AE3BFUDX7nvaq/MfBm+ATpMkvDyamTW4bsK0tQpcaenuMIvHrCd1rCXd1VPHKTGM3FTJzVydm5Bo04Z9izmwwiPA6sMGE92qJzUdfWXuSfV3SnHmitGiErzsiP1be8TrQAssmZj/RLOUZcL6l/CN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:DB6PR0501MB2087; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2087; X-Forefront-PRVS: 000800954F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(77096005)(36756003)(42186005)(69596002)(4001430100002)(19580395003)(86362001)(7736002)(19580405001)(47776003)(5003940100001)(2950100001)(92566002)(50466002)(66066001)(76176999)(50986999)(50226002)(4326007)(48376002)(6116002)(3846002)(1076002)(586003)(97736004)(305945005)(68736007)(189998001)(105586002)(8676002)(110136002)(107886002)(53416004)(101416001)(2906002)(2351001)(81156014)(81166006)(229853001)(106356001)(7846002)(33646002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0501MB2087; H:tdx-in-nb-0014.toradex.ext; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: toradex.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0501MB2087; 23:lLFWpzGz8H8Z8OP2vJ5jC/3w6r8KVtqMcd8gfAK?= =?us-ascii?Q?yq8f8H+Fz7vxSxQV3xK2CQaEiq8rgSJi22VsXyySb3L/KnN8lx2kRt/WRXTx?= =?us-ascii?Q?R38pOr5DPUclbJdhT1Gc7Qwbk5pzJVCiT0lMEsQS7uuxBqtbSlEgsOygN5Kf?= =?us-ascii?Q?88q47x4wtyJJM9xMcemWoAlM7ESoEQ9pw2MxkRMDYMyIaeauc+M6nNonwf5O?= =?us-ascii?Q?xT28hmMxKB5PszUTqaEDGgGVlIfZ4mpvgAwnqTl5nrOO9Su1vuW6I5xR17K0?= =?us-ascii?Q?wwQXhevjgTk9dkG+CJgWIRuWpeE1TfRfRCoWD82sETrwGPYRUwe9L5nIX7j2?= =?us-ascii?Q?5LyoLmq+AzCs2Adt1rpRi5lVquNV1elqSlYmQkWJ2JBhURN9tQAlUTCrs4jT?= =?us-ascii?Q?sM9saPpqWUlQ0fWUZcLKqex9g8nt50TOs1qoGAv7u6BuKsHzclAvBm4z4bRE?= =?us-ascii?Q?EyJ7Idiz3WH2YaSr32D4WS0ObDHkNZY7WnxsOd/e/ffSUXykNS0t9LxVyOHU?= =?us-ascii?Q?2PEKZdu3zKacY95wMpBRm5hQ26oynRbaT1jNZZpC7jrGweKjj6oXl+y+7GLk?= =?us-ascii?Q?NlG51dFBDDe9gbvnSh8QBIrlht4E89JAas5QHukCcyEV5gQ9ufMNNaihO+ll?= =?us-ascii?Q?KhXefEIf6uoq3SmRx4gjsbSgz3iJ8HUtMTCfOI4TPKGUTpqXuIANOPK2Otb2?= =?us-ascii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CqwHCeHc/weBv4zu2l/WshxcK/p6hvdoVPJs9bPoPcDEo8GoxA==; 24:5POYRpT9GE0zOAgvK2oBPeJKct7HcC69qWZMFjNBU36lCHDbJOTD9hQFV2578w8SpNa3c4GIGw3/xqDyow7BupYE/zyGEFlCOteGDbNrrNw=; 7:wgkIqGBxgMdHxFkFJx7/gGaxW7VO3G8cCTPJSp8onunRa2koFR++5BwgxNFdxHBuCxj/apHhWevGmOkRv777E1Sx/Xltw2696EIBG2uoZXw1sUKIn92zAMTFnM8zV8pzH2aeWjc8EdWbLL4nZOqAv9dpn92NjWd4RmpDfHct+ij8vP10jzQRojLt/6bOyDdiLdXq7wAWz1f8iibl6gn8JnlvAQCpPS6ESf8LbKVULLJulzNPc4Rdv926h6QqWmSS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2016 07:44:46.5718 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2087 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160719_004501_357037_D97B67D1 X-CRM114-Status: GOOD ( 10.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-serial@vger.kernel.org, mturquette@baylibre.com, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, stefan@agner.ch, kernel@pengutronix.de, jslaby@suse.com, shawnguo@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bhuvanchandra DV 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 By default the driver always configure the mode as 8s1 even when 8m1 mode is selected. Fix this by adding support to control the space/mark bit. Signed-off-by: Bhuvanchandra DV --- drivers/tty/serial/fsl_lpuart.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 97c1fda..615f191 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1220,13 +1220,14 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios, { struct lpuart_port *sport = container_of(port, struct lpuart_port, port); unsigned long flags; - unsigned char cr1, old_cr1, old_cr2, cr4, bdh, modem; + unsigned char cr1, old_cr1, old_cr2, cr3, cr4, bdh, modem; unsigned int baud; unsigned int old_csize = old ? old->c_cflag & CSIZE : CS8; unsigned int sbr, brfa; cr1 = old_cr1 = readb(sport->port.membase + UARTCR1); old_cr2 = readb(sport->port.membase + UARTCR2); + cr3 = readb(sport->port.membase + UARTCR3); cr4 = readb(sport->port.membase + UARTCR4); bdh = readb(sport->port.membase + UARTBDH); modem = readb(sport->port.membase + UARTMODEM); @@ -1274,7 +1275,10 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios, if ((termios->c_cflag & PARENB)) { if (termios->c_cflag & CMSPAR) { cr1 &= ~UARTCR1_PE; - cr1 |= UARTCR1_M; + if (termios->c_cflag & PARODD) + cr3 |= UARTCR3_T8; + else + cr3 &= ~UARTCR3_T8; } else { cr1 |= UARTCR1_PE; if ((termios->c_cflag & CSIZE) == CS8) @@ -1342,6 +1346,7 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios, writeb(cr4 | brfa, sport->port.membase + UARTCR4); writeb(bdh, sport->port.membase + UARTBDH); writeb(sbr & 0xFF, sport->port.membase + UARTBDL); + writeb(cr3, sport->port.membase + UARTCR3); writeb(cr1, sport->port.membase + UARTCR1); writeb(modem, sport->port.membase + UARTMODEM);