From patchwork Fri Feb 3 10:23:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 93168 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp525629qgi; Fri, 3 Feb 2017 02:25:23 -0800 (PST) X-Received: by 10.98.150.70 with SMTP id c67mr17003404pfe.84.1486117523164; Fri, 03 Feb 2017 02:25:23 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si25110532pfk.67.2017.02.03.02.25.22; Fri, 03 Feb 2017 02:25:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753333AbdBCKZD (ORCPT + 25 others); Fri, 3 Feb 2017 05:25:03 -0500 Received: from mail-wj0-f169.google.com ([209.85.210.169]:33554 "EHLO mail-wj0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753112AbdBCKX0 (ORCPT ); Fri, 3 Feb 2017 05:23:26 -0500 Received: by mail-wj0-f169.google.com with SMTP id la6so275611wjc.0 for ; Fri, 03 Feb 2017 02:23:26 -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=+TbcK3tAl8wsPQttyRMVtqp4DdtulUNNux8iFzN1UPI=; b=CnREFiNnqHl6LIxcsRKIDy83E+7UYP+/64RJ9cmGXXgW2ohqcTFnj7EEbK1n6gloeM jTV9aAgFU3uBb3jzKFlNbda01lmpZtRZPg4x3GUKZzsPfEkFiSLQGm8Q3d82HlGqCAFE L78cof/nwEmutx2gmXHs/9S7xdMN5FiP27Pb4= 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=+TbcK3tAl8wsPQttyRMVtqp4DdtulUNNux8iFzN1UPI=; b=KyHIG+w6ng8k8uogetM+ng1uCig4QKqPE32NMjsh+OydAtO4wIv07+Hapj4Sz0KIsp 4Q5M8xb0MJWnUVHDOc/x96k4Rh/WWdT2olHyFUasN5fA+zD/2W20kBKEd16Ylzy8g0fC 3vNuDEyXp+AlD43O5RYMZNMt/DJH+z5YJS1rCU0j2xeUVMW5kzOLKZWrbnpD/O3fJh0Q hs3M5EedwFBKLzlkeSeuvO9HN1Bo30GxRlVRXlZZED4zVjZP4NLLSNwFAuAl25BYpM83 PfnT+0TG+6j+zm/QI9ZUsECsh7NrE/QUDxlVDYmvXdTrBARAAgI206uWlI7kaJTPtSqO nzHA== X-Gm-Message-State: AIkVDXKjWVnyB2rbZHQ9ySv0B5KNBto9Q5u1tw8Rn1E3r6uk2gPGI3JkF0l5ESp9iKmb+VpX X-Received: by 10.223.136.109 with SMTP id e42mr11723708wre.14.1486117405444; Fri, 03 Feb 2017 02:23:25 -0800 (PST) Received: from dell.Home ([2a02:c7d:1faf:e900:a188:db10:388f:f973]) by smtp.gmail.com with ESMTPSA id z90sm44668100wrc.24.2017.02.03.02.23.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 02:23:24 -0800 (PST) From: Lee Jones To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.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 v4 02/10] serial: st-asc: Provide RTS functionality Date: Fri, 3 Feb 2017 10:23:11 +0000 Message-Id: <20170203102319.23489-3-lee.jones@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170203102319.23489-1-lee.jones@linaro.org> References: <20170203102319.23489-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Until this point, it has not been possible for userland serial applications (e.g. stty) to toggle the UART RTS line. This can be useful with certain configurations. For example, when using a Mezzanine on a Linaro 96board, RTS line is used to take the on-board microcontroller in and out of reset. Acked-by: Peter Griffin Signed-off-by: Lee Jones --- drivers/tty/serial/st-asc.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) -- 2.9.3 diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index 69e6232..397df50 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -30,6 +30,7 @@ #include #include #include +#include #define DRIVER_NAME "st-asc" #define ASC_SERIAL_NAME "ttyAS" @@ -38,6 +39,7 @@ struct asc_port { struct uart_port port; + struct gpio_desc *rts; struct clk *clk; unsigned int hw_flow_control:1; unsigned int force_m1:1; @@ -391,12 +393,27 @@ static unsigned int asc_tx_empty(struct uart_port *port) static void asc_set_mctrl(struct uart_port *port, unsigned int mctrl) { + struct asc_port *ascport = to_asc_port(port); + /* - * This routine is used for seting signals of: DTR, DCD, CTS/RTS - * We use ASC's hardware for CTS/RTS, so don't need any for that. - * Some boards have DTR and DCD implemented using PIO pins, - * code to do this should be hooked in here. + * This routine is used for seting signals of: DTR, DCD, CTS and RTS. + * We use ASC's hardware for CTS/RTS when hardware flow-control is + * enabled, however if the RTS line is required for another purpose, + * commonly controlled using HUP from userspace, then we need to toggle + * it manually, using GPIO. + * + * Some boards also have DTR and DCD implemented using PIO pins, code to + * do this should be hooked in here. */ + + if (!ascport->rts) + return; + + /* If HW flow-control is enabled, we can't fiddle with the RTS line */ + if (asc_in(port, ASC_CTL) & ASC_CTL_CTSENABLE) + return; + + gpiod_set_value(ascport->rts, mctrl & TIOCM_RTS); } static unsigned int asc_get_mctrl(struct uart_port *port) @@ -726,6 +743,8 @@ static struct asc_port *asc_of_get_asc_port(struct platform_device *pdev) "st,hw-flow-control"); asc_ports[id].force_m1 = of_property_read_bool(np, "st,force_m1"); asc_ports[id].port.line = id; + asc_ports[id].rts = NULL; + return &asc_ports[id]; } From patchwork Fri Feb 3 10:23:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 93160 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp525093qgi; Fri, 3 Feb 2017 02:23:41 -0800 (PST) X-Received: by 10.99.170.5 with SMTP id e5mr17005683pgf.89.1486117421088; Fri, 03 Feb 2017 02:23:41 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r39si25101876pld.320.2017.02.03.02.23.40; Fri, 03 Feb 2017 02:23:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753201AbdBCKXd (ORCPT + 25 others); Fri, 3 Feb 2017 05:23:33 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:37036 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753139AbdBCKX2 (ORCPT ); Fri, 3 Feb 2017 05:23:28 -0500 Received: by mail-wm0-f54.google.com with SMTP id v77so20723095wmv.0 for ; Fri, 03 Feb 2017 02:23:27 -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=3rKJDjiazAifNCA0s9XVwo+lbmW48W1bF6rYEABjCpg=; b=EmsiL03VRAw6n1IzlNZJrADchcrFKk6rIC9BWt8VbyWDKphdMsI/1NBcA0poLjIrAM Psn/kS879rOFjwvtcw4AzljJVSP8P4N9i2XrsyPGlLeLg8B3srZkmMSLxCVhfL0xMSFW G837xOKu/YYM4tBPkUqE11Ij9homU07Hw5zWI= 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=3rKJDjiazAifNCA0s9XVwo+lbmW48W1bF6rYEABjCpg=; b=fl6U6vENCfvz257NNFMmwuCxYWSsMTe1hC73w0br3SXR9RPDnIh72QwGBWUr+0qOYd q6kihl3HjiIPMLJ68XXzDET9ukIHruMtyb41shJMWNfzvkj6J0azLDkXwWIVodfmj/hF uOiZ4e5JgWq24cbE6eIOTJvyv+Q9ip6JUEsGrlo+K3cpfewac891maSPRV7FRt/TUscj eTA2eytromLWb6lDv087Ii4t6QVkDPztiW1Iyh98v94h/QvpIswkEPBEE9r/aAEIRfqd 74QWS7FuAW3t+wxbxZPSlESIELKMNbp7MkubeM+2X1ZTYXmiPenu7jLEWrXh9MWx1pID BolA== X-Gm-Message-State: AMke39mKHLhgw4E1vCRfN65sAizXG7ZPdInPMhQd9wcfRcKyghErR8nvOCC8CEF6Ypqva3t6 X-Received: by 10.28.144.66 with SMTP id s63mr731494wmd.134.1486117406905; Fri, 03 Feb 2017 02:23:26 -0800 (PST) Received: from dell.Home ([2a02:c7d:1faf:e900:a188:db10:388f:f973]) by smtp.gmail.com with ESMTPSA id z90sm44668100wrc.24.2017.02.03.02.23.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 02:23:26 -0800 (PST) From: Lee Jones To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.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 v4 03/10] serial: st-asc: Read in all Pinctrl states Date: Fri, 3 Feb 2017 10:23:12 +0000 Message-Id: <20170203102319.23489-4-lee.jones@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170203102319.23489-1-lee.jones@linaro.org> References: <20170203102319.23489-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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`). Acked-by: Peter Griffin Signed-off-by: Lee Jones --- drivers/tty/serial/st-asc.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) -- 2.9.3 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 Fri Feb 3 10:23:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 93167 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp525626qgi; Fri, 3 Feb 2017 02:25:22 -0800 (PST) X-Received: by 10.99.55.91 with SMTP id g27mr16862667pgn.65.1486117522794; Fri, 03 Feb 2017 02:25:22 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si25110532pfk.67.2017.02.03.02.25.22; Fri, 03 Feb 2017 02:25:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753246AbdBCKZA (ORCPT + 25 others); Fri, 3 Feb 2017 05:25:00 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:34925 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753148AbdBCKX3 (ORCPT ); Fri, 3 Feb 2017 05:23:29 -0500 Received: by mail-wm0-f53.google.com with SMTP id b65so21486434wmf.0 for ; Fri, 03 Feb 2017 02:23:28 -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=Nz6EcBz3574CcrlMAxjV2FdHcsra/7R+6yMcnHO9ZTA=; b=AjYnXZSUFL8XRo9dFfKQHJt452En9DtE+VF3BoHw2DD3VAfk/XbELo4TKyIPOfB0sk b8gwtefg9/uYfBOjSqC7Rfh5H+6/mzOyUWK9guCYjKA0HmlvPWdrdFm3w80sj2V7LDNz Yu5P2NUCf4Z0re4srg3iHNKL/252lLJotvfOo= 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=Nz6EcBz3574CcrlMAxjV2FdHcsra/7R+6yMcnHO9ZTA=; b=iyXpTCUKiTLNDpW5ogFqe2rZsoR5uhjBM05ZUg28Y9hfja3kuogDCELr8ADw3jRvHU po3h5TkRzhBZGMLhbRVoBm5nFx9FWpSDeC1qjXo4NpGcylcmfhYgyjzd4W1JT81WRXAx KnYxwWA81RcY+wzbjk4mpzU4mOR9fpZxJYSR4ewGxZetqJnPpayFwZAoiqQP603tH387 YhZ5w7ymPah9jhZWNeBeDf0efd1340jIGTzX3LqMeEmC554OjcRuJUal1gcPWdjo7cBk SsD3V4umfIqOOSVQBbm6uYiRnDOqyilwZS7w++MT9kyqlc+66b0d1BLZ8UO1lpax2y27 cByw== X-Gm-Message-State: AIkVDXK13ehDv2+pr8kMDcKhnVJAjoJstBxbnHovfkRPKnOo2pGk/hvKxWOlRLWBIfqN54p9 X-Received: by 10.223.168.87 with SMTP id l81mr13816705wrc.194.1486117407973; Fri, 03 Feb 2017 02:23:27 -0800 (PST) Received: from dell.Home ([2a02:c7d:1faf:e900:a188:db10:388f:f973]) by smtp.gmail.com with ESMTPSA id z90sm44668100wrc.24.2017.02.03.02.23.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 02:23:27 -0800 (PST) From: Lee Jones To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.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 v4 04/10] serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles Date: Fri, 3 Feb 2017 10:23:13 +0000 Message-Id: <20170203102319.23489-5-lee.jones@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170203102319.23489-1-lee.jones@linaro.org> References: <20170203102319.23489-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When hardware flow-control is disabled, manual toggling of the UART's reset line (RTS) using userland applications (e.g. stty) is not possible, since the ASC IP does not provide this functionality in the same was as some other IPs do. Thus, we have to do this manually. This patch ensures that when HW flow-control is disabled the RTS/CTS lines are free to be registered via the GPIO API. It also ensures any registered GPIO lines are unregistered when HW flow-control is requested, allowing the IP to control them automatically. Acked-by: Peter Griffin Signed-off-by: Lee Jones --- drivers/tty/serial/st-asc.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) -- 2.9.3 diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index 1058020..e521078 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -513,6 +513,8 @@ static void asc_set_termios(struct uart_port *port, struct ktermios *termios, struct ktermios *old) { struct asc_port *ascport = to_asc_port(port); + struct device_node *np = port->dev->of_node; + struct gpio_desc *gpiod; unsigned int baud; u32 ctrl_val; tcflag_t cflag; @@ -556,9 +558,32 @@ static void asc_set_termios(struct uart_port *port, struct ktermios *termios, ctrl_val |= ASC_CTL_PARITYODD; /* hardware flow control */ - if ((cflag & CRTSCTS)) + if ((cflag & CRTSCTS)) { ctrl_val |= ASC_CTL_CTSENABLE; + /* If flow-control selected, stop handling RTS manually */ + if (ascport->rts) { + devm_gpiod_put(port->dev, ascport->rts); + ascport->rts = NULL; + + pinctrl_select_state(ascport->pinctrl, + ascport->states[DEFAULT]); + } + } else { + /* If flow-control disabled, it's safe to handle RTS manually */ + if (!ascport->rts && ascport->states[NO_HW_FLOWCTRL]) { + pinctrl_select_state(ascport->pinctrl, + ascport->states[NO_HW_FLOWCTRL]); + + gpiod = devm_get_gpiod_from_child(port->dev, "rts", + &np->fwnode); + if (!IS_ERR(gpiod)) { + gpiod_direction_output(gpiod, 0); + ascport->rts = gpiod; + } + } + } + if ((baud < 19200) && !ascport->force_m1) { asc_out(port, ASC_BAUDRATE, (port->uartclk / (16 * baud))); } else { From patchwork Fri Feb 3 10:23:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 93169 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp525759qgi; Fri, 3 Feb 2017 02:25:46 -0800 (PST) X-Received: by 10.99.36.7 with SMTP id k7mr16875623pgk.199.1486117546533; Fri, 03 Feb 2017 02:25:46 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h88si25113185pfk.4.2017.02.03.02.25.46; Fri, 03 Feb 2017 02:25:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753301AbdBCKY6 (ORCPT + 25 others); Fri, 3 Feb 2017 05:24:58 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:38412 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753153AbdBCKXa (ORCPT ); Fri, 3 Feb 2017 05:23:30 -0500 Received: by mail-wm0-f53.google.com with SMTP id r141so20573986wmg.1 for ; Fri, 03 Feb 2017 02:23:30 -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=dGtoBy0dmfKpjsFsEkVW6lmd++y7adbq+gpnwQxMgJM=; b=AFmuxXJsCJvO0ke0pNj7WamPKW4DG0PxrEBV334J48uRuYDCdC61o6Q0nH75aXmAqG Bac17POyjDiH9oqVfzeLgkkx3A9mFhCBheZ5/TqvcOiMScEArHwX1v0wykNbl5wvMpHl cwOBHcEb4RhEfl8V4tQ13Z/yCqROqLL4PeiaQ= 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=dGtoBy0dmfKpjsFsEkVW6lmd++y7adbq+gpnwQxMgJM=; b=Q31qpE+z0Amey2ZNrm+k461P43VE1gNQeCnzZZ+9EQH6+kAdAIT2q+tZ8pXnaG4qoa IkccBo5pfX22Wnc9WP+K4zHv9fEVJ/R2aTMP/SP1yo+WvlccCBjbrw1OUt3zcIczqmW9 EB118tZo1JU9ugrzAAYH9/lJWlAswhpO0+TO48KIfaLGuJBR8Qa/HtcYnN8qJSVtl6cX NFxd3cYv4CVgCRFqnpTxPWFhJO5wn0KXKV0rfD/ouhRpFPSGxQUv2bTezr8Xs0LL8f5T uilcqc2Rt6mFYE10Y8DWQT+ycKysKwVZjqYj/b2P1UwqBdUQTpRW8njLcLOOJOGf9WyA VMDw== X-Gm-Message-State: AIkVDXKiYgAcG4td1Zor102rYdwOOD2GPAfuFEqz5cWfgv11BBpSCm1i+3iMnruNbOYEceSP X-Received: by 10.223.153.98 with SMTP id x89mr11276809wrb.181.1486117409014; Fri, 03 Feb 2017 02:23:29 -0800 (PST) Received: from dell.Home ([2a02:c7d:1faf:e900:a188:db10:388f:f973]) by smtp.gmail.com with ESMTPSA id z90sm44668100wrc.24.2017.02.03.02.23.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 02:23:28 -0800 (PST) From: Lee Jones To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.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 v4 05/10] serial: st-asc: Use generic DT binding for announcing RTS/CTS lines Date: Fri, 3 Feb 2017 10:23:14 +0000 Message-Id: <20170203102319.23489-6-lee.jones@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170203102319.23489-1-lee.jones@linaro.org> References: <20170203102319.23489-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. Acked-by: Peter Griffin Signed-off-by: Lee Jones --- drivers/tty/serial/st-asc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.3 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 Fri Feb 3 10:23:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 93165 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp525361qgi; Fri, 3 Feb 2017 02:24:31 -0800 (PST) X-Received: by 10.84.173.4 with SMTP id o4mr20042932plb.106.1486117471473; Fri, 03 Feb 2017 02:24:31 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14si25108765pll.266.2017.02.03.02.24.31; Fri, 03 Feb 2017 02:24:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753277AbdBCKYI (ORCPT + 25 others); Fri, 3 Feb 2017 05:24:08 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:34973 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753161AbdBCKXc (ORCPT ); Fri, 3 Feb 2017 05:23:32 -0500 Received: by mail-wm0-f45.google.com with SMTP id b65so21488460wmf.0 for ; Fri, 03 Feb 2017 02:23:31 -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=jYAcy1rcoyjvjvK8FhY/5hMyo7VZCVysEPO5yDh+WNI=; b=bIy0NRGm9ZQwTy29tegD479jDs7ce4ulLFTtZSPf4/QHDQ99CGsW0D2GdYaogdrPIY fFoTTjatIxOIo6xrRlU2ypHV0YHMXF6qZgyjwjnYTZ0Ny8ZQ28n8bELe6IgNKTd0ThiR 9fCvCW0CYIOGiy9X2McsHf1XjXogrgDqmMN4o= 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=jYAcy1rcoyjvjvK8FhY/5hMyo7VZCVysEPO5yDh+WNI=; b=e31eLpbaWW7UskJfsEfiWGePfuWJ6A6KnOGhNVdImBBR+o8tLq8V+9UpLZt5Typg8v ihY4+I/uRcfnqiCNa05GyYM7kuWOOnuH2u1ve81zEkoWcOlB6h+eyZ0LPYpvl6RyuUdn cijl3/RVd94toR8ahrHBhFMhHnVTVdthd/VzAVbyDxXh4dUKTgmJNDutvhX+h4E03AWX FJ7y97OMYDIFOV5qeVdni1p9elkfWU/+tG8fCfgy40+kyVsPDjR47RWygpkGEU7/Ff7e MZvIiXdtDlnJjtk90SKAApizK77DpVDhhCFmW3zp8HPPHjgP6dJVXZQq8Fi2N7qfprVi JxtA== X-Gm-Message-State: AIkVDXInIHMCgBhFP6Q1fBUKTQNRNbHiw4/ZBaxg8ui02tIvcNUmUSA/mpU/Ei7VPTTxdAtd X-Received: by 10.223.178.243 with SMTP id g106mr13737196wrd.32.1486117411097; Fri, 03 Feb 2017 02:23:31 -0800 (PST) Received: from dell.Home ([2a02:c7d:1faf:e900:a188:db10:388f:f973]) by smtp.gmail.com with ESMTPSA id z90sm44668100wrc.24.2017.02.03.02.23.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 02:23:30 -0800 (PST) From: Lee Jones To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.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 v4 07/10] ARM: dts: STiH410-b2260: Identify the UART RTS line Date: Fri, 3 Feb 2017 10:23:16 +0000 Message-Id: <20170203102319.23489-8-lee.jones@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170203102319.23489-1-lee.jones@linaro.org> References: <20170203102319.23489-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When hardware flow-control is disabled, manual toggling of the UART's reset line (RTS) using userland applications (e.g. stty) is not possible, since the ASC IP does not provide this functionality in the same was as some other IPs do. Thus, we have to do this manually. This patch configures the UART RTS line as a GPIO for manipulation within the UART driver when HW flow-control is not enabled. Acked-by: Peter Griffin Signed-off-by: Lee Jones --- arch/arm/boot/dts/stih410-b2260.dts | 1 + 1 file changed, 1 insertion(+) -- 2.9.3 diff --git a/arch/arm/boot/dts/stih410-b2260.dts b/arch/arm/boot/dts/stih410-b2260.dts index 06b0696..fa16aba 100644 --- a/arch/arm/boot/dts/stih410-b2260.dts +++ b/arch/arm/boot/dts/stih410-b2260.dts @@ -63,6 +63,7 @@ uart0: serial@9830000 { label = "LS-UART0"; status = "okay"; + rts-gpios = <&pio17 3 GPIO_ACTIVE_LOW>; }; /* Low speed expansion connector */ From patchwork Fri Feb 3 10:23:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 93162 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp525100qgi; Fri, 3 Feb 2017 02:23:42 -0800 (PST) X-Received: by 10.99.67.1 with SMTP id q1mr16996640pga.210.1486117421971; Fri, 03 Feb 2017 02:23:41 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r39si25101876pld.320.2017.02.03.02.23.41; Fri, 03 Feb 2017 02:23:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753233AbdBCKXi (ORCPT + 25 others); Fri, 3 Feb 2017 05:23:38 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:36044 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753139AbdBCKXe (ORCPT ); Fri, 3 Feb 2017 05:23:34 -0500 Received: by mail-wm0-f44.google.com with SMTP id c85so21392102wmi.1 for ; Fri, 03 Feb 2017 02:23:33 -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=AgDZnHgipRtrCq8WojQoWmZIJsoxOLq5sVAn0TOcMBA=; b=VCewW6xV3bfAClmVoFJvsedCgL6/vEcOqzifWwD+n909wUvNjCKWiaW/5+X+eWGFL2 FqlcuWg5lGNZXgOEg/2vZIRyod2p2tMTxwnjSst+yYsnzaZ2NMoWl2qVlecF+L9jf7p0 zoeDSTfeqAnhdYktrwA4X/ZEq8EGkddmAT9GU= 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=AgDZnHgipRtrCq8WojQoWmZIJsoxOLq5sVAn0TOcMBA=; b=AGppc/GgEumUnlrYn84QhcOmyprtLNcKh69p/DJTtpTjG0ZaESO8l5YSFT21LYsftH h68pnc/AQXOVM2SQ5Rl2Kk73cA+au/hEX8IxPGlq90efIkPvvdznZPMIaBRBE0HBDW1I +VKTH81DT2yCG5yCIN2cwYMQLkvpPpAjMdRe5ztVqCsMAH0llPHemZ+sMgE+8vFRNrKW oR8Y3xVEMOz9Dd4ZCO716SYN/jqXiOsK3EEBxqwJkwlEUxPmp2nEzFzUY2B3btsfMD6p BhAqAvf0/D3arsWKJjUIZCyLWLt2pfvoFX0Toa14GLlnxoFH+4E+cLzW98Skx66G1q4G rfCg== X-Gm-Message-State: AIkVDXLpKcF5om1IboZcSSgOaiRROR0WWwXNuElYmKfGXJsrHiyTSGAKGLUcOHqC7EOpfkSb X-Received: by 10.223.135.244 with SMTP id c49mr11196418wrc.135.1486117413104; Fri, 03 Feb 2017 02:23:33 -0800 (PST) Received: from dell.Home ([2a02:c7d:1faf:e900:a188:db10:388f:f973]) by smtp.gmail.com with ESMTPSA id z90sm44668100wrc.24.2017.02.03.02.23.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 02:23:32 -0800 (PST) From: Lee Jones To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.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 v4 09/10] ARM: dts: STiH407-family: Use new Pinctrl groups Date: Fri, 3 Feb 2017 10:23:18 +0000 Message-Id: <20170203102319.23489-10-lee.jones@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170203102319.23489-1-lee.jones@linaro.org> References: <20170203102319.23489-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Having just defined some new Pinctrl groups for when HW flow-control is {en,dis}abled, let's reference them for use within the driver. Acked-by: Peter Griffin Signed-off-by: Lee Jones --- arch/arm/boot/dts/stih407-family.dtsi | 3 +-- arch/arm/boot/dts/stih410-b2260.dts | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) -- 2.9.3 diff --git a/arch/arm/boot/dts/stih407-family.dtsi b/arch/arm/boot/dts/stih407-family.dtsi index c8b2944..e480e32 100644 --- a/arch/arm/boot/dts/stih407-family.dtsi +++ b/arch/arm/boot/dts/stih407-family.dtsi @@ -222,9 +222,8 @@ compatible = "st,asc"; reg = <0x9830000 0x2c>; interrupts = ; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_serial0>; clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>; + /* Pinctrl moved out to a per-board configuration */ status = "disabled"; }; diff --git a/arch/arm/boot/dts/stih410-b2260.dts b/arch/arm/boot/dts/stih410-b2260.dts index fa16aba..cbcbcb4 100644 --- a/arch/arm/boot/dts/stih410-b2260.dts +++ b/arch/arm/boot/dts/stih410-b2260.dts @@ -62,8 +62,11 @@ /* Low speed expansion connector */ uart0: serial@9830000 { label = "LS-UART0"; - status = "okay"; + pinctrl-names = "default", "no-hw-flowctrl"; + pinctrl-0 = <&pinctrl_serial0_hw_flowctrl>; + pinctrl-1 = <&pinctrl_serial0>; rts-gpios = <&pio17 3 GPIO_ACTIVE_LOW>; + status = "okay"; }; /* Low speed expansion connector */