diff mbox series

dt-bindings: pinctrl: qcom,sdm845-pinctrl: add GPIO hogs

Message ID 20221118162101.145267-1-krzysztof.kozlowski@linaro.org
State Accepted
Commit 9eef05e606387b597a86d071f3d72e8ee3e68df7
Headers show
Series dt-bindings: pinctrl: qcom,sdm845-pinctrl: add GPIO hogs | expand

Commit Message

Krzysztof Kozlowski Nov. 18, 2022, 4:21 p.m. UTC
Allow GPIO hogs in pin controller node.  qcom/sdm845-cheza.dtsi already
uses it.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../bindings/pinctrl/qcom,sdm845-pinctrl.yaml        | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Rob Herring Nov. 20, 2022, 4:41 p.m. UTC | #1
On Fri, Nov 18, 2022 at 05:21:01PM +0100, Krzysztof Kozlowski wrote:
> Allow GPIO hogs in pin controller node.  qcom/sdm845-cheza.dtsi already
> uses it.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../bindings/pinctrl/qcom,sdm845-pinctrl.yaml        | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.yaml
> index c9627777ceb3..57bac7f7a4fc 100644
> --- a/Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.yaml
> +++ b/Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.yaml
> @@ -48,6 +48,11 @@ patternProperties:
>              $ref: "#/$defs/qcom-sdm845-tlmm-state"
>          additionalProperties: false
>  
> +  "-hog(-[0-9]+)?$":
> +    $ref: /schemas/gpio/gpio-hog.yaml

You can drop this and just do:

required:
  - gpio-hog

As that's what selects the hog schema. Kind of an odd pattern I guess. 
We could make gpio.yaml define hog nodes instead I suppose.

> +    type: object
> +    unevaluatedProperties: false
> +
Krzysztof Kozlowski Nov. 21, 2022, 8:10 a.m. UTC | #2
On 20/11/2022 17:41, Rob Herring wrote:
> On Fri, Nov 18, 2022 at 05:21:01PM +0100, Krzysztof Kozlowski wrote:
>> Allow GPIO hogs in pin controller node.  qcom/sdm845-cheza.dtsi already
>> uses it.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>>  .../bindings/pinctrl/qcom,sdm845-pinctrl.yaml        | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.yaml
>> index c9627777ceb3..57bac7f7a4fc 100644
>> --- a/Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.yaml
>> +++ b/Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.yaml
>> @@ -48,6 +48,11 @@ patternProperties:
>>              $ref: "#/$defs/qcom-sdm845-tlmm-state"
>>          additionalProperties: false
>>  
>> +  "-hog(-[0-9]+)?$":
>> +    $ref: /schemas/gpio/gpio-hog.yaml
> 
> You can drop this and just do:
> 
> required:
>   - gpio-hog
> 
> As that's what selects the hog schema. Kind of an odd pattern I guess. 
> We could make gpio.yaml define hog nodes instead I suppose.

Thanks, that's much less code.


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.yaml
index c9627777ceb3..57bac7f7a4fc 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.yaml
@@ -48,6 +48,11 @@  patternProperties:
             $ref: "#/$defs/qcom-sdm845-tlmm-state"
         additionalProperties: false
 
+  "-hog(-[0-9]+)?$":
+    $ref: /schemas/gpio/gpio-hog.yaml
+    type: object
+    unevaluatedProperties: false
+
 $defs:
   qcom-sdm845-tlmm-state:
     type: object
@@ -117,6 +122,7 @@  additionalProperties: false
 
 examples:
   - |
+    #include <dt-bindings/gpio/gpio.h>
     #include <dt-bindings/interrupt-controller/arm-gic.h>
 
     pinctrl@3400000 {
@@ -130,6 +136,12 @@  examples:
         gpio-ranges = <&tlmm 0 0 151>;
         wakeup-parent = <&pdc_intc>;
 
+        ap-suspend-l-hog {
+            gpio-hog;
+            gpios = <126 GPIO_ACTIVE_LOW>;
+            output-low;
+        };
+
         cci0-default-state {
             pins = "gpio17", "gpio18";
             function = "cci_i2c";