diff mbox series

[02/11] dt-bindings: pinctrl: qcom,pmic-gpio: fix matching pin config

Message ID 20220507194913.261121-3-krzysztof.kozlowski@linaro.org
State Accepted
Commit 06367559766b7c9bd96d2baef8bfc5a9bb451e25
Headers show
Series dt-bindings/pinctrl/arm: qcom: minor cleanups of QCOM PMIC pinctrl | expand

Commit Message

Krzysztof Kozlowski May 7, 2022, 7:49 p.m. UTC
Matching PMIC GPIOs config nodes within a '-state' node by '.*' pattern
does not work as expected because of linux,phandle in the DTB:

  arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon-cityman.dtb: gpios@c000: divclk4-state: 'oneOf' conditional failed, one must be fixed:
    'pins' is a required property
    'function' is a required property
    'pinconf' does not match any of the regexes: 'pinctrl-[0-9]+'
    [[2]] is not of type 'object'

Make the schema stricter and expect such nodes to be either named
'pinconfig' or followed with '-pins' prefix.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml          | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Rob Herring May 17, 2022, 12:29 a.m. UTC | #1
On Sat, 07 May 2022 21:49:04 +0200, Krzysztof Kozlowski wrote:
> Matching PMIC GPIOs config nodes within a '-state' node by '.*' pattern
> does not work as expected because of linux,phandle in the DTB:
> 
>   arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon-cityman.dtb: gpios@c000: divclk4-state: 'oneOf' conditional failed, one must be fixed:
>     'pins' is a required property
>     'function' is a required property
>     'pinconf' does not match any of the regexes: 'pinctrl-[0-9]+'
>     [[2]] is not of type 'object'
> 
> Make the schema stricter and expect such nodes to be either named
> 'pinconfig' or followed with '-pins' prefix.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml          | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 

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

Patch

diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
index 23d6b9165e20..c266aa3f05c1 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
@@ -95,8 +95,9 @@  patternProperties:
     oneOf:
       - $ref: "#/$defs/qcom-pmic-gpio-state"
       - patternProperties:
-          ".*":
+          "(pinconf|-pins)$":
             $ref: "#/$defs/qcom-pmic-gpio-state"
+        additionalProperties: false
 
 $defs:
   qcom-pmic-gpio-state:
@@ -237,7 +238,7 @@  examples:
       #gpio-cells = <2>;
 
       pm8921_gpio_keys: gpio-keys-state {
-        volume-keys {
+        volume-keys-pins {
           pins = "gpio20", "gpio21";
           function = "normal";