All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/10] serial: st-asc: Allow handling of RTS line
@ 2017-01-27 17:27 ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-arm-kernel, linux-kernel, kernel, patrice.chotard, Lee Jones

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 set ensures the correct Pinctrl groups are configured and
obtained for both manual toggling of the RTS line and for the IP to
take over the lines when HW flow-control is requested by the user. 

Lee Jones (10):
  serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled
  serial: st-asc: Provide RTS functionality
  serial: st-asc: Read in all Pinctrl states
  serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles
  serial: st-asc: Use generic DT binding for announcing RTS/CTS lines
  dt-bindings: serial: Update 'uart-has-rtscts' description
  ARM: dts: STiH410-b2260: Identify the UART RTS line
  ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control
  ARM: dts: STiH407-family: Use new Pinctrl groups
  ARM: dts: STiH410-b2260: Enable HW flow-control

 .../devicetree/bindings/serial/serial.txt          |   3 +-
 arch/arm/boot/dts/stih407-family.dtsi              |   3 +-
 arch/arm/boot/dts/stih407-pinctrl.dtsi             |  12 ++-
 arch/arm/boot/dts/stih410-b2260.dts                |   5 +
 drivers/tty/serial/st-asc.c                        | 101 +++++++++++++++++++--
 5 files changed, 110 insertions(+), 14 deletions(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH v2 00/10] serial: st-asc: Allow handling of RTS line
@ 2017-01-27 17:27 ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: linux-arm-kernel

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 set ensures the correct Pinctrl groups are configured and
obtained for both manual toggling of the RTS line and for the IP to
take over the lines when HW flow-control is requested by the user. 

Lee Jones (10):
  serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled
  serial: st-asc: Provide RTS functionality
  serial: st-asc: Read in all Pinctrl states
  serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles
  serial: st-asc: Use generic DT binding for announcing RTS/CTS lines
  dt-bindings: serial: Update 'uart-has-rtscts' description
  ARM: dts: STiH410-b2260: Identify the UART RTS line
  ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control
  ARM: dts: STiH407-family: Use new Pinctrl groups
  ARM: dts: STiH410-b2260: Enable HW flow-control

 .../devicetree/bindings/serial/serial.txt          |   3 +-
 arch/arm/boot/dts/stih407-family.dtsi              |   3 +-
 arch/arm/boot/dts/stih407-pinctrl.dtsi             |  12 ++-
 arch/arm/boot/dts/stih410-b2260.dts                |   5 +
 drivers/tty/serial/st-asc.c                        | 101 +++++++++++++++++++--
 5 files changed, 110 insertions(+), 14 deletions(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH v2 01/10] serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled
  2017-01-27 17:27 ` Lee Jones
  (?)
@ 2017-01-27 17:27   ` Lee Jones
  -1 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-arm-kernel, linux-kernel, kernel, patrice.chotard, Lee Jones

The datasheet states:

"If the MODE field selects an 8-bit frame then this [parity error] bit
 is undefined. Software should ignore this bit when reading 8-bit frames."

Acked-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/tty/serial/st-asc.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 379e5bd..69e6232 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -287,9 +287,19 @@ static void asc_transmit_chars(struct uart_port *port)
 static void asc_receive_chars(struct uart_port *port)
 {
 	struct tty_port *tport = &port->state->port;
-	unsigned long status;
+	unsigned long status, mode;
 	unsigned long c = 0;
 	char flag;
+	bool ignore_pe = false;
+
+	/*
+	 * Datasheet states: If the MODE field selects an 8-bit frame then
+	 * this [parity error] bit is undefined. Software should ignore this
+	 * bit when reading 8-bit frames.
+	 */
+	mode = asc_in(port, ASC_CTL) & ASC_CTL_MODE_MSK;
+	if (mode == ASC_CTL_MODE_8BIT || mode == ASC_CTL_MODE_8BIT_PAR)
+		ignore_pe = true;
 
 	if (port->irq_wake)
 		pm_wakeup_event(tport->tty->dev, 0);
@@ -299,8 +309,8 @@ static void asc_receive_chars(struct uart_port *port)
 		flag = TTY_NORMAL;
 		port->icount.rx++;
 
-		if ((c & (ASC_RXBUF_FE | ASC_RXBUF_PE)) ||
-			status & ASC_STA_OE) {
+		if (status & ASC_STA_OE || c & ASC_RXBUF_FE ||
+		    (c & ASC_RXBUF_PE && !ignore_pe)) {
 
 			if (c & ASC_RXBUF_FE) {
 				if (c == (ASC_RXBUF_FE | ASC_RXBUF_DUMMY_RX)) {
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 01/10] serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled
@ 2017-01-27 17:27   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, dt, devicetree
  Cc: patrice.chotard, Lee Jones, linux-kernel, linux-arm-kernel, kernel

The datasheet states:

"If the MODE field selects an 8-bit frame then this [parity error] bit
 is undefined. Software should ignore this bit when reading 8-bit frames."

Acked-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/tty/serial/st-asc.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 379e5bd..69e6232 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -287,9 +287,19 @@ static void asc_transmit_chars(struct uart_port *port)
 static void asc_receive_chars(struct uart_port *port)
 {
 	struct tty_port *tport = &port->state->port;
-	unsigned long status;
+	unsigned long status, mode;
 	unsigned long c = 0;
 	char flag;
+	bool ignore_pe = false;
+
+	/*
+	 * Datasheet states: If the MODE field selects an 8-bit frame then
+	 * this [parity error] bit is undefined. Software should ignore this
+	 * bit when reading 8-bit frames.
+	 */
+	mode = asc_in(port, ASC_CTL) & ASC_CTL_MODE_MSK;
+	if (mode == ASC_CTL_MODE_8BIT || mode == ASC_CTL_MODE_8BIT_PAR)
+		ignore_pe = true;
 
 	if (port->irq_wake)
 		pm_wakeup_event(tport->tty->dev, 0);
@@ -299,8 +309,8 @@ static void asc_receive_chars(struct uart_port *port)
 		flag = TTY_NORMAL;
 		port->icount.rx++;
 
-		if ((c & (ASC_RXBUF_FE | ASC_RXBUF_PE)) ||
-			status & ASC_STA_OE) {
+		if (status & ASC_STA_OE || c & ASC_RXBUF_FE ||
+		    (c & ASC_RXBUF_PE && !ignore_pe)) {
 
 			if (c & ASC_RXBUF_FE) {
 				if (c == (ASC_RXBUF_FE | ASC_RXBUF_DUMMY_RX)) {
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 01/10] serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled
@ 2017-01-27 17:27   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: linux-arm-kernel

The datasheet states:

"If the MODE field selects an 8-bit frame then this [parity error] bit
 is undefined. Software should ignore this bit when reading 8-bit frames."

Acked-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/tty/serial/st-asc.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 379e5bd..69e6232 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -287,9 +287,19 @@ static void asc_transmit_chars(struct uart_port *port)
 static void asc_receive_chars(struct uart_port *port)
 {
 	struct tty_port *tport = &port->state->port;
-	unsigned long status;
+	unsigned long status, mode;
 	unsigned long c = 0;
 	char flag;
+	bool ignore_pe = false;
+
+	/*
+	 * Datasheet states: If the MODE field selects an 8-bit frame then
+	 * this [parity error] bit is undefined. Software should ignore this
+	 * bit when reading 8-bit frames.
+	 */
+	mode = asc_in(port, ASC_CTL) & ASC_CTL_MODE_MSK;
+	if (mode == ASC_CTL_MODE_8BIT || mode == ASC_CTL_MODE_8BIT_PAR)
+		ignore_pe = true;
 
 	if (port->irq_wake)
 		pm_wakeup_event(tport->tty->dev, 0);
@@ -299,8 +309,8 @@ static void asc_receive_chars(struct uart_port *port)
 		flag = TTY_NORMAL;
 		port->icount.rx++;
 
-		if ((c & (ASC_RXBUF_FE | ASC_RXBUF_PE)) ||
-			status & ASC_STA_OE) {
+		if (status & ASC_STA_OE || c & ASC_RXBUF_FE ||
+		    (c & ASC_RXBUF_PE && !ignore_pe)) {
 
 			if (c & ASC_RXBUF_FE) {
 				if (c == (ASC_RXBUF_FE | ASC_RXBUF_DUMMY_RX)) {
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 02/10] serial: st-asc: Provide RTS functionality
  2017-01-27 17:27 ` Lee Jones
@ 2017-01-27 17:27   ` Lee Jones
  -1 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-arm-kernel, linux-kernel, kernel, patrice.chotard, Lee Jones

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 <peter.griffin@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/tty/serial/st-asc.c | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

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 <linux/of_platform.h>
 #include <linux/serial_core.h>
 #include <linux/clk.h>
+#include <linux/gpio/consumer.h>
 
 #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];
 }
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 02/10] serial: st-asc: Provide RTS functionality
@ 2017-01-27 17:27   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: linux-arm-kernel

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 <peter.griffin@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/tty/serial/st-asc.c | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

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 <linux/of_platform.h>
 #include <linux/serial_core.h>
 #include <linux/clk.h>
+#include <linux/gpio/consumer.h>
 
 #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];
 }
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 03/10] serial: st-asc: Read in all Pinctrl states
@ 2017-01-27 17:27   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-arm-kernel, linux-kernel, kernel, patrice.chotard, Lee Jones

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 <lee.jones@linaro.org>
---
 drivers/tty/serial/st-asc.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 397df50..82f5714 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -18,6 +18,7 @@
 #include <linux/serial.h>
 #include <linux/console.h>
 #include <linux/sysrq.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/irq.h>
@@ -37,10 +38,16 @@
 #define ASC_FIFO_SIZE 16
 #define ASC_MAX_PORTS 8
 
+/* Pinctrl states */
+#define DEFAULT		0
+#define MANUAL_RTS	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;
+	}
+
+	/* "manual-rts" state is optional */
+	ascport->states[MANUAL_RTS] =
+		pinctrl_lookup_state(ascport->pinctrl, "manual-rts");
+	if (IS_ERR(ascport->states[MANUAL_RTS]))
+		ascport->states[MANUAL_RTS] = NULL;
+
 	return 0;
 }
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 03/10] serial: st-asc: Read in all Pinctrl states
@ 2017-01-27 17:27   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, jslaby-IBi9RG/b67k,
	linux-serial-u79uwXL29TY76Z2rM5mHXA, dt-DgEjT+Ai2ygdnm+yROfE0A,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-F5mvAk5X5gdBDgjK7y7TUQ, patrice.chotard-qxv4g6HH51o,
	Lee Jones

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 <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 drivers/tty/serial/st-asc.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 397df50..82f5714 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -18,6 +18,7 @@
 #include <linux/serial.h>
 #include <linux/console.h>
 #include <linux/sysrq.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/irq.h>
@@ -37,10 +38,16 @@
 #define ASC_FIFO_SIZE 16
 #define ASC_MAX_PORTS 8
 
+/* Pinctrl states */
+#define DEFAULT		0
+#define MANUAL_RTS	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;
+	}
+
+	/* "manual-rts" state is optional */
+	ascport->states[MANUAL_RTS] =
+		pinctrl_lookup_state(ascport->pinctrl, "manual-rts");
+	if (IS_ERR(ascport->states[MANUAL_RTS]))
+		ascport->states[MANUAL_RTS] = NULL;
+
 	return 0;
 }
 
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 03/10] serial: st-asc: Read in all Pinctrl states
@ 2017-01-27 17:27   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: linux-arm-kernel

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 <lee.jones@linaro.org>
---
 drivers/tty/serial/st-asc.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 397df50..82f5714 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -18,6 +18,7 @@
 #include <linux/serial.h>
 #include <linux/console.h>
 #include <linux/sysrq.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/irq.h>
@@ -37,10 +38,16 @@
 #define ASC_FIFO_SIZE 16
 #define ASC_MAX_PORTS 8
 
+/* Pinctrl states */
+#define DEFAULT		0
+#define MANUAL_RTS	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;
+	}
+
+	/* "manual-rts" state is optional */
+	ascport->states[MANUAL_RTS] =
+		pinctrl_lookup_state(ascport->pinctrl, "manual-rts");
+	if (IS_ERR(ascport->states[MANUAL_RTS]))
+		ascport->states[MANUAL_RTS] = NULL;
+
 	return 0;
 }
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 04/10] serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles
  2017-01-27 17:27 ` Lee Jones
@ 2017-01-27 17:27   ` Lee Jones
  -1 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-arm-kernel, linux-kernel, kernel, patrice.chotard, Lee Jones

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 <peter.griffin@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/tty/serial/st-asc.c | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 82f5714..713d7bb 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[MANUAL_RTS]) {
+			pinctrl_select_state(ascport->pinctrl,
+					     ascport->states[MANUAL_RTS]);
+
+			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 {
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 04/10] serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles
@ 2017-01-27 17:27   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: linux-arm-kernel

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 <peter.griffin@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/tty/serial/st-asc.c | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 82f5714..713d7bb 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[MANUAL_RTS]) {
+			pinctrl_select_state(ascport->pinctrl,
+					     ascport->states[MANUAL_RTS]);
+
+			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 {
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 05/10] serial: st-asc: Use generic DT binding for announcing RTS/CTS lines
@ 2017-01-27 17:27   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-arm-kernel, linux-kernel, kernel, patrice.chotard, Lee Jones

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 <lee.jones@linaro.org>
---
 drivers/tty/serial/st-asc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 713d7bb..85d8783 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;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 05/10] serial: st-asc: Use generic DT binding for announcing RTS/CTS lines
@ 2017-01-27 17:27   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, jslaby-IBi9RG/b67k,
	linux-serial-u79uwXL29TY76Z2rM5mHXA, dt-DgEjT+Ai2ygdnm+yROfE0A,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-F5mvAk5X5gdBDgjK7y7TUQ, patrice.chotard-qxv4g6HH51o,
	Lee Jones

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 <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 drivers/tty/serial/st-asc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 713d7bb..85d8783 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;
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 05/10] serial: st-asc: Use generic DT binding for announcing RTS/CTS lines
@ 2017-01-27 17:27   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:27 UTC (permalink / raw)
  To: linux-arm-kernel

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 <lee.jones@linaro.org>
---
 drivers/tty/serial/st-asc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 713d7bb..85d8783 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;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 06/10] dt-bindings: serial: Update 'uart-has-rtscts' description
@ 2017-01-27 17:28   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:28 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-arm-kernel, linux-kernel, kernel, patrice.chotard, Lee Jones

'uart-has-rtscts' property and 'rts-gpios|cts-gpios' are normally
mutually exclusive, however it is possible for some drivers to have
a dynamic approach, meaning that both properties can be relevant.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 Documentation/devicetree/bindings/serial/serial.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/serial/serial.txt b/Documentation/devicetree/bindings/serial/serial.txt
index fd970f7..b542a0e 100644
--- a/Documentation/devicetree/bindings/serial/serial.txt
+++ b/Documentation/devicetree/bindings/serial/serial.txt
@@ -23,7 +23,8 @@ Optional properties:
     they are available for use (wired and enabled by pinmux configuration).
     This depends on both the UART hardware and the board wiring.
     Note that this property is mutually-exclusive with "cts-gpios" and
-    "rts-gpios" above.
+    "rts-gpios" above, unless support is provided to switch between modes
+    dynamically.
 
 
 Examples:
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 06/10] dt-bindings: serial: Update 'uart-has-rtscts' description
@ 2017-01-27 17:28   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:28 UTC (permalink / raw)
  To: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, jslaby-IBi9RG/b67k,
	linux-serial-u79uwXL29TY76Z2rM5mHXA, dt-DgEjT+Ai2ygdnm+yROfE0A,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-F5mvAk5X5gdBDgjK7y7TUQ, patrice.chotard-qxv4g6HH51o,
	Lee Jones

'uart-has-rtscts' property and 'rts-gpios|cts-gpios' are normally
mutually exclusive, however it is possible for some drivers to have
a dynamic approach, meaning that both properties can be relevant.

Signed-off-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 Documentation/devicetree/bindings/serial/serial.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/serial/serial.txt b/Documentation/devicetree/bindings/serial/serial.txt
index fd970f7..b542a0e 100644
--- a/Documentation/devicetree/bindings/serial/serial.txt
+++ b/Documentation/devicetree/bindings/serial/serial.txt
@@ -23,7 +23,8 @@ Optional properties:
     they are available for use (wired and enabled by pinmux configuration).
     This depends on both the UART hardware and the board wiring.
     Note that this property is mutually-exclusive with "cts-gpios" and
-    "rts-gpios" above.
+    "rts-gpios" above, unless support is provided to switch between modes
+    dynamically.
 
 
 Examples:
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 06/10] dt-bindings: serial: Update 'uart-has-rtscts' description
@ 2017-01-27 17:28   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:28 UTC (permalink / raw)
  To: linux-arm-kernel

'uart-has-rtscts' property and 'rts-gpios|cts-gpios' are normally
mutually exclusive, however it is possible for some drivers to have
a dynamic approach, meaning that both properties can be relevant.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 Documentation/devicetree/bindings/serial/serial.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/serial/serial.txt b/Documentation/devicetree/bindings/serial/serial.txt
index fd970f7..b542a0e 100644
--- a/Documentation/devicetree/bindings/serial/serial.txt
+++ b/Documentation/devicetree/bindings/serial/serial.txt
@@ -23,7 +23,8 @@ Optional properties:
     they are available for use (wired and enabled by pinmux configuration).
     This depends on both the UART hardware and the board wiring.
     Note that this property is mutually-exclusive with "cts-gpios" and
-    "rts-gpios" above.
+    "rts-gpios" above, unless support is provided to switch between modes
+    dynamically.
 
 
 Examples:
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 07/10] ARM: dts: STiH410-b2260: Identify the UART RTS line
@ 2017-01-27 17:28   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:28 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-arm-kernel, linux-kernel, kernel, patrice.chotard, Lee Jones

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.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/stih410-b2260.dts | 1 +
 1 file changed, 1 insertion(+)

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 */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 07/10] ARM: dts: STiH410-b2260: Identify the UART RTS line
@ 2017-01-27 17:28   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:28 UTC (permalink / raw)
  To: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, jslaby-IBi9RG/b67k,
	linux-serial-u79uwXL29TY76Z2rM5mHXA, dt-DgEjT+Ai2ygdnm+yROfE0A,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-F5mvAk5X5gdBDgjK7y7TUQ, patrice.chotard-qxv4g6HH51o,
	Lee Jones

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.

Signed-off-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 arch/arm/boot/dts/stih410-b2260.dts | 1 +
 1 file changed, 1 insertion(+)

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 */
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 07/10] ARM: dts: STiH410-b2260: Identify the UART RTS line
@ 2017-01-27 17:28   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:28 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/stih410-b2260.dts | 1 +
 1 file changed, 1 insertion(+)

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 at 9830000 {
 			label = "LS-UART0";
 			status = "okay";
+			rts-gpios = <&pio17 3 GPIO_ACTIVE_LOW>;
 		};
 
 		/* Low speed expansion connector */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 08/10] ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control
@ 2017-01-27 17:28   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:28 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-arm-kernel, linux-kernel, kernel, patrice.chotard, Lee Jones

Each serial port which supports HW flow-control should have 2 Pinctrl
groups.  Once 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.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/stih407-pinctrl.dtsi | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/stih407-pinctrl.dtsi b/arch/arm/boot/dts/stih407-pinctrl.dtsi
index daab16b..fbb7f86 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_flowctrl: serial0-0_flowctrl {
+					st,pins {
+						tx =  <&pio17 0 ALT1 OUT>;
+						rx =  <&pio17 1 ALT1 IN>;
+						cts = <&pio17 2 ALT1 IN>;
+						rts = <&pio17 3 ALT1 OUT>;
 					};
 				};
 			};
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 08/10] ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control
@ 2017-01-27 17:28   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:28 UTC (permalink / raw)
  To: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, jslaby-IBi9RG/b67k,
	linux-serial-u79uwXL29TY76Z2rM5mHXA, dt-DgEjT+Ai2ygdnm+yROfE0A,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-F5mvAk5X5gdBDgjK7y7TUQ, patrice.chotard-qxv4g6HH51o,
	Lee Jones

Each serial port which supports HW flow-control should have 2 Pinctrl
groups.  Once 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.

Signed-off-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 arch/arm/boot/dts/stih407-pinctrl.dtsi | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/stih407-pinctrl.dtsi b/arch/arm/boot/dts/stih407-pinctrl.dtsi
index daab16b..fbb7f86 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_flowctrl: serial0-0_flowctrl {
+					st,pins {
+						tx =  <&pio17 0 ALT1 OUT>;
+						rx =  <&pio17 1 ALT1 IN>;
+						cts = <&pio17 2 ALT1 IN>;
+						rts = <&pio17 3 ALT1 OUT>;
 					};
 				};
 			};
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 08/10] ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control
@ 2017-01-27 17:28   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:28 UTC (permalink / raw)
  To: linux-arm-kernel

Each serial port which supports HW flow-control should have 2 Pinctrl
groups.  Once 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.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/stih407-pinctrl.dtsi | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/stih407-pinctrl.dtsi b/arch/arm/boot/dts/stih407-pinctrl.dtsi
index daab16b..fbb7f86 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_flowctrl: serial0-0_flowctrl {
+					st,pins {
+						tx =  <&pio17 0 ALT1 OUT>;
+						rx =  <&pio17 1 ALT1 IN>;
+						cts = <&pio17 2 ALT1 IN>;
+						rts = <&pio17 3 ALT1 OUT>;
 					};
 				};
 			};
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 09/10] ARM: dts: STiH407-family: Use new Pinctrl groups
  2017-01-27 17:27 ` Lee Jones
@ 2017-01-27 17:28   ` Lee Jones
  -1 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:28 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-arm-kernel, linux-kernel, kernel, patrice.chotard, Lee Jones

Having just defined some new Pinctrl groups for when when HW flow-
control is {en,dis}abled, let's reference them for use within the
driver.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/stih407-family.dtsi | 3 +--
 arch/arm/boot/dts/stih410-b2260.dts   | 5 ++++-
 2 files changed, 5 insertions(+), 3 deletions(-)

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 = <GIC_SPI 122 IRQ_TYPE_NONE>;
-			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..8deecf6 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", "manual-rts";
+			pinctrl-0 = <&pinctrl_serial0_flowctrl>;
+			pinctrl-1 = <&pinctrl_serial0>;
 			rts-gpios = <&pio17 3 GPIO_ACTIVE_LOW>;
+			status = "okay";
 		};
 
 		/* Low speed expansion connector */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 09/10] ARM: dts: STiH407-family: Use new Pinctrl groups
@ 2017-01-27 17:28   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:28 UTC (permalink / raw)
  To: linux-arm-kernel

Having just defined some new Pinctrl groups for when when HW flow-
control is {en,dis}abled, let's reference them for use within the
driver.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/stih407-family.dtsi | 3 +--
 arch/arm/boot/dts/stih410-b2260.dts   | 5 ++++-
 2 files changed, 5 insertions(+), 3 deletions(-)

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 = <GIC_SPI 122 IRQ_TYPE_NONE>;
-			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..8deecf6 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 at 9830000 {
 			label = "LS-UART0";
-			status = "okay";
+			pinctrl-names = "default", "manual-rts";
+			pinctrl-0 = <&pinctrl_serial0_flowctrl>;
+			pinctrl-1 = <&pinctrl_serial0>;
 			rts-gpios = <&pio17 3 GPIO_ACTIVE_LOW>;
+			status = "okay";
 		};
 
 		/* Low speed expansion connector */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 10/10] ARM: dts: STiH410-b2260: Enable HW flow-control
  2017-01-27 17:27 ` Lee Jones
@ 2017-01-27 17:28   ` Lee Jones
  -1 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:28 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-arm-kernel, linux-kernel, kernel, patrice.chotard, Lee Jones

Hardware flow-control capability must be specified at a platform
level in order to inform the ASC driver that the platform is capable
(i.e. are the lines wired up, etc).  STiH4{07,10} devices are indeed
capable, so let's provide the property.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/stih410-b2260.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/stih410-b2260.dts b/arch/arm/boot/dts/stih410-b2260.dts
index 8deecf6..54a95ae 100644
--- a/arch/arm/boot/dts/stih410-b2260.dts
+++ b/arch/arm/boot/dts/stih410-b2260.dts
@@ -66,6 +66,7 @@
 			pinctrl-0 = <&pinctrl_serial0_flowctrl>;
 			pinctrl-1 = <&pinctrl_serial0>;
 			rts-gpios = <&pio17 3 GPIO_ACTIVE_LOW>;
+			uart-has-rtscts;
 			status = "okay";
 		};
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 10/10] ARM: dts: STiH410-b2260: Enable HW flow-control
@ 2017-01-27 17:28   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-01-27 17:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hardware flow-control capability must be specified at a platform
level in order to inform the ASC driver that the platform is capable
(i.e. are the lines wired up, etc).  STiH4{07,10} devices are indeed
capable, so let's provide the property.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/stih410-b2260.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/stih410-b2260.dts b/arch/arm/boot/dts/stih410-b2260.dts
index 8deecf6..54a95ae 100644
--- a/arch/arm/boot/dts/stih410-b2260.dts
+++ b/arch/arm/boot/dts/stih410-b2260.dts
@@ -66,6 +66,7 @@
 			pinctrl-0 = <&pinctrl_serial0_flowctrl>;
 			pinctrl-1 = <&pinctrl_serial0>;
 			rts-gpios = <&pio17 3 GPIO_ACTIVE_LOW>;
+			uart-has-rtscts;
 			status = "okay";
 		};
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* Re: [PATCH v2 09/10] ARM: dts: STiH407-family: Use new Pinctrl groups
  2017-01-27 17:28   ` Lee Jones
  (?)
@ 2017-01-30 10:10     ` Patrice CHOTARD
  -1 siblings, 0 replies; 44+ messages in thread
From: Patrice CHOTARD @ 2017-01-30 10:10 UTC (permalink / raw)
  To: Lee Jones, gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-arm-kernel, linux-kernel, kernel

Hi Lee

On 01/27/2017 06:28 PM, Lee Jones wrote:
> Having just defined some new Pinctrl groups for when when HW flow-

double "when"

> control is {en,dis}abled, let's reference them for use within the
> driver.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  arch/arm/boot/dts/stih407-family.dtsi | 3 +--
>  arch/arm/boot/dts/stih410-b2260.dts   | 5 ++++-
>  2 files changed, 5 insertions(+), 3 deletions(-)
>
> 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 = <GIC_SPI 122 IRQ_TYPE_NONE>;
> -			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..8deecf6 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", "manual-rts";
> +			pinctrl-0 = <&pinctrl_serial0_flowctrl>;
> +			pinctrl-1 = <&pinctrl_serial0>;
>  			rts-gpios = <&pio17 3 GPIO_ACTIVE_LOW>;
> +			status = "okay";
>  		};
>
>  		/* Low speed expansion connector */
>

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH v2 09/10] ARM: dts: STiH407-family: Use new Pinctrl groups
@ 2017-01-30 10:10     ` Patrice CHOTARD
  0 siblings, 0 replies; 44+ messages in thread
From: Patrice CHOTARD @ 2017-01-30 10:10 UTC (permalink / raw)
  To: Lee Jones, gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-kernel, linux-arm-kernel, kernel

Hi Lee

On 01/27/2017 06:28 PM, Lee Jones wrote:
> Having just defined some new Pinctrl groups for when when HW flow-

double "when"

> control is {en,dis}abled, let's reference them for use within the
> driver.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  arch/arm/boot/dts/stih407-family.dtsi | 3 +--
>  arch/arm/boot/dts/stih410-b2260.dts   | 5 ++++-
>  2 files changed, 5 insertions(+), 3 deletions(-)
>
> 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 = <GIC_SPI 122 IRQ_TYPE_NONE>;
> -			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..8deecf6 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", "manual-rts";
> +			pinctrl-0 = <&pinctrl_serial0_flowctrl>;
> +			pinctrl-1 = <&pinctrl_serial0>;
>  			rts-gpios = <&pio17 3 GPIO_ACTIVE_LOW>;
> +			status = "okay";
>  		};
>
>  		/* Low speed expansion connector */
>

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH v2 09/10] ARM: dts: STiH407-family: Use new Pinctrl groups
@ 2017-01-30 10:10     ` Patrice CHOTARD
  0 siblings, 0 replies; 44+ messages in thread
From: Patrice CHOTARD @ 2017-01-30 10:10 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lee

On 01/27/2017 06:28 PM, Lee Jones wrote:
> Having just defined some new Pinctrl groups for when when HW flow-

double "when"

> control is {en,dis}abled, let's reference them for use within the
> driver.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  arch/arm/boot/dts/stih407-family.dtsi | 3 +--
>  arch/arm/boot/dts/stih410-b2260.dts   | 5 ++++-
>  2 files changed, 5 insertions(+), 3 deletions(-)
>
> 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 = <GIC_SPI 122 IRQ_TYPE_NONE>;
> -			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..8deecf6 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 at 9830000 {
>  			label = "LS-UART0";
> -			status = "okay";
> +			pinctrl-names = "default", "manual-rts";
> +			pinctrl-0 = <&pinctrl_serial0_flowctrl>;
> +			pinctrl-1 = <&pinctrl_serial0>;
>  			rts-gpios = <&pio17 3 GPIO_ACTIVE_LOW>;
> +			status = "okay";
>  		};
>
>  		/* Low speed expansion connector */
>

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH v2 06/10] dt-bindings: serial: Update 'uart-has-rtscts' description
  2017-01-27 17:28   ` Lee Jones
@ 2017-02-01 15:41     ` Rob Herring
  -1 siblings, 0 replies; 44+ messages in thread
From: Rob Herring @ 2017-02-01 15:41 UTC (permalink / raw)
  To: Lee Jones
  Cc: gregkh, jslaby, linux-serial, dt, devicetree, linux-arm-kernel,
	linux-kernel, kernel, patrice.chotard

On Fri, Jan 27, 2017 at 05:28:00PM +0000, Lee Jones wrote:
> 'uart-has-rtscts' property and 'rts-gpios|cts-gpios' are normally
> mutually exclusive, however it is possible for some drivers to have
> a dynamic approach, meaning that both properties can be relevant.
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  Documentation/devicetree/bindings/serial/serial.txt | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH v2 06/10] dt-bindings: serial: Update 'uart-has-rtscts' description
@ 2017-02-01 15:41     ` Rob Herring
  0 siblings, 0 replies; 44+ messages in thread
From: Rob Herring @ 2017-02-01 15:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 27, 2017 at 05:28:00PM +0000, Lee Jones wrote:
> 'uart-has-rtscts' property and 'rts-gpios|cts-gpios' are normally
> mutually exclusive, however it is possible for some drivers to have
> a dynamic approach, meaning that both properties can be relevant.
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  Documentation/devicetree/bindings/serial/serial.txt | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH v2 00/10] serial: st-asc: Allow handling of RTS line
@ 2017-02-02  7:42   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-02-02  7:42 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-arm-kernel, linux-kernel, kernel, patrice.chotard

Hi Greg, Jiri,

> 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 set ensures the correct Pinctrl groups are configured and
> obtained for both manual toggling of the RTS line and for the IP to
> take over the lines when HW flow-control is requested by the user. 
> 
> Lee Jones (10):
>   serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled
>   serial: st-asc: Provide RTS functionality
>   serial: st-asc: Read in all Pinctrl states
>   serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles
>   serial: st-asc: Use generic DT binding for announcing RTS/CTS lines
>   dt-bindings: serial: Update 'uart-has-rtscts' description
>   ARM: dts: STiH410-b2260: Identify the UART RTS line
>   ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control
>   ARM: dts: STiH407-family: Use new Pinctrl groups
>   ARM: dts: STiH410-b2260: Enable HW flow-control
> 
>  .../devicetree/bindings/serial/serial.txt          |   3 +-
>  arch/arm/boot/dts/stih407-family.dtsi              |   3 +-
>  arch/arm/boot/dts/stih407-pinctrl.dtsi             |  12 ++-
>  arch/arm/boot/dts/stih410-b2260.dts                |   5 +
>  drivers/tty/serial/st-asc.c                        | 101 +++++++++++++++++++--
>  5 files changed, 110 insertions(+), 14 deletions(-)

Looks like everyone is happy with the set.

Are you planning to merge it?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH v2 00/10] serial: st-asc: Allow handling of RTS line
@ 2017-02-02  7:42   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-02-02  7:42 UTC (permalink / raw)
  To: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, jslaby-IBi9RG/b67k,
	linux-serial-u79uwXL29TY76Z2rM5mHXA, dt-DgEjT+Ai2ygdnm+yROfE0A,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-F5mvAk5X5gdBDgjK7y7TUQ, patrice.chotard-qxv4g6HH51o

Hi Greg, Jiri,

> 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 set ensures the correct Pinctrl groups are configured and
> obtained for both manual toggling of the RTS line and for the IP to
> take over the lines when HW flow-control is requested by the user. 
> 
> Lee Jones (10):
>   serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled
>   serial: st-asc: Provide RTS functionality
>   serial: st-asc: Read in all Pinctrl states
>   serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles
>   serial: st-asc: Use generic DT binding for announcing RTS/CTS lines
>   dt-bindings: serial: Update 'uart-has-rtscts' description
>   ARM: dts: STiH410-b2260: Identify the UART RTS line
>   ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control
>   ARM: dts: STiH407-family: Use new Pinctrl groups
>   ARM: dts: STiH410-b2260: Enable HW flow-control
> 
>  .../devicetree/bindings/serial/serial.txt          |   3 +-
>  arch/arm/boot/dts/stih407-family.dtsi              |   3 +-
>  arch/arm/boot/dts/stih407-pinctrl.dtsi             |  12 ++-
>  arch/arm/boot/dts/stih410-b2260.dts                |   5 +
>  drivers/tty/serial/st-asc.c                        | 101 +++++++++++++++++++--
>  5 files changed, 110 insertions(+), 14 deletions(-)

Looks like everyone is happy with the set.

Are you planning to merge it?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH v2 00/10] serial: st-asc: Allow handling of RTS line
@ 2017-02-02  7:42   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-02-02  7:42 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Greg, Jiri,

> 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 set ensures the correct Pinctrl groups are configured and
> obtained for both manual toggling of the RTS line and for the IP to
> take over the lines when HW flow-control is requested by the user. 
> 
> Lee Jones (10):
>   serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled
>   serial: st-asc: Provide RTS functionality
>   serial: st-asc: Read in all Pinctrl states
>   serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles
>   serial: st-asc: Use generic DT binding for announcing RTS/CTS lines
>   dt-bindings: serial: Update 'uart-has-rtscts' description
>   ARM: dts: STiH410-b2260: Identify the UART RTS line
>   ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control
>   ARM: dts: STiH407-family: Use new Pinctrl groups
>   ARM: dts: STiH410-b2260: Enable HW flow-control
> 
>  .../devicetree/bindings/serial/serial.txt          |   3 +-
>  arch/arm/boot/dts/stih407-family.dtsi              |   3 +-
>  arch/arm/boot/dts/stih407-pinctrl.dtsi             |  12 ++-
>  arch/arm/boot/dts/stih410-b2260.dts                |   5 +
>  drivers/tty/serial/st-asc.c                        | 101 +++++++++++++++++++--
>  5 files changed, 110 insertions(+), 14 deletions(-)

Looks like everyone is happy with the set.

Are you planning to merge it?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH v2 00/10] serial: st-asc: Allow handling of RTS line
  2017-02-02  7:42   ` Lee Jones
  (?)
@ 2017-02-02  9:55     ` Greg KH
  -1 siblings, 0 replies; 44+ messages in thread
From: Greg KH @ 2017-02-02  9:55 UTC (permalink / raw)
  To: Lee Jones
  Cc: jslaby, linux-serial, dt, devicetree, linux-arm-kernel,
	linux-kernel, kernel, patrice.chotard

On Thu, Feb 02, 2017 at 07:42:36AM +0000, Lee Jones wrote:
> Hi Greg, Jiri,
> 
> > 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 set ensures the correct Pinctrl groups are configured and
> > obtained for both manual toggling of the RTS line and for the IP to
> > take over the lines when HW flow-control is requested by the user. 
> > 
> > Lee Jones (10):
> >   serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled
> >   serial: st-asc: Provide RTS functionality
> >   serial: st-asc: Read in all Pinctrl states
> >   serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles
> >   serial: st-asc: Use generic DT binding for announcing RTS/CTS lines
> >   dt-bindings: serial: Update 'uart-has-rtscts' description
> >   ARM: dts: STiH410-b2260: Identify the UART RTS line
> >   ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control
> >   ARM: dts: STiH407-family: Use new Pinctrl groups
> >   ARM: dts: STiH410-b2260: Enable HW flow-control
> > 
> >  .../devicetree/bindings/serial/serial.txt          |   3 +-
> >  arch/arm/boot/dts/stih407-family.dtsi              |   3 +-
> >  arch/arm/boot/dts/stih407-pinctrl.dtsi             |  12 ++-
> >  arch/arm/boot/dts/stih410-b2260.dts                |   5 +
> >  drivers/tty/serial/st-asc.c                        | 101 +++++++++++++++++++--
> >  5 files changed, 110 insertions(+), 14 deletions(-)
> 
> Looks like everyone is happy with the set.
> 
> Are you planning to merge it?

I'll take it in my next round of patches, give me a few days to sync up,
I normally do serial patches once a week or so.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH v2 00/10] serial: st-asc: Allow handling of RTS line
@ 2017-02-02  9:55     ` Greg KH
  0 siblings, 0 replies; 44+ messages in thread
From: Greg KH @ 2017-02-02  9:55 UTC (permalink / raw)
  To: Lee Jones
  Cc: jslaby-IBi9RG/b67k, linux-serial-u79uwXL29TY76Z2rM5mHXA,
	dt-DgEjT+Ai2ygdnm+yROfE0A, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-F5mvAk5X5gdBDgjK7y7TUQ, patrice.chotard-qxv4g6HH51o

On Thu, Feb 02, 2017 at 07:42:36AM +0000, Lee Jones wrote:
> Hi Greg, Jiri,
> 
> > 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 set ensures the correct Pinctrl groups are configured and
> > obtained for both manual toggling of the RTS line and for the IP to
> > take over the lines when HW flow-control is requested by the user. 
> > 
> > Lee Jones (10):
> >   serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled
> >   serial: st-asc: Provide RTS functionality
> >   serial: st-asc: Read in all Pinctrl states
> >   serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles
> >   serial: st-asc: Use generic DT binding for announcing RTS/CTS lines
> >   dt-bindings: serial: Update 'uart-has-rtscts' description
> >   ARM: dts: STiH410-b2260: Identify the UART RTS line
> >   ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control
> >   ARM: dts: STiH407-family: Use new Pinctrl groups
> >   ARM: dts: STiH410-b2260: Enable HW flow-control
> > 
> >  .../devicetree/bindings/serial/serial.txt          |   3 +-
> >  arch/arm/boot/dts/stih407-family.dtsi              |   3 +-
> >  arch/arm/boot/dts/stih407-pinctrl.dtsi             |  12 ++-
> >  arch/arm/boot/dts/stih410-b2260.dts                |   5 +
> >  drivers/tty/serial/st-asc.c                        | 101 +++++++++++++++++++--
> >  5 files changed, 110 insertions(+), 14 deletions(-)
> 
> Looks like everyone is happy with the set.
> 
> Are you planning to merge it?

I'll take it in my next round of patches, give me a few days to sync up,
I normally do serial patches once a week or so.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH v2 00/10] serial: st-asc: Allow handling of RTS line
@ 2017-02-02  9:55     ` Greg KH
  0 siblings, 0 replies; 44+ messages in thread
From: Greg KH @ 2017-02-02  9:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 02, 2017 at 07:42:36AM +0000, Lee Jones wrote:
> Hi Greg, Jiri,
> 
> > 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 set ensures the correct Pinctrl groups are configured and
> > obtained for both manual toggling of the RTS line and for the IP to
> > take over the lines when HW flow-control is requested by the user. 
> > 
> > Lee Jones (10):
> >   serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled
> >   serial: st-asc: Provide RTS functionality
> >   serial: st-asc: Read in all Pinctrl states
> >   serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles
> >   serial: st-asc: Use generic DT binding for announcing RTS/CTS lines
> >   dt-bindings: serial: Update 'uart-has-rtscts' description
> >   ARM: dts: STiH410-b2260: Identify the UART RTS line
> >   ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control
> >   ARM: dts: STiH407-family: Use new Pinctrl groups
> >   ARM: dts: STiH410-b2260: Enable HW flow-control
> > 
> >  .../devicetree/bindings/serial/serial.txt          |   3 +-
> >  arch/arm/boot/dts/stih407-family.dtsi              |   3 +-
> >  arch/arm/boot/dts/stih407-pinctrl.dtsi             |  12 ++-
> >  arch/arm/boot/dts/stih410-b2260.dts                |   5 +
> >  drivers/tty/serial/st-asc.c                        | 101 +++++++++++++++++++--
> >  5 files changed, 110 insertions(+), 14 deletions(-)
> 
> Looks like everyone is happy with the set.
> 
> Are you planning to merge it?

I'll take it in my next round of patches, give me a few days to sync up,
I normally do serial patches once a week or so.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH v2 00/10] serial: st-asc: Allow handling of RTS line
@ 2017-02-03  9:22       ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-02-03  9:22 UTC (permalink / raw)
  To: Greg KH
  Cc: jslaby, linux-serial, dt, devicetree, linux-arm-kernel,
	linux-kernel, kernel, patrice.chotard

On Thu, 02 Feb 2017, Greg KH wrote:

> On Thu, Feb 02, 2017 at 07:42:36AM +0000, Lee Jones wrote:
> > Hi Greg, Jiri,
> > 
> > > 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 set ensures the correct Pinctrl groups are configured and
> > > obtained for both manual toggling of the RTS line and for the IP to
> > > take over the lines when HW flow-control is requested by the user. 
> > > 
> > > Lee Jones (10):
> > >   serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled
> > >   serial: st-asc: Provide RTS functionality
> > >   serial: st-asc: Read in all Pinctrl states
> > >   serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles
> > >   serial: st-asc: Use generic DT binding for announcing RTS/CTS lines
> > >   dt-bindings: serial: Update 'uart-has-rtscts' description
> > >   ARM: dts: STiH410-b2260: Identify the UART RTS line
> > >   ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control
> > >   ARM: dts: STiH407-family: Use new Pinctrl groups
> > >   ARM: dts: STiH410-b2260: Enable HW flow-control
> > > 
> > >  .../devicetree/bindings/serial/serial.txt          |   3 +-
> > >  arch/arm/boot/dts/stih407-family.dtsi              |   3 +-
> > >  arch/arm/boot/dts/stih407-pinctrl.dtsi             |  12 ++-
> > >  arch/arm/boot/dts/stih410-b2260.dts                |   5 +
> > >  drivers/tty/serial/st-asc.c                        | 101 +++++++++++++++++++--
> > >  5 files changed, 110 insertions(+), 14 deletions(-)
> > 
> > Looks like everyone is happy with the set.
> > 
> > Are you planning to merge it?
> 
> I'll take it in my next round of patches, give me a few days to sync up,
> I normally do serial patches once a week or so.

Works for me.  Thanks Greg.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH v2 00/10] serial: st-asc: Allow handling of RTS line
@ 2017-02-03  9:22       ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-02-03  9:22 UTC (permalink / raw)
  To: Greg KH
  Cc: jslaby-IBi9RG/b67k, linux-serial-u79uwXL29TY76Z2rM5mHXA,
	dt-DgEjT+Ai2ygdnm+yROfE0A, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-F5mvAk5X5gdBDgjK7y7TUQ, patrice.chotard-qxv4g6HH51o

On Thu, 02 Feb 2017, Greg KH wrote:

> On Thu, Feb 02, 2017 at 07:42:36AM +0000, Lee Jones wrote:
> > Hi Greg, Jiri,
> > 
> > > 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 set ensures the correct Pinctrl groups are configured and
> > > obtained for both manual toggling of the RTS line and for the IP to
> > > take over the lines when HW flow-control is requested by the user. 
> > > 
> > > Lee Jones (10):
> > >   serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled
> > >   serial: st-asc: Provide RTS functionality
> > >   serial: st-asc: Read in all Pinctrl states
> > >   serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles
> > >   serial: st-asc: Use generic DT binding for announcing RTS/CTS lines
> > >   dt-bindings: serial: Update 'uart-has-rtscts' description
> > >   ARM: dts: STiH410-b2260: Identify the UART RTS line
> > >   ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control
> > >   ARM: dts: STiH407-family: Use new Pinctrl groups
> > >   ARM: dts: STiH410-b2260: Enable HW flow-control
> > > 
> > >  .../devicetree/bindings/serial/serial.txt          |   3 +-
> > >  arch/arm/boot/dts/stih407-family.dtsi              |   3 +-
> > >  arch/arm/boot/dts/stih407-pinctrl.dtsi             |  12 ++-
> > >  arch/arm/boot/dts/stih410-b2260.dts                |   5 +
> > >  drivers/tty/serial/st-asc.c                        | 101 +++++++++++++++++++--
> > >  5 files changed, 110 insertions(+), 14 deletions(-)
> > 
> > Looks like everyone is happy with the set.
> > 
> > Are you planning to merge it?
> 
> I'll take it in my next round of patches, give me a few days to sync up,
> I normally do serial patches once a week or so.

Works for me.  Thanks Greg.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH v2 00/10] serial: st-asc: Allow handling of RTS line
@ 2017-02-03  9:22       ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-02-03  9:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 02 Feb 2017, Greg KH wrote:

> On Thu, Feb 02, 2017 at 07:42:36AM +0000, Lee Jones wrote:
> > Hi Greg, Jiri,
> > 
> > > 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 set ensures the correct Pinctrl groups are configured and
> > > obtained for both manual toggling of the RTS line and for the IP to
> > > take over the lines when HW flow-control is requested by the user. 
> > > 
> > > Lee Jones (10):
> > >   serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled
> > >   serial: st-asc: Provide RTS functionality
> > >   serial: st-asc: Read in all Pinctrl states
> > >   serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles
> > >   serial: st-asc: Use generic DT binding for announcing RTS/CTS lines
> > >   dt-bindings: serial: Update 'uart-has-rtscts' description
> > >   ARM: dts: STiH410-b2260: Identify the UART RTS line
> > >   ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control
> > >   ARM: dts: STiH407-family: Use new Pinctrl groups
> > >   ARM: dts: STiH410-b2260: Enable HW flow-control
> > > 
> > >  .../devicetree/bindings/serial/serial.txt          |   3 +-
> > >  arch/arm/boot/dts/stih407-family.dtsi              |   3 +-
> > >  arch/arm/boot/dts/stih407-pinctrl.dtsi             |  12 ++-
> > >  arch/arm/boot/dts/stih410-b2260.dts                |   5 +
> > >  drivers/tty/serial/st-asc.c                        | 101 +++++++++++++++++++--
> > >  5 files changed, 110 insertions(+), 14 deletions(-)
> > 
> > Looks like everyone is happy with the set.
> > 
> > Are you planning to merge it?
> 
> I'll take it in my next round of patches, give me a few days to sync up,
> I normally do serial patches once a week or so.

Works for me.  Thanks Greg.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH v2 10/10] ARM: dts: STiH410-b2260: Enable HW flow-control
  2017-02-01 14:31 Lee Jones
@ 2017-02-01 14:31   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-02-01 14:31 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, dt, devicetree
  Cc: linux-arm-kernel, linux-kernel, kernel, patrice.chotard, Lee Jones

Hardware flow-control capability must be specified at a platform
level in order to inform the ASC driver that the platform is capable
(i.e. are the lines wired up, etc).  STiH4{07,10} devices are indeed
capable, so let's provide the property.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/stih410-b2260.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/stih410-b2260.dts b/arch/arm/boot/dts/stih410-b2260.dts
index cbcbcb4..93c14d1 100644
--- a/arch/arm/boot/dts/stih410-b2260.dts
+++ b/arch/arm/boot/dts/stih410-b2260.dts
@@ -66,6 +66,7 @@
 			pinctrl-0 = <&pinctrl_serial0_hw_flowctrl>;
 			pinctrl-1 = <&pinctrl_serial0>;
 			rts-gpios = <&pio17 3 GPIO_ACTIVE_LOW>;
+			uart-has-rtscts;
 			status = "okay";
 		};
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH v2 10/10] ARM: dts: STiH410-b2260: Enable HW flow-control
@ 2017-02-01 14:31   ` Lee Jones
  0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2017-02-01 14:31 UTC (permalink / raw)
  To: linux-arm-kernel

Hardware flow-control capability must be specified at a platform
level in order to inform the ASC driver that the platform is capable
(i.e. are the lines wired up, etc).  STiH4{07,10} devices are indeed
capable, so let's provide the property.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/stih410-b2260.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/stih410-b2260.dts b/arch/arm/boot/dts/stih410-b2260.dts
index cbcbcb4..93c14d1 100644
--- a/arch/arm/boot/dts/stih410-b2260.dts
+++ b/arch/arm/boot/dts/stih410-b2260.dts
@@ -66,6 +66,7 @@
 			pinctrl-0 = <&pinctrl_serial0_hw_flowctrl>;
 			pinctrl-1 = <&pinctrl_serial0>;
 			rts-gpios = <&pio17 3 GPIO_ACTIVE_LOW>;
+			uart-has-rtscts;
 			status = "okay";
 		};
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2017-02-03  9:23 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-27 17:27 [PATCH v2 00/10] serial: st-asc: Allow handling of RTS line Lee Jones
2017-01-27 17:27 ` Lee Jones
2017-01-27 17:27 ` [PATCH v2 01/10] serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled Lee Jones
2017-01-27 17:27   ` Lee Jones
2017-01-27 17:27   ` Lee Jones
2017-01-27 17:27 ` [PATCH v2 02/10] serial: st-asc: Provide RTS functionality Lee Jones
2017-01-27 17:27   ` Lee Jones
2017-01-27 17:27 ` [PATCH v2 03/10] serial: st-asc: Read in all Pinctrl states Lee Jones
2017-01-27 17:27   ` Lee Jones
2017-01-27 17:27   ` Lee Jones
2017-01-27 17:27 ` [PATCH v2 04/10] serial: st-asc: (De)Register GPIOD and swap Pinctrl profiles Lee Jones
2017-01-27 17:27   ` Lee Jones
2017-01-27 17:27 ` [PATCH v2 05/10] serial: st-asc: Use generic DT binding for announcing RTS/CTS lines Lee Jones
2017-01-27 17:27   ` Lee Jones
2017-01-27 17:27   ` Lee Jones
2017-01-27 17:28 ` [PATCH v2 06/10] dt-bindings: serial: Update 'uart-has-rtscts' description Lee Jones
2017-01-27 17:28   ` Lee Jones
2017-01-27 17:28   ` Lee Jones
2017-02-01 15:41   ` Rob Herring
2017-02-01 15:41     ` Rob Herring
2017-01-27 17:28 ` [PATCH v2 07/10] ARM: dts: STiH410-b2260: Identify the UART RTS line Lee Jones
2017-01-27 17:28   ` Lee Jones
2017-01-27 17:28   ` Lee Jones
2017-01-27 17:28 ` [PATCH v2 08/10] ARM: dts: STiH407-pinctrl: Add Pinctrl group for HW flow-control Lee Jones
2017-01-27 17:28   ` Lee Jones
2017-01-27 17:28   ` Lee Jones
2017-01-27 17:28 ` [PATCH v2 09/10] ARM: dts: STiH407-family: Use new Pinctrl groups Lee Jones
2017-01-27 17:28   ` Lee Jones
2017-01-30 10:10   ` Patrice CHOTARD
2017-01-30 10:10     ` Patrice CHOTARD
2017-01-30 10:10     ` Patrice CHOTARD
2017-01-27 17:28 ` [PATCH v2 10/10] ARM: dts: STiH410-b2260: Enable HW flow-control Lee Jones
2017-01-27 17:28   ` Lee Jones
2017-02-02  7:42 ` [PATCH v2 00/10] serial: st-asc: Allow handling of RTS line Lee Jones
2017-02-02  7:42   ` Lee Jones
2017-02-02  7:42   ` Lee Jones
2017-02-02  9:55   ` Greg KH
2017-02-02  9:55     ` Greg KH
2017-02-02  9:55     ` Greg KH
2017-02-03  9:22     ` Lee Jones
2017-02-03  9:22       ` Lee Jones
2017-02-03  9:22       ` Lee Jones
2017-02-01 14:31 Lee Jones
2017-02-01 14:31 ` [PATCH v2 10/10] ARM: dts: STiH410-b2260: Enable HW flow-control Lee Jones
2017-02-01 14:31   ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.