diff mbox series

[v3,07/34] dt-bindings: pinctrl: qcom,tlmm-common: add common check for function

Message ID 20220927173702.5200-8-krzysztof.kozlowski@linaro.org (mailing list archive)
State Not Applicable
Headers show
Series pinctrl/arm64: qcom: continued - fix Qualcomm TLMM pinctrl schema warnings | expand

Commit Message

Krzysztof Kozlowski Sept. 27, 2022, 5:36 p.m. UTC
Certain pins, like SDcard related, do not have functions and such should
not be required.  Add a check for this in common Qualcomm TLMM pin
controller schema.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
---
 .../bindings/pinctrl/qcom,tlmm-common.yaml    | 20 +++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

Comments

Rob Herring (Arm) Sept. 28, 2022, 12:15 a.m. UTC | #1
On Tue, 27 Sep 2022 19:36:35 +0200, Krzysztof Kozlowski wrote:
> Certain pins, like SDcard related, do not have functions and such should
> not be required.  Add a check for this in common Qualcomm TLMM pin
> controller schema.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Reviewed-by: Bjorn Andersson <andersson@kernel.org>
> ---
>  .../bindings/pinctrl/qcom,tlmm-common.yaml    | 20 +++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>
Stephan Gerhold Sept. 28, 2022, 6:04 p.m. UTC | #2
On Tue, Sep 27, 2022 at 07:36:35PM +0200, Krzysztof Kozlowski wrote:
> Certain pins, like SDcard related, do not have functions and such should
> not be required.  Add a check for this in common Qualcomm TLMM pin
> controller schema.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Reviewed-by: Bjorn Andersson <andersson@kernel.org>

Thanks for moving this to the common schema!

FWIW:
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>

> ---
>  .../bindings/pinctrl/qcom,tlmm-common.yaml    | 20 +++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,tlmm-common.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,tlmm-common.yaml
> index c88c8dcb69d9..e1354f0c64f8 100644
> --- a/Documentation/devicetree/bindings/pinctrl/qcom,tlmm-common.yaml
> +++ b/Documentation/devicetree/bindings/pinctrl/qcom,tlmm-common.yaml
> @@ -65,10 +65,6 @@ additionalProperties: true
>  
>  $defs:
>    qcom-tlmm-state:
> -    allOf:
> -      - $ref: pincfg-node.yaml#
> -      - $ref: pinmux-node.yaml#
> -
>      properties:
>        drive-strength:
>          enum: [2, 4, 6, 8, 10, 12, 14, 16]
> @@ -82,5 +78,21 @@ $defs:
>        output-high: true
>        output-low: true
>  
> +    allOf:
> +      - $ref: pincfg-node.yaml#
> +      - $ref: pinmux-node.yaml#
> +
> +      - if:
> +          properties:
> +            pins:
> +              items:
> +                pattern: "^gpio"
> +        then:
> +          required:
> +            - function
> +        else:
> +          properties:
> +            function: false
> +
>      additionalProperties: true
>  ...
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,tlmm-common.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,tlmm-common.yaml
index c88c8dcb69d9..e1354f0c64f8 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,tlmm-common.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,tlmm-common.yaml
@@ -65,10 +65,6 @@  additionalProperties: true
 
 $defs:
   qcom-tlmm-state:
-    allOf:
-      - $ref: pincfg-node.yaml#
-      - $ref: pinmux-node.yaml#
-
     properties:
       drive-strength:
         enum: [2, 4, 6, 8, 10, 12, 14, 16]
@@ -82,5 +78,21 @@  $defs:
       output-high: true
       output-low: true
 
+    allOf:
+      - $ref: pincfg-node.yaml#
+      - $ref: pinmux-node.yaml#
+
+      - if:
+          properties:
+            pins:
+              items:
+                pattern: "^gpio"
+        then:
+          required:
+            - function
+        else:
+          properties:
+            function: false
+
     additionalProperties: true
 ...