From patchwork Wed Feb 1 14:31:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 93033 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2443604qgi; Wed, 1 Feb 2017 06:32:21 -0800 (PST) X-Received: by 10.99.36.3 with SMTP id k3mr4080403pgk.136.1485959541065; Wed, 01 Feb 2017 06:32:21 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m32si19326794pld.31.2017.02.01.06.32.20; Wed, 01 Feb 2017 06:32:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751719AbdBAOb6 (ORCPT + 7 others); Wed, 1 Feb 2017 09:31:58 -0500 Received: from mail-wj0-f177.google.com ([209.85.210.177]:35405 "EHLO mail-wj0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751718AbdBAOb4 (ORCPT ); Wed, 1 Feb 2017 09:31:56 -0500 Received: by mail-wj0-f177.google.com with SMTP id b20so20805821wjs.2 for ; Wed, 01 Feb 2017 06:31:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=r2na34FpogMkG++2SWU5aW2AviMUGR7jHrU4VHLQYFo=; b=V4Qri9+DO/byuwSrFMjty3tFXf59cpNNDr0LQHpwMLUxlhuOZTJIbmjbsJqaBQAr1c I9AlysKv/F1WN8eqgme+Xh2Bk68o462G+7/AMjyMAAduFH7X0e22L/P9TshIjlIfrY+5 EaZHwq0gU1Vd9q7V0bE4Yrb6A3dIKTYCKnBYc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=r2na34FpogMkG++2SWU5aW2AviMUGR7jHrU4VHLQYFo=; b=iVd3UTINd5mBrHcVUNlHmiF6TWEB1zIoWGF+ZJMybKURuPKJGqRSpSnI4584/lVFI1 F6yw5QrmJJ/hKE1Ic4jmDueDgyRN6ol+2fHXW9jH1V/K5ihZ9Mjwe9ypwIZw2q6grk26 IlxSwKd9+gqW6Ej9mIgaKkL88Oe6K/90JjqHd7NggYQmfrbxV47HaN2WSmDkDPU6i4WK zUR+w5EBL1w0Tj3sOZJJgMco/7js+ecNfBfFFjwAXQ2/7rWREOIs3oyjS8yMeN2FVStu pBAlJTdCubHCb1jvS62XW7UCdnGO6kDFq+g7vYifU6hXBX8hZCUgbIWuiUWAW/CwYEJ3 u96Q== X-Gm-Message-State: AIkVDXLKRsLLeu99c1ggczB3+puKo12NGedYWzZdq91qzV1ySf+AHbxdOFJ3m94kBQ2w+Tg/ X-Received: by 10.223.164.85 with SMTP id e21mr3173167wra.111.1485959515424; Wed, 01 Feb 2017 06:31:55 -0800 (PST) Received: from localhost.localdomain (host81-158-165-111.range81-158.btcentralplus.com. [81.158.165.111]) by smtp.gmail.com with ESMTPSA id l37sm34420245wrc.41.2017.02.01.06.31.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Feb 2017 06:31:53 -0800 (PST) From: Lee Jones To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.kernel.org, dt@kernel.org, devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@stlinux.com, patrice.chotard@st.com, Lee Jones Subject: [PATCH v2 03/10] serial: st-asc: Read in all Pinctrl states Date: Wed, 1 Feb 2017 14:31:38 +0000 Message-Id: <20170201143145.31962-4-lee.jones@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170201143145.31962-1-lee.jones@linaro.org> References: <20170201143145.31962-1-lee.jones@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org There are now 2 possible separate/different Pinctrl states which can be provided from platform data. One which encompasses the lines required for HW flow-control (CTS/RTS) and another which does not specify these lines, such that they can be used via GPIO mechanisms for manually toggling (i.e. from a request by `stty`). Signed-off-by: Lee Jones --- drivers/tty/serial/st-asc.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index 397df50..1058020 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -37,10 +38,16 @@ #define ASC_FIFO_SIZE 16 #define ASC_MAX_PORTS 8 +/* Pinctrl states */ +#define DEFAULT 0 +#define NO_HW_FLOWCTRL 1 + struct asc_port { struct uart_port port; struct gpio_desc *rts; struct clk *clk; + struct pinctrl *pinctrl; + struct pinctrl_state *states[2]; unsigned int hw_flow_control:1; unsigned int force_m1:1; }; @@ -694,6 +701,7 @@ static int asc_init_port(struct asc_port *ascport, { struct uart_port *port = &ascport->port; struct resource *res; + int ret; port->iotype = UPIO_MEM; port->flags = UPF_BOOT_AUTOCONF; @@ -720,6 +728,27 @@ static int asc_init_port(struct asc_port *ascport, WARN_ON(ascport->port.uartclk == 0); clk_disable_unprepare(ascport->clk); + ascport->pinctrl = devm_pinctrl_get(&pdev->dev); + if (IS_ERR(ascport->pinctrl)) { + ret = PTR_ERR(ascport->pinctrl); + dev_err(&pdev->dev, "Failed to get Pinctrl: %d\n", ret); + } + + ascport->states[DEFAULT] = + pinctrl_lookup_state(ascport->pinctrl, "default"); + if (IS_ERR(ascport->states[DEFAULT])) { + ret = PTR_ERR(ascport->states[DEFAULT]); + dev_err(&pdev->dev, + "Failed to look up Pinctrl state 'default': %d\n", ret); + return ret; + } + + /* "no-hw-flowctrl" state is optional */ + ascport->states[NO_HW_FLOWCTRL] = + pinctrl_lookup_state(ascport->pinctrl, "no-hw-flowctrl"); + if (IS_ERR(ascport->states[NO_HW_FLOWCTRL])) + ascport->states[NO_HW_FLOWCTRL] = NULL; + return 0; } From patchwork Wed Feb 1 14:31:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 93034 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2443614qgi; Wed, 1 Feb 2017 06:32:22 -0800 (PST) X-Received: by 10.99.238.5 with SMTP id e5mr4021250pgi.49.1485959541965; Wed, 01 Feb 2017 06:32:21 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m32si19326794pld.31.2017.02.01.06.32.21; Wed, 01 Feb 2017 06:32:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751795AbdBAOcB (ORCPT + 7 others); Wed, 1 Feb 2017 09:32:01 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:37060 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751743AbdBAOb7 (ORCPT ); Wed, 1 Feb 2017 09:31:59 -0500 Received: by mail-wm0-f46.google.com with SMTP id v77so40599775wmv.0 for ; Wed, 01 Feb 2017 06:31:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aPbxa8ah0XE+dhDs0+NcSE2Y1lKrBLmO2XqIIPa0q4U=; b=Vw73883YEQxacjy5j1njEDpNdcU21PZ5Bp4R/pj12suR89bhIggYrg52vIeL02AUbq RAw8mEgvm5R+wtc9ZwlBKPE2+hks4uPbkzL+eI2geuQ3zKfvo6UaQzoPfWFd8KVZioVC 6haQwQq+wTfExnExvKZeX+HXlRxzqkACU//CI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aPbxa8ah0XE+dhDs0+NcSE2Y1lKrBLmO2XqIIPa0q4U=; b=onUAq4XR5J2pCGQ5tt5L5RO3V76BI2I7uipV5mAZbpTcaAILLqTXpqnVfVWYgeKptW nlxjv3vrIAJhpkrlr/yQ++/eDEKBXc1AcnvOss+9PW7FkCGQFgmv3eirAQBhDqlNWhet 6ABQCWgyWNq2V5hlybhSm+5ymKqNKssln90Zz4gsIa/+GbIUx4X+gp1YrusOooz8weWb cB+HZia8J76igKoJKp0yBUm1VPX3lW4HaEt5EmmySpCfQ1ySESwYGuCLZn14kGorzAA1 eZt9hjXVPUXTDkHbWKA9oGkKFlsZ6yJvLgNVvFddvSiM0qE9wstfl5OSVhH2UwLnvWMX j6cQ== X-Gm-Message-State: AIkVDXKXPVWQfFBLTuBj/hCII4XiYcl1Ej1Pnch4dKUaiiOklYAMWucblSYc83CJ/iD7Ijax X-Received: by 10.223.166.181 with SMTP id t50mr2922037wrc.80.1485959518180; Wed, 01 Feb 2017 06:31:58 -0800 (PST) Received: from localhost.localdomain (host81-158-165-111.range81-158.btcentralplus.com. [81.158.165.111]) by smtp.gmail.com with ESMTPSA id l37sm34420245wrc.41.2017.02.01.06.31.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Feb 2017 06:31:57 -0800 (PST) From: Lee Jones To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.kernel.org, dt@kernel.org, devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@stlinux.com, patrice.chotard@st.com, Lee Jones Subject: [PATCH v2 05/10] serial: st-asc: Use generic DT binding for announcing RTS/CTS lines Date: Wed, 1 Feb 2017 14:31:40 +0000 Message-Id: <20170201143145.31962-6-lee.jones@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170201143145.31962-1-lee.jones@linaro.org> References: <20170201143145.31962-1-lee.jones@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The initial binding 'st,hw-flow-control' isn't used anywhere, in neither in upstream nor downstream kernels. It isn't even documented in dt-bindings, so we can safely assume it's safe to swap to the generic one. Signed-off-by: Lee Jones --- drivers/tty/serial/st-asc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index e521078..bcf1d33 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -794,7 +794,7 @@ static struct asc_port *asc_of_get_asc_port(struct platform_device *pdev) return NULL; asc_ports[id].hw_flow_control = of_property_read_bool(np, - "st,hw-flow-control"); + "uart-has-rtscts"); asc_ports[id].force_m1 = of_property_read_bool(np, "st,force_m1"); asc_ports[id].port.line = id; asc_ports[id].rts = NULL; From patchwork Wed Feb 1 14:31:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 93040 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2443815qgi; Wed, 1 Feb 2017 06:32:48 -0800 (PST) X-Received: by 10.99.150.10 with SMTP id c10mr4027305pge.160.1485959567938; Wed, 01 Feb 2017 06:32:47 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 205si9343324pgc.109.2017.02.01.06.32.47; Wed, 01 Feb 2017 06:32:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751874AbdBAOcT (ORCPT + 7 others); Wed, 1 Feb 2017 09:32:19 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:38208 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbdBAOcR (ORCPT ); Wed, 1 Feb 2017 09:32:17 -0500 Received: by mail-wm0-f43.google.com with SMTP id r141so41171054wmg.1 for ; Wed, 01 Feb 2017 06:32:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dSspGU4dezopvbtIYWj9ViX150SC5ihDtLhvs1BmA+U=; b=iT1ZhQnVzg+gTdWYjfK8um5i+wIK5fHr0Ks/IgSuPeIYG2/mCmA/FcHRyHekNZmdf1 WZM9ClyhIuzrkk+HBHitUfrsHxtEcnLE1SfgTpdPvZjSK3NpKNYezW/ShD/oNvWRkrZM ML7E8Ts3x6Kn9FUmZszzge3MAV/f+vJdkqAVc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dSspGU4dezopvbtIYWj9ViX150SC5ihDtLhvs1BmA+U=; b=i1PQxI+Y1As3yj/4whQAK3LImnC++HYLdzfGCh6GmIdPUuO9drkip9VdCLTOSWHNQm +e8o5HRYEv9UbAoCFh/O53lsRdCbjP5GyMeeqHQ6N1QN9b+U/kcpsabYRDvCnV+zGr9S Z9BycBs+4igLd92oKwNvYyucCIZhQ4sRBOqpg2krm6eMPSgjTlpsbTdLMXYiad+rhz+D +lG84xJM94wr5okv31Jr+9yY61PP5dk8nlBalS+hynPntaN3p4tkdJlBo52bGz2gpXih S5Wjpr8n0ukAkz0XeukoRzevAJKV4cUS+am2OGM7IdnizJgZDSVFq9/m82kTUHc+YPCB 4BQw== X-Gm-Message-State: AIkVDXLp04/UUaG3LL3Q1V0I+zFBONEMTHzttylqmWz/8QLreQ51pBaMREeHyPkgxVJqqlsq X-Received: by 10.223.167.66 with SMTP id e2mr2878023wrd.48.1485959521217; Wed, 01 Feb 2017 06:32:01 -0800 (PST) Received: from localhost.localdomain (host81-158-165-111.range81-158.btcentralplus.com. [81.158.165.111]) by smtp.gmail.com with ESMTPSA id l37sm34420245wrc.41.2017.02.01.06.32.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Feb 2017 06:32:00 -0800 (PST) From: Lee Jones To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.kernel.org, dt@kernel.org, devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@stlinux.com, patrice.chotard@st.com, Lee Jones Subject: [PATCH v2 08/10] ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control Date: Wed, 1 Feb 2017 14:31:43 +0000 Message-Id: <20170201143145.31962-9-lee.jones@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170201143145.31962-1-lee.jones@linaro.org> References: <20170201143145.31962-1-lee.jones@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Each serial port which supports HW flow-control should have 2 Pinctrl groups. One for when HW flow-control is in progress, where the IP will take over controlling the lines and another group which enables the lines to be toggled using GPIO mechanisms. Acked-by: Peter Griffin Signed-off-by: Lee Jones --- arch/arm/boot/dts/stih407-pinctrl.dtsi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/boot/dts/stih407-pinctrl.dtsi b/arch/arm/boot/dts/stih407-pinctrl.dtsi index daab16b..bd1a82e 100644 --- a/arch/arm/boot/dts/stih407-pinctrl.dtsi +++ b/arch/arm/boot/dts/stih407-pinctrl.dtsi @@ -465,8 +465,16 @@ serial0 { pinctrl_serial0: serial0-0 { st,pins { - tx = <&pio17 0 ALT1 OUT>; - rx = <&pio17 1 ALT1 IN>; + tx = <&pio17 0 ALT1 OUT>; + rx = <&pio17 1 ALT1 IN>; + }; + }; + pinctrl_serial0_hw_flowctrl: serial0-0_hw_flowctrl { + st,pins { + tx = <&pio17 0 ALT1 OUT>; + rx = <&pio17 1 ALT1 IN>; + cts = <&pio17 2 ALT1 IN>; + rts = <&pio17 3 ALT1 OUT>; }; }; };