diff mbox series

pinctrl: rza1: Switch to using "output-enable"

Message ID 20200821111401.4021-1-geert+renesas@glider.be
State Accepted
Commit a4eb6afa7c2c3795ec693cd806fd69593c9ecca7
Headers show
Series pinctrl: rza1: Switch to using "output-enable" | expand

Commit Message

Geert Uytterhoeven Aug. 21, 2020, 11:14 a.m. UTC
For pins requiring software driven IO output operations, the RZ/A1 Pin
Controller uses either the "output-high" or "output-low" DT property to
enable the corresponding output buffer.  The actual line value doesn't
matter, as it is ignored.

Commit 425562429d4f3b13 ("pinctrl: generic: Add output-enable property")
introduced a new DT property for this specific use case.

Update the RZ/A1 Pin Controller DT bindings and driver to use this new
property instead.  Preserve backwards compatibility with old DTBs in the
driver, as this comes at a very small cost.

Notes:
  - The DT binding examples already used the new property,
  - There are no upstream users of the old properties.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
To be queued in sh-pfc for v5.10.

 .../devicetree/bindings/pinctrl/renesas,rza1-pinctrl.txt     | 5 ++---
 drivers/pinctrl/pinctrl-rza1.c                               | 3 ++-
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Rob Herring (Arm) Sept. 8, 2020, 8:53 p.m. UTC | #1
On Fri, 21 Aug 2020 13:14:01 +0200, Geert Uytterhoeven wrote:
> For pins requiring software driven IO output operations, the RZ/A1 Pin
> Controller uses either the "output-high" or "output-low" DT property to
> enable the corresponding output buffer.  The actual line value doesn't
> matter, as it is ignored.
> 
> Commit 425562429d4f3b13 ("pinctrl: generic: Add output-enable property")
> introduced a new DT property for this specific use case.
> 
> Update the RZ/A1 Pin Controller DT bindings and driver to use this new
> property instead.  Preserve backwards compatibility with old DTBs in the
> driver, as this comes at a very small cost.
> 
> Notes:
>   - The DT binding examples already used the new property,
>   - There are no upstream users of the old properties.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> To be queued in sh-pfc for v5.10.
> 
>  .../devicetree/bindings/pinctrl/renesas,rza1-pinctrl.txt     | 5 ++---
>  drivers/pinctrl/pinctrl-rza1.c                               | 3 ++-
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 

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

Patch

diff --git a/Documentation/devicetree/bindings/pinctrl/renesas,rza1-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/renesas,rza1-pinctrl.txt
index fd3696eb36bf307e..38cdd23d3498e74a 100644
--- a/Documentation/devicetree/bindings/pinctrl/renesas,rza1-pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/renesas,rza1-pinctrl.txt
@@ -117,10 +117,9 @@  function or a GPIO controller alternatively.
     - input-enable:
       enable input bufer for pins requiring software driven IO input
       operations.
-    - output-high:
+    - output-enable:
       enable output buffer for pins requiring software driven IO output
-      operations. output-low can be used alternatively, as line value is
-      ignored by the driver.
+      operations.
 
   The hardware reference manual specifies when a pin has to be configured to
   work in bi-directional mode and when the IO direction has to be specified
diff --git a/drivers/pinctrl/pinctrl-rza1.c b/drivers/pinctrl/pinctrl-rza1.c
index 511f232ab7bc290c..944466ef34d33f51 100644
--- a/drivers/pinctrl/pinctrl-rza1.c
+++ b/drivers/pinctrl/pinctrl-rza1.c
@@ -928,7 +928,8 @@  static int rza1_parse_pinmux_node(struct rza1_pinctrl *rza1_pctl,
 		case PIN_CONFIG_INPUT_ENABLE:
 			pinmux_flags |= MUX_FLAGS_SWIO_INPUT;
 			break;
-		case PIN_CONFIG_OUTPUT:
+		case PIN_CONFIG_OUTPUT:	/* for DT backwards compatibility */
+		case PIN_CONFIG_OUTPUT_ENABLE:
 			pinmux_flags |= MUX_FLAGS_SWIO_OUTPUT;
 		default:
 			break;