From patchwork Thu Jun 9 15:10:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhuvanchandra DV X-Patchwork-Id: 9167275 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 3E9FC60467 for ; Thu, 9 Jun 2016 15:13:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 313D128328 for ; Thu, 9 Jun 2016 15:13:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2535028356; Thu, 9 Jun 2016 15:13:52 +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 A344928328 for ; Thu, 9 Jun 2016 15:13:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bB1d8-0005lL-F4; Thu, 09 Jun 2016 15:12:22 +0000 Received: from mail-db5eur01on0101.outbound.protection.outlook.com ([104.47.2.101] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bB1cY-0005FN-7F for linux-arm-kernel@lists.infradead.org; Thu, 09 Jun 2016 15:11:47 +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=qPQu6NVPbVrrzLQ67Ia9WykrPWO7cd2YtnqCSUyD+Ps=; b=ReLYesNKgUgeYGLF0e+yB1rSzxn11bjHzoRqhkAKIRrOw5etZhlK3BVI+BxxCUFNdBf14Q7V44SciawLpqb36IvmCTh6WmzNgUAF/X04/wf5a5aFSE7jEIt+QcAiDsbllh6MRAOAboH+ogh6OldR/DLqlSt9/UONnxhS5P0HqNE= 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 DB4PR05MB270.eurprd05.prod.outlook.com (10.242.158.24) with Microsoft SMTP Server (TLS) id 15.1.511.8; Thu, 9 Jun 2016 15:11:24 +0000 From: Bhuvanchandra DV To: Subject: [PATCH 4/8] tty: serial: fsl_lpuart: Fix broken 8m/s1 support Date: Thu, 9 Jun 2016 20:40:35 +0530 Message-ID: <20160609151039.20817-5-bhuvanchandra.dv@toradex.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160609151039.20817-1-bhuvanchandra.dv@toradex.com> References: <20160609151039.20817-1-bhuvanchandra.dv@toradex.com> MIME-Version: 1.0 X-Originating-IP: [115.115.243.34] X-ClientProxiedBy: SIXPR04CA0050.apcprd04.prod.outlook.com (10.162.171.40) To DB4PR05MB270.eurprd05.prod.outlook.com (10.242.158.24) X-MS-Office365-Filtering-Correlation-Id: 48687c12-9ef6-4273-fd5b-08d3907855c3 X-Microsoft-Exchange-Diagnostics: 1; DB4PR05MB270; 2:1oDvMSKL5jhwlTEWPG2dOhLvSHdKnqiPo1rdmEtbTjPG3EFwFw9IKqgNdKury40r+YGi7TZXK+jQwZZ78e8DfHXPzTyzIkYts3FCPWsFVmcUEqAQ7t2xyQ2pHnsp/U/ye9i1/fm05pFl9Qy6SZI9OOo8CIp1lZl9UnUGEiP+qdBtIOzD08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khtl/sV3uA3TDaGRsMky2VkNL0ZIVwM9AaRLLOgN7I8VbB1bvGn5XNKwSFkNNYV+OJh8Damnzbh9i3DnkChXehymtomNd2es9NVIqgPZUdoImhFuoGSxWTyVHaEFcthyOFq4ETSBtPHE4rZIpALyRoj1vYTlZwv75/s/CGFi8FSOK11uHtKvgdsmI5j7Y0kAlgGIW21oa1m7Qu470MdMFK8dI6Lhr0U+K6K6VHmo1vVBMnhCGXjRzY0an6IjDitQbzyPqyH7qzPMyNL5XQikCgKHvt8ixLoKpm1RR2nvEF7320xm0/B7Y++JyDPXNJKmCzm9MI4rl 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:DB4PR05MB270; BCL:0; PCL:0; RULEID:; SRVR:DB4PR05MB270; X-Forefront-PRVS: 0968D37274 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(189002)(199003)(36756003)(50466002)(4001430100002)(42186005)(1076002)(86362001)(19580395003)(69596002)(48376002)(5008740100001)(81156014)(19580405001)(97736004)(4326007)(2906002)(77096005)(101416001)(81166006)(50226002)(2950100001)(33646002)(6116002)(68736007)(2351001)(3846002)(5003940100001)(107886002)(105586002)(110136002)(106356001)(53416004)(229853001)(50986999)(8676002)(189998001)(92566002)(5004730100002)(66066001)(586003)(76176999)(47776003); DIR:OUT; SFP:1102; SCL:1; SRVR:DB4PR05MB270; H:tdx-in-nb-0014.toradex.ext; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; DB4PR05MB270; 23:NDbBbh+G1N5hbqiLTLpLBgcoSzlyIBpFLHZRBBiQPH?= =?us-ascii?Q?5i7aDYTDI5gXT1oMNw07gX+HdAZgMHotscgF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-ascii?Q?ZXaCZc0WK5SZoULR/lsBlTT2/oZjKN+nOZVI0jbrwxlbsc81ebiFUYbK0nft?= =?us-ascii?Q?BPfs5fONVsJWbZ7+iNCFSCcqcpmSdgD6rFJ93K7RLw/zBRGvDdOu33fLprkN?= =?us-ascii?Q?7Nvibxo1n/SAjWzppqAO+gfGxStcCv+3k0aOqlGHBMtKlM8olyUjTQESfkY4?= =?us-ascii?Q?5GfebFgBdsF2h0VGA9NbPB1CAeifiuzfJdOFPdxwP+SMRbC0Dx5Q=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DB4PR05MB270; 5:bOq787AVaUyJoBvpLPvSV5Xwg29+ybLM/yOyZpy0LzfbetNuHyDGUEYVtGDKRXbtqJfjfn1lVyS00OEYdMCM1ESEAu7RP5rk+XY/bEh8KZJFNOxi1Hx9Tq+ucVjNBMgQuYUTMJ9NsixJViU6TqL5kw==; 24:QCuMPsiWP/IRTQtGoQJXcXgVfBbxJwzAcxLfa1aSoMhiTEhwh2BBoPxBPm+UjOt/8B7OsAFNRkpaflp920vfqQA9bi4JXhMQ1khTNvnhnX0=; 7:++f+ixOs/rGQOfNqA2FyXkblrcjbWyqqRW+bwDF8hfQghcBLC8hfsjQylIQ7EkfXfYVM7gmzP1d/VsVVgPnCY/jRuiY/yyjejHHF+Q/yidGf2tfRYd6TDmZ3Fv9c7gzueV8Ct0Y7OQEx848Y8c3COVWXXGJa5+u6eLXg8XlUpekZUdd53WXyIyEfRYw0IvEtlX8T06LIWp6fDDgDfIYogA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2016 15:11:24.9691 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR05MB270 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160609_081146_459845_4CF6DF86 X-CRM114-Status: GOOD ( 10.70 ) 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);