From patchwork Tue Jun 28 05:32:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhuvanchandra DV X-Patchwork-Id: 9201917 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 2A9A360757 for ; Tue, 28 Jun 2016 06:08:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AFE6285E8 for ; Tue, 28 Jun 2016 06:08:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F6FE285ED; Tue, 28 Jun 2016 06:08:29 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 9F6CF285E8 for ; Tue, 28 Jun 2016 06:08:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751158AbcF1GIL (ORCPT ); Tue, 28 Jun 2016 02:08:11 -0400 Received: from mail-am1on0136.outbound.protection.outlook.com ([157.56.112.136]:31280 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752349AbcF1GIG (ORCPT ); Tue, 28 Jun 2016 02:08:06 -0400 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=P3wVlZ62EFG0PH4KZ0A2rvIL8tlTt3WbO20RreexgYME5I4EpP7vq7aHBo5kGIGF66x6uMuPFfGVkRQbGKDfG36bZc+L6OhpHQkBaD2VtPju0PMIAggbOO5GGTHjBq7wMpgMxH9BhwxoIAteBPK4++dXAVnGx3txlpUcgYKDpUI= 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 HE1PR0501MB2089.eurprd05.prod.outlook.com (10.167.246.9) with Microsoft SMTP Server (TLS) id 15.1.523.12; Tue, 28 Jun 2016 05:33:24 +0000 From: Bhuvanchandra DV To: CC: , , , , , , , , , , "Bhuvanchandra DV" Subject: [PATCH v2 5/9] tty: serial: fsl_lpuart: Fix broken 8m/s1 support Date: Tue, 28 Jun 2016 11:02:31 +0530 Message-ID: <20160628053235.5114-6-bhuvanchandra.dv@toradex.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160628053235.5114-1-bhuvanchandra.dv@toradex.com> References: <20160628053235.5114-1-bhuvanchandra.dv@toradex.com> MIME-Version: 1.0 X-Originating-IP: [115.115.243.34] X-ClientProxiedBy: BM1PR01CA0056.INDPRD01.PROD.OUTLOOK.COM (10.163.199.28) To HE1PR0501MB2089.eurprd05.prod.outlook.com (10.167.246.9) X-MS-Office365-Filtering-Correlation-Id: 2d44df81-6cff-4865-3cb2-08d39f15baf4 X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2089; 2:Mm7Y/l6v+hOqEC/SZufvwLJuPh2wxhmqMTpbusTcIIkwEtL72/8bEu8insD9tGHZItq2Fu50Kb0t2a77TlL5yxTJQyZ7x+li+w0YSVWjX2nGQI+B6mWSf2ic/fn133NXYY16xZt1IqblJDmL2fojhCej68km1MO2CGfRhqZ59wm7++Yo4hsl3lc8kAqLhNo4; 3:Q0hK8QcfS8vXVUljD1JF6U+5mOA2ondOLoa908bCva9yw9C9fsehwoGI354f92ysT2LkDvxRDKuL0MehP5Xm+gnanddPmz6kD+NcvuxVlnN4SANB0VPeOriVyXqMY9lJ X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0501MB2089; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2089; 25:5HpEOKrko6saGo6FEXXkJTH+Gz8yNZnGxPxHU5kONzkyZrh2hZNBsUoOEjswaw/NHSMk71LRnYt/H/e/NfJ1K//naw6BtDflE/l51+yaxZ8VqRLJiB9BOGFGoIAVdCBBINoBbFTh7KXnxmH0ca/rHVQGP5AsTQB9sNRE3QMuMjHX7qwqhLlB1ABQ5s3DEuAEELKikVqG1ry+cglOFXrH6yje1D4RM0/LT6tMmmW5530vSWjyVCgs4YiTqizV/dSDvHoUq5iry05XF52NCBOVQIb6Xg17HzEHCcT0+R7swbnvyb1+FrHvzBNQKI81CgeEzlSGFRJ5TTmcG83+beKYLcSwLVJtx3EDw7L+as7zBTIGHVGsGL7z7xIgiVC8mYUVOcP3JvAbPc6DI6oDLNAtmr+wyJan5GuhRxA+mXs276f61NV/vbfstur8VC0J8AtHPldVFphAc2YxgOoLKYQf8GAOD0CWru7npazWxQwyYaqbIOea2LU6Fh+WkTqIzHPohWt2Vk5FFY1rAUOL2I5ep0RbyNNkYihhoAOH/+5363aK6qaD0QO+SVxGZFAYB1LBw9QJqVNFo9AEJ0HRnvSzXqoWyglK+HBIhwCG0cr11fRvwaLdKT7Qu752oQS4uBm4cJn1Gh1U+yAvO2BW/RNqb2vbM7RHO7Krr1Hu09PJC9jfRN2jvK5PspWtwsyInaVtFu6c36ABr8/UKQh2v5bW+PWY/haIvGtj1tkI5epnQ/8= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2089; 20:I1cdU218WsGfhS7dOJ+d0Ittf0rcBZmWk7/tPYw6DO10N7vGVtvpagbfqa9ZL8AyqfiSY0+TlKTsEG75cf93MvvhRJbdZhJY1yA6LA6gn8nbpShWup7jIxZJAoVhcETxqGCUH5s7GQh2OYSrF+T7ivsHw2KszckOkYc1iV2iKQhWe2fry9lKV3SAyeu5E14mM/xcinCK/JBMPHEjDYqkOUlUOJvc+Nt5sZ0Rmw/1R9tv7I7IQ7O8QHtQGOXa6w18I7BfHWKkV8AWfPSz69AAmm81+IeFngQFfjCMonAZBd8/dTbHjA+vc3u7O/yAgu/dHZNcMAht7VvCjOgeMMIIpw==; 4:nuoo7PWzJdoalOiklvRIfYnTZqauDGiuj0v3SaxiCtoqjNr/30ttqjEssolC179RSXI9ek+cOtrR4L7E3k0C8bYHRoDydYBcrBjPk+ty7Joxqu/nRffdGYebQn3v9T3W7z8PcLNrdrQmEYLBVxLkNvMBUmUY8ciM9bCQqhzVo36Lw7HZQ/D8WfZoTdIq1syXeWZ+U9xFSMnHsCo/BHKlV4FijJ0UT1H7jH6tCmGO10Vjn0V71tzTu/XNS+dy/XTo9Ggc85WoKCsu+0ZMPd9PZRQfk7Jg5PKBfHzMIQ6gX0+fknFVyk/MPQfBYVDPYL8eh+KBm2m0KoLNWuJG2nAbsX8uCBty1k69QPQbWy0mRWQyTo0ETigB7gWUXJ9Q+Kuc 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)(10201501046)(3002001); SRVR:HE1PR0501MB2089; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2089; X-Forefront-PRVS: 0987ACA2E2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(979002)(6009001)(7916002)(199003)(189002)(189998001)(50226002)(110136002)(107886002)(7846002)(47776003)(66066001)(36756003)(8676002)(101416001)(1076002)(48376002)(33646002)(6116002)(81166006)(92566002)(3846002)(50986999)(586003)(81156014)(50466002)(2351001)(2950100001)(77096005)(105586002)(229853001)(86362001)(76176999)(5003940100001)(68736007)(305945005)(106356001)(4326007)(7736002)(53416004)(4001430100002)(19580405001)(19580395003)(69596002)(42186005)(97736004)(2906002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0501MB2089; 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; HE1PR0501MB2089; 23:sCkhkQuz8fSJ2uzPBlBCkMOhbjmBSvyzsn6ndCj?= =?us-ascii?Q?vCeaTcr2DMRa+E9+cH63qjj8D+dbdB3+6FWafOZpmy/DarARwWzw9pdJDa1m?= =?us-ascii?Q?2ebnOHtb7QtQ3stfIir4bMevN0F9f/tuDrJw9twwbHCrH57tZ6OK2dYaYpAR?= =?us-ascii?Q?cplRdHZn5sWfk+Gw2+d8YcYYjKwW8uRx6wNHadHxvtEPCA0yyZLnxOQX1dHy?= =?us-ascii?Q?vA16roYiUK9sFI6p/v/qV1JvoN8po27AuDEAlOjzEeRSXyeN3eKAezH7nY5Q?= =?us-ascii?Q?6UPN8abCpLT3yDgxIWdWH6P1Bw9yE0+RZyZ7wSg7MbsZW7Djx5k2E3LRboUQ?= =?us-ascii?Q?9eYEj6gSNaxyCtuljxp28KERoXc59tjklOmU5NEOtuKuuKCb+eWvRUeNNsAM?= =?us-ascii?Q?b0omfi5M3Cdt05bs4ueBKvPBVOrGFL8xzotfua4x2i5FW/R5ddgHhsb+nwZd?= =?us-ascii?Q?FBDI4AhWJpfz3KaGYJrHvqSubs0wDv9T66VZq3qnw3rvQmxMUudDhLkIujny?= =?us-ascii?Q?qAVxgygr62pkHkLTDv9HL3oHcg3wIt5w7xrGLOl9lG8lF4x/4slhU28kfwn7?= =?us-ascii?Q?1s5vfFMT7j7IhggYV9Gewk/DpQvoTZgWVFM6QeQ0NfAodHDuzPRjEAwwLXVQ?= =?us-ascii?Q?PA4YVO9JQqLgJVWY27kKCLhYxMWNxFk5WFPvksAFIgN837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0JYaYPHEoLIFJUXdww; 5:xkkNGqsjon2cYi3ok3mAfgrYCKXw7N1rjSvpWbToYhP0TT4bmQUIByRafuxdoVQ/87FD8i9k7SV9Quhe0FH1pT3XZDQ5IkLsAyYNNqDvWRVPFK9ymeDG5Yo+6bP2JAmoBU0xhMdAqSXbG2hULhFHIQ==; 24:f9YAAgbkQ3oDSQBzGqgAoFITD3X8G8UvzZJtlVdbCn9R5H9t3bHKKphtU1ky6VyjLOn2DyogQRZubjgeJWSMAoZA2Pe8oDXxTDnkc0/XKpg=; 7:dgNfvxVBP9nfON6ykM/W8WtlGc7QXhvz+hs+GZp4kjhJDPbCkR1KnzA0pO//eJKibmOpWdxgN6wc0I2eioYEAWINvu/hpr1o2CSAabV4ScABhn2f8/emK8AyrQGQIZoeFjE1GOCLqjQa1wR2K9XfZM4MxBeBOWjH33OrCZYZRU1E+RAwg29EPwI7eVuv3ZV7x8Tx/2sKR8GiXD3Sn+Qna9U9Imp4EsDF2KUMGbp6qQHvRAHj6sDhTLuWqLLWqO6ghfbI6mQedWChxRgM0KeuDA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2016 05:33:24.5849 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2089 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.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);