diff mbox series

[v3,1/2] dt-bindings: power: reset: qcom-pon: update "reg" property details

Message ID 20220713193350.29796-2-quic_amelende@quicinc.com
State New
Headers show
Series add support for PON GEN3 device | expand

Commit Message

Anjelique Melendez July 13, 2022, 7:33 p.m. UTC
From: David Collins <quic_collinsd@quicinc.com>

Update the description of "reg" property to add the PON_PBS base
address along with PON_HLOS base address.  Also add "reg-names"
property description.

Signed-off-by: David Collins <quic_collinsd@quicinc.com>
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
---
 Documentation/devicetree/bindings/power/reset/qcom,pon.yaml | 73 ++++++++++++++++++++++++++++--
 1 file changed, 69 insertions(+), 4 deletions(-)

Comments

Krzysztof Kozlowski July 14, 2022, 11:48 a.m. UTC | #1
On 13/07/2022 21:33, Anjelique Melendez wrote:
> From: David Collins <quic_collinsd@quicinc.com>
> 
> Update the description of "reg" property to add the PON_PBS base
> address along with PON_HLOS base address.  Also add "reg-names"
> property description.
> 
> Signed-off-by: David Collins <quic_collinsd@quicinc.com>
> Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
> ---
>  Documentation/devicetree/bindings/power/reset/qcom,pon.yaml | 73 ++++++++++++++++++++++++++++--
>  1 file changed, 69 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml b/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
> index 353f155d..562fe308 100644
> --- a/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
> +++ b/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
> @@ -15,18 +15,26 @@ description: |
>  
>    This DT node has pwrkey and resin as sub nodes.
>  
> -allOf:
> -  - $ref: reboot-mode.yaml#
> -
>  properties:
>    compatible:
>      enum:
>        - qcom,pm8916-pon
>        - qcom,pms405-pon
>        - qcom,pm8998-pon
> +      - qcom,pmk8350-pon
>  
>    reg:
> -    maxItems: 1
> +    description: |
> +      Specifies the SPMI base address for the PON (power-on) peripheral.  For
> +      PMICs that have the PON peripheral (GEN3) split into PON_HLOS and PON_PBS
> +      (e.g. PMK8350), this can hold addresses of both PON_HLOS and PON_PBS
> +      peripherals.  In that case, the PON_PBS address needs to be specified to
> +      facilitate software debouncing on some PMIC.

You miss here min and maxItems

> +
> +  reg-names:
> +    description: |
> +      For PON GEN1 and GEN2, it should be "pon". For PON GEN3 it should include
> +      "hlos" and optionally "pbs".

Skip description. You miss here min and maxItems.

See
https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L57
for examples.


>  
>    pwrkey:
>      type: object
> @@ -42,6 +50,63 @@ required:
>  
>  unevaluatedProperties: false
>  
> +allOf:
> +  - $ref: reboot-mode.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: qcom,pm8916-pon
> +    then:
> +      properties:
> +        reg:
> +          maxItems: 1
> +        reg-names:
> +          items:
> +            - const: pon
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: qcom,pms405-pon
> +    then:
> +      properties:
> +        reg:
> +          maxItems: 1
> +        reg-names:
> +          items:
> +            - const: pon
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: qcom,pm8998-pon
> +    then:
> +      properties:
> +        reg:
> +          maxItems: 1
> +        reg-names:
> +          items:
> +            - const: pon

No clue why you made three if statements. This is one if for all three
variants.

> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: qcom,pmk8350-pon
> +    then:
> +      properties:
> +        reg:
> +          minItems: 1
> +          maxItems: 2
> +        reg-names:
> +          minItems: 1
> +          items:
> +            - const: hlos
> +            - const: pbs
> +
>  examples:
>    - |
>     #include <dt-bindings/interrupt-controller/irq.h>


Best regards,
Krzysztof
Anjelique Melendez July 18, 2022, 7:57 p.m. UTC | #2
On 7/14/2022 4:48 AM, Krzysztof Kozlowski wrote:
> On 13/07/2022 21:33, Anjelique Melendez wrote:
>> From: David Collins <quic_collinsd@quicinc.com>
>>
>> Update the description of "reg" property to add the PON_PBS base
>> address along with PON_HLOS base address.  Also add "reg-names"
>> property description.
>>
>> Signed-off-by: David Collins <quic_collinsd@quicinc.com>
>> Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
>> ---
>>  Documentation/devicetree/bindings/power/reset/qcom,pon.yaml | 73 ++++++++++++++++++++++++++++--
>>  1 file changed, 69 insertions(+), 4 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml b/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
>> index 353f155d..562fe308 100644
>> --- a/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
>> +++ b/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
>> @@ -15,18 +15,26 @@ description: |
>>  
>>    This DT node has pwrkey and resin as sub nodes.
>>  
>> -allOf:
>> -  - $ref: reboot-mode.yaml#
>> -
>>  properties:
>>    compatible:
>>      enum:
>>        - qcom,pm8916-pon
>>        - qcom,pms405-pon
>>        - qcom,pm8998-pon
>> +      - qcom,pmk8350-pon
>>  
>>    reg:
>> -    maxItems: 1
>> +    description: |
>> +      Specifies the SPMI base address for the PON (power-on) peripheral.  For
>> +      PMICs that have the PON peripheral (GEN3) split into PON_HLOS and PON_PBS
>> +      (e.g. PMK8350), this can hold addresses of both PON_HLOS and PON_PBS
>> +      peripherals.  In that case, the PON_PBS address needs to be specified to
>> +      facilitate software debouncing on some PMIC.
> 
> You miss here min and maxItems
ACK
> 
>> +
>> +  reg-names:
>> +    description: |
>> +      For PON GEN1 and GEN2, it should be "pon". For PON GEN3 it should include
>> +      "hlos" and optionally "pbs".
> 
> Skip description. You miss here min and maxItems.
> 
> See
> https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L57
> for examples.
ACK
> 
> 
>>  
>>    pwrkey:
>>      type: object
>> @@ -42,6 +50,63 @@ required:
>>  
>>  unevaluatedProperties: false
>>  
>> +allOf:
>> +  - $ref: reboot-mode.yaml#
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            const: qcom,pm8916-pon
>> +    then:
>> +      properties:
>> +        reg:
>> +          maxItems: 1
>> +        reg-names:
>> +          items:
>> +            - const: pon
>> +
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            const: qcom,pms405-pon
>> +    then:
>> +      properties:
>> +        reg:
>> +          maxItems: 1
>> +        reg-names:
>> +          items:
>> +            - const: pon
>> +
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            const: qcom,pm8998-pon
>> +    then:
>> +      properties:
>> +        reg:
>> +          maxItems: 1
>> +        reg-names:
>> +          items:
>> +            - const: pon
> 
> No clue why you made three if statements. This is one if for all three
> variants.
> 
Sorry about that was not sure how to combine the if statements originally.
Found that you could do:

- if:
      properties:
        compatible:
          contains:
            enum:
              - qcom,pm8916-pon
              - qcom,pms405-pon
              - qcom,pm8998-pon
    then:
     ...

I was wondering if for the "qcom,pmk8350-pon" compatible would you rather
have the if statement the way it is or have it follow the same pattern as
above i.e.

contains:
  const: qcom,pmk8350-pon

vs

contains:
  enum:
    - qcom,pmk8350-pon
>> +
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            const: qcom,pmk8350-pon
>> +    then:
>> +      properties:
>> +        reg:
>> +          minItems: 1
>> +          maxItems: 2
>> +        reg-names:
>> +          minItems: 1
>> +          items:
>> +            - const: hlos
>> +            - const: pbs
>> +
>>  examples:
>>    - |
>>     #include <dt-bindings/interrupt-controller/irq.h>
> 
> 
> Best regards,
> Krzysztof

Thanks,
Anjelique
Rob Herring July 18, 2022, 8:56 p.m. UTC | #3
On Mon, Jul 18, 2022 at 12:57:09PM -0700, Anjelique Melendez wrote:
> 
> 
> On 7/14/2022 4:48 AM, Krzysztof Kozlowski wrote:
> > On 13/07/2022 21:33, Anjelique Melendez wrote:
> >> From: David Collins <quic_collinsd@quicinc.com>
> >>
> >> Update the description of "reg" property to add the PON_PBS base
> >> address along with PON_HLOS base address.  Also add "reg-names"
> >> property description.
> >>
> >> Signed-off-by: David Collins <quic_collinsd@quicinc.com>
> >> Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
> >> ---
> >>  Documentation/devicetree/bindings/power/reset/qcom,pon.yaml | 73 ++++++++++++++++++++++++++++--
> >>  1 file changed, 69 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml b/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
> >> index 353f155d..562fe308 100644
> >> --- a/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
> >> +++ b/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
> >> @@ -15,18 +15,26 @@ description: |
> >>  
> >>    This DT node has pwrkey and resin as sub nodes.
> >>  
> >> -allOf:
> >> -  - $ref: reboot-mode.yaml#
> >> -
> >>  properties:
> >>    compatible:
> >>      enum:
> >>        - qcom,pm8916-pon
> >>        - qcom,pms405-pon
> >>        - qcom,pm8998-pon
> >> +      - qcom,pmk8350-pon
> >>  
> >>    reg:
> >> -    maxItems: 1
> >> +    description: |
> >> +      Specifies the SPMI base address for the PON (power-on) peripheral.  For
> >> +      PMICs that have the PON peripheral (GEN3) split into PON_HLOS and PON_PBS
> >> +      (e.g. PMK8350), this can hold addresses of both PON_HLOS and PON_PBS
> >> +      peripherals.  In that case, the PON_PBS address needs to be specified to
> >> +      facilitate software debouncing on some PMIC.
> > 
> > You miss here min and maxItems
> ACK
> > 
> >> +
> >> +  reg-names:
> >> +    description: |
> >> +      For PON GEN1 and GEN2, it should be "pon". For PON GEN3 it should include
> >> +      "hlos" and optionally "pbs".
> > 
> > Skip description. You miss here min and maxItems.
> > 
> > See
> > https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L57
> > for examples.
> ACK
> > 
> > 
> >>  
> >>    pwrkey:
> >>      type: object
> >> @@ -42,6 +50,63 @@ required:
> >>  
> >>  unevaluatedProperties: false
> >>  
> >> +allOf:
> >> +  - $ref: reboot-mode.yaml#
> >> +  - if:
> >> +      properties:
> >> +        compatible:
> >> +          contains:
> >> +            const: qcom,pm8916-pon
> >> +    then:
> >> +      properties:
> >> +        reg:
> >> +          maxItems: 1
> >> +        reg-names:
> >> +          items:
> >> +            - const: pon
> >> +
> >> +  - if:
> >> +      properties:
> >> +        compatible:
> >> +          contains:
> >> +            const: qcom,pms405-pon
> >> +    then:
> >> +      properties:
> >> +        reg:
> >> +          maxItems: 1
> >> +        reg-names:
> >> +          items:
> >> +            - const: pon
> >> +
> >> +  - if:
> >> +      properties:
> >> +        compatible:
> >> +          contains:
> >> +            const: qcom,pm8998-pon
> >> +    then:
> >> +      properties:
> >> +        reg:
> >> +          maxItems: 1
> >> +        reg-names:
> >> +          items:
> >> +            - const: pon
> > 
> > No clue why you made three if statements. This is one if for all three
> > variants.
> > 
> Sorry about that was not sure how to combine the if statements originally.
> Found that you could do:
> 
> - if:
>       properties:
>         compatible:
>           contains:
>             enum:
>               - qcom,pm8916-pon
>               - qcom,pms405-pon
>               - qcom,pm8998-pon
>     then:
>      ...
> 
> I was wondering if for the "qcom,pmk8350-pon" compatible would you rather
> have the if statement the way it is or have it follow the same pattern as
> above i.e.
> 
> contains:
>   const: qcom,pmk8350-pon
> 
> vs
> 
> contains:
>   enum:
>     - qcom,pmk8350-pon

The former. If only 1 possibility, use 'const'.

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml b/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
index 353f155d..562fe308 100644
--- a/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
+++ b/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
@@ -15,18 +15,26 @@  description: |
 
   This DT node has pwrkey and resin as sub nodes.
 
-allOf:
-  - $ref: reboot-mode.yaml#
-
 properties:
   compatible:
     enum:
       - qcom,pm8916-pon
       - qcom,pms405-pon
       - qcom,pm8998-pon
+      - qcom,pmk8350-pon
 
   reg:
-    maxItems: 1
+    description: |
+      Specifies the SPMI base address for the PON (power-on) peripheral.  For
+      PMICs that have the PON peripheral (GEN3) split into PON_HLOS and PON_PBS
+      (e.g. PMK8350), this can hold addresses of both PON_HLOS and PON_PBS
+      peripherals.  In that case, the PON_PBS address needs to be specified to
+      facilitate software debouncing on some PMIC.
+
+  reg-names:
+    description: |
+      For PON GEN1 and GEN2, it should be "pon". For PON GEN3 it should include
+      "hlos" and optionally "pbs".
 
   pwrkey:
     type: object
@@ -42,6 +50,63 @@  required:
 
 unevaluatedProperties: false
 
+allOf:
+  - $ref: reboot-mode.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: qcom,pm8916-pon
+    then:
+      properties:
+        reg:
+          maxItems: 1
+        reg-names:
+          items:
+            - const: pon
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: qcom,pms405-pon
+    then:
+      properties:
+        reg:
+          maxItems: 1
+        reg-names:
+          items:
+            - const: pon
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: qcom,pm8998-pon
+    then:
+      properties:
+        reg:
+          maxItems: 1
+        reg-names:
+          items:
+            - const: pon
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: qcom,pmk8350-pon
+    then:
+      properties:
+        reg:
+          minItems: 1
+          maxItems: 2
+        reg-names:
+          minItems: 1
+          items:
+            - const: hlos
+            - const: pbs
+
 examples:
   - |
    #include <dt-bindings/interrupt-controller/irq.h>