[PATCH v2 05/11] dt-bindings: mfd: qcom-pm8xxx: document qcom,pm8921 as fallback of qcom,pm8018

Neil Armstrong posted 11 patches 3 years, 2 months ago
There is a newer version of this series
[PATCH v2 05/11] dt-bindings: mfd: qcom-pm8xxx: document qcom,pm8921 as fallback of qcom,pm8018
Posted by Neil Armstrong 3 years, 2 months ago
The PM8018 is used as compatible with PM8921 on the MDM9615, document this situation,
and an example section to validate this change.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>

diff --git a/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml b/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml
index 61bd0b3ce02f..24d71918ff8a 100644
--- a/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml
+++ b/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml
@@ -15,11 +15,15 @@ description: |
 
 properties:
   compatible:
-    enum:
-      - qcom,pm8018
-      - qcom,pm8058
-      - qcom,pm8821
-      - qcom,pm8921
+    oneOf:
+      - enum:
+          - qcom,pm8058
+          - qcom,pm8821
+          - qcom,pm8921
+      - items:
+          - enum:
+              - qcom,pm8018
+          - const: qcom,pm8921
 
   reg:
     maxItems: 1
@@ -52,4 +56,35 @@ required:
   - interrupt-controller
 
 additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    ssbi {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      pmic@0 {
+        compatible = "qcom,pm8921";
+        reg = <0>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+
+        interrupt-parent = <&tlmm>;
+        interrupts = <32 IRQ_TYPE_EDGE_RISING>;
+      };
+
+      pmic@1 {
+        compatible = "qcom,pm8018", "qcom,pm8921";
+        reg = <1>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+
+        interrupt-parent = <&tlmm>;
+        interrupts = <33 IRQ_TYPE_EDGE_RISING>;
+      };
+    };
 ...

-- 
b4 0.10.0
Re: [PATCH v2 05/11] dt-bindings: mfd: qcom-pm8xxx: document qcom,pm8921 as fallback of qcom,pm8018
Posted by Krzysztof Kozlowski 3 years, 2 months ago
On 04/10/2022 10:08, Neil Armstrong wrote:
> The PM8018 is used as compatible with PM8921 on the MDM9615, document this situation,
> and an example section to validate this change.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> 
> diff --git a/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml b/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml
> index 61bd0b3ce02f..24d71918ff8a 100644
> --- a/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml
> +++ b/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml
> @@ -15,11 +15,15 @@ description: |
>  
>  properties:
>    compatible:
> -    enum:
> -      - qcom,pm8018
> -      - qcom,pm8058
> -      - qcom,pm8821
> -      - qcom,pm8921
> +    oneOf:
> +      - enum:
> +          - qcom,pm8058
> +          - qcom,pm8821
> +          - qcom,pm8921
> +      - items:
> +          - enum:
> +              - qcom,pm8018
> +          - const: qcom,pm8921
>  
>    reg:
>      maxItems: 1
> @@ -52,4 +56,35 @@ required:
>    - interrupt-controller
>  
>  additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    ssbi {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +      pmic@0 {
> +        compatible = "qcom,pm8921";
> +        reg = <0>;
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        interrupt-controller;
> +        #interrupt-cells = <2>;
> +
> +        interrupt-parent = <&tlmm>;
> +        interrupts = <32 IRQ_TYPE_EDGE_RISING>;
> +      };
> +
> +      pmic@1 {
> +        compatible = "qcom,pm8018", "qcom,pm8921";
> +        reg = <1>;
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        interrupt-controller;
> +        #interrupt-cells = <2>;
> +
> +        interrupt-parent = <&tlmm>;
> +        interrupts = <33 IRQ_TYPE_EDGE_RISING>;
> +      };

These two pmics are exactly the same (except compatible), so just keep
one example... unless both are coming from the same, real DTS?

Best regards,
Krzysztof
Re: [PATCH v2 05/11] dt-bindings: mfd: qcom-pm8xxx: document qcom,pm8921 as fallback of qcom,pm8018
Posted by Neil Armstrong 3 years, 2 months ago
On 04/10/2022 10:55, Krzysztof Kozlowski wrote:
> On 04/10/2022 10:08, Neil Armstrong wrote:
>> The PM8018 is used as compatible with PM8921 on the MDM9615, document this situation,
>> and an example section to validate this change.
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>>

<snip>

>> +
>> +examples:
>> +  - |
>> +    #include <dt-bindings/interrupt-controller/irq.h>
>> +    ssbi {
>> +      #address-cells = <1>;
>> +      #size-cells = <0>;
>> +      pmic@0 {
>> +        compatible = "qcom,pm8921";
>> +        reg = <0>;
>> +        #address-cells = <1>;
>> +        #size-cells = <0>;
>> +        interrupt-controller;
>> +        #interrupt-cells = <2>;
>> +
>> +        interrupt-parent = <&tlmm>;
>> +        interrupts = <32 IRQ_TYPE_EDGE_RISING>;
>> +      };
>> +
>> +      pmic@1 {
>> +        compatible = "qcom,pm8018", "qcom,pm8921";
>> +        reg = <1>;
>> +        #address-cells = <1>;
>> +        #size-cells = <0>;
>> +        interrupt-controller;
>> +        #interrupt-cells = <2>;
>> +
>> +        interrupt-parent = <&tlmm>;
>> +        interrupts = <33 IRQ_TYPE_EDGE_RISING>;
>> +      };
> 
> These two pmics are exactly the same (except compatible), so just keep
> one example... unless both are coming from the same, real DTS?

It was mainly to exercise the fallback, but it's useless as-is so I'll remove in v3.

> 
> Best regards,
> Krzysztof
> 

Thanks,
Neil
Re: [PATCH v2 05/11] dt-bindings: mfd: qcom-pm8xxx: document qcom,pm8921 as fallback of qcom,pm8018
Posted by Krzysztof Kozlowski 3 years, 2 months ago
On 04/10/2022 11:38, Neil Armstrong wrote:
>>> +        compatible = "qcom,pm8018", "qcom,pm8921";
>>> +        reg = <1>;
>>> +        #address-cells = <1>;
>>> +        #size-cells = <0>;
>>> +        interrupt-controller;
>>> +        #interrupt-cells = <2>;
>>> +
>>> +        interrupt-parent = <&tlmm>;
>>> +        interrupts = <33 IRQ_TYPE_EDGE_RISING>;
>>> +      };
>>
>> These two pmics are exactly the same (except compatible), so just keep
>> one example... unless both are coming from the same, real DTS?
> 
> It was mainly to exercise the fallback, but it's useless as-is so I'll remove in v3.

No need to test different compatibles.

Best regards,
Krzysztof