mbox series

[0/8] serial: st-asc: Allow handling of RTS line

Message ID 20170124134310.27512-1-lee.jones@linaro.org
Headers show
Series serial: st-asc: Allow handling of RTS line | expand

Message

Lee Jones Jan. 24, 2017, 1:43 p.m. UTC
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 (8):
  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
  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: STiH407-family: Enable HW flow-control

 arch/arm/boot/dts/stih407-family.dtsi  |  7 +--
 arch/arm/boot/dts/stih407-pinctrl.dtsi | 12 ++++-
 arch/arm/boot/dts/stih410-b2260.dts    |  1 +
 drivers/tty/serial/st-asc.c            | 98 +++++++++++++++++++++++++++++++---
 4 files changed, 105 insertions(+), 13 deletions(-)

-- 
2.10.2

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

Comments

Peter Griffin Jan. 25, 2017, 10:59 a.m. UTC | #1
Hi Lee,

On Tue, 24 Jan 2017, Lee Jones wrote:

> 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/stih407-family.dtsi | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/arch/arm/boot/dts/stih407-family.dtsi b/arch/arm/boot/dts/stih407-family.dtsi

> index 9789978..7ada8ea 100644

> --- a/arch/arm/boot/dts/stih407-family.dtsi

> +++ b/arch/arm/boot/dts/stih407-family.dtsi

> @@ -226,7 +226,7 @@

>  			pinctrl-0 = <&pinctrl_serial0_flowctrl>;

>  			pinctrl-1 = <&pinctrl_serial0>;

>  			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;

> -

> +			st,hw-flow-control;


There is a generic serial binding for this already. As this ST property
hasn't been used upstream, it seems like it would be worth dropping it
and switching to the generic uart-has-rtscts one.

See Documentation/devicetree/bindings/serial/serial.txt

  - uart-has-rtscts: The presence of this property indicates that the
    UART has dedicated lines for RTS/CTS hardware flow control, and that
    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.

Also you should put this in the board dtsi, as it is board dependent property.
By putting it here you are enabling hw-flow-control for all stih407-family
based boards.

regards,

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