From patchwork Tue Nov 22 17:14:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Fritz X-Patchwork-Id: 9441631 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 764AE605EE for ; Tue, 22 Nov 2016 17:18:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66C4E284E7 for ; Tue, 22 Nov 2016 17:18:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B26728571; Tue, 22 Nov 2016 17:18:00 +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=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 4FA5A284E7 for ; Tue, 22 Nov 2016 17:17:59 +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 1c9EfP-00079p-B1; Tue, 22 Nov 2016 17:15:35 +0000 Received: from mail-vk0-x243.google.com ([2607:f8b0:400c:c05::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c9Eeu-0005iX-DS for linux-arm-kernel@lists.infradead.org; Tue, 22 Nov 2016 17:15:05 +0000 Received: by mail-vk0-x243.google.com with SMTP id x186so2441259vkd.2 for ; Tue, 22 Nov 2016 09:14:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dgO3Igs3jWUWFuUNE1rHwgOfMur790IMSMZFoaTwGDE=; b=VOcEPj/RC8NprE8FV/00t4OBUbwe3cDcNA6WKQKKzG0HmR8AFLhx4bugV3O2vnCCDj KQ2qQf4qCQ4mTBiMj6sU3WZaVE3EAKLGwrb9hCLNYrRwVoD9Ds1Z/XDFZ8juO075+GlZ oRPBuDqRpVXeZF5lpoEhSWv6Ns8sLi8ftxjBwOre5DMqp6el9km7ddL7lmX8Bpkw5fxX m6+wAeWGm5KyXCAIbW7IMAuUhp4tf9fArZsi61W+fux8Z11QrJSF31ZmP/QTgZ2/aahx jX6m+2wVM7AgflJ5cjcPig+gJU470GdESsmbyWJUT/CGkjvdAaMoq6whYADzk8hCSmVo b8sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dgO3Igs3jWUWFuUNE1rHwgOfMur790IMSMZFoaTwGDE=; b=kS3/4vQn4446TLc9xppg8/W32AUnZkXIAkNSHjecOrYKxBouHY+R9ZKxc1/OAPOyUW CR4Lep1X3+1vUY6l6DTljaG9DgaMJJcWDevmavIn0DXuNNa27aZklgbPQzHOFQXgZE4w y3S7JSf4FN4o/7qIo7U5pRByKpcZI1kwa3DrT0YqQPojrIR5yq50vDdhrcrnAlamGumN 3pXP3j+ZP2oB2v0wNWfET0tlckq1JjFzKzYpGoe1cIAilrGEpJtrqEVr/2oFuAvR+U76 a4YAXQfSFlzAaLv1UjXfc3ocu6z1ZNhoThcKlfpnYbcP2POk78Da26XksJ40zcA1jKN5 jzqA== X-Gm-Message-State: AKaTC01oa5MDlCpokFrL/peGXVGweaEQBNsJMGE9Wy00hRyVTGR6P+XurEjyaenPorT7wA== X-Received: by 10.25.56.7 with SMTP id f7mr4780181lfa.17.1479834882276; Tue, 22 Nov 2016 09:14:42 -0800 (PST) Received: from lovely.ipredator.se (anon-38-247.vpn.ipredator.se. [46.246.38.247]) by smtp.googlemail.com with ESMTPSA id z2sm6487710lja.10.2016.11.22.09.14.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Nov 2016 09:14:41 -0800 (PST) From: Christoph Fritz To: Rob Herring , Mark Rutland , Greg Kroah-Hartman , Jiri Slaby , Geert Uytterhoeven , Arnd Bergmann Subject: [PATCH 2/2] serial: imx: make DSR irq handling conditional Date: Tue, 22 Nov 2016 18:14:11 +0100 Message-Id: <1479834851-32442-3-git-send-email-chf.fritz@googlemail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1479834851-32442-1-git-send-email-chf.fritz@googlemail.com> References: <1479834851-32442-1-git-send-email-chf.fritz@googlemail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161122_091504_641091_0F7E3510 X-CRM114-Status: GOOD ( 13.90 ) 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: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, u.kleine-koenig@pengutronix.de MIME-Version: 1.0 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 This patch makes use of device-tree property disable-dsr. Disabling DSR can be necessary on i.MX6SX to quirk buggy hardware, for more info see commit 276b891e3879 ("ARM: dts: imx6sx: document SION necessity of ENET1_REF_CLK1"). Signed-off-by: Christoph Fritz --- drivers/tty/serial/imx.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 0df2b1c..bd85a69a4 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -207,6 +207,7 @@ struct imx_port { unsigned int dte_mode:1; unsigned int irda_inv_rx:1; unsigned int irda_inv_tx:1; + unsigned int dsr:1; unsigned short trcv_delay; /* transceiver delay */ struct clk *clk_ipg; struct clk *clk_per; @@ -1219,7 +1220,8 @@ static int imx_startup(struct uart_port *port) /* * Finally, clear and enable interrupts */ - writel(USR1_RTSD | USR1_DTRD, sport->port.membase + USR1); + temp = USR1_RTSD | (sport->dsr ? USR1_DTRD : 0); + writel(temp, sport->port.membase + USR1); writel(USR2_ORE, sport->port.membase + USR2); if (sport->dma_is_inited && !sport->dma_is_enabled) @@ -1259,7 +1261,7 @@ static int imx_startup(struct uart_port *port) * now, too. */ temp |= IMX21_UCR3_RXDMUXSEL | UCR3_ADNIMP | - UCR3_DTRDEN | UCR3_RI | UCR3_DCD; + (sport->dsr ? UCR3_DTRDEN : 0) | UCR3_RI | UCR3_DCD; if (sport->dte_mode) temp &= ~(UCR3_RI | UCR3_DCD); @@ -1987,6 +1989,9 @@ static int serial_imx_probe_dt(struct imx_port *sport, if (of_get_property(np, "fsl,dte-mode", NULL)) sport->dte_mode = 1; + if (!of_property_read_bool(np, "disable-dsr")) + sport->dsr = 1; + return 0; } #else