[V13,3/4] dt-bindings: mfd: qcom,tcsr: Add simple-mfd support for IPQ6018

Message ID 20231004090449.256229-4-quic_devipriy@quicinc.com
State New
Headers
Series Add PWM support for IPQ chipsets |

Commit Message

Devi Priya Oct. 4, 2023, 9:04 a.m. UTC
  Update the binding to include pwm as the child node to TCSR block and
add simple-mfd support for IPQ6018.

Signed-off-by: Devi Priya <quic_devipriy@quicinc.com>
---
V13:

 Added simple-mfd support for IPQ6018 based devices

 Added support to include pwm as the child node to TCSR

 Included syscon node found on IPQ6018 to the examples

 .../devicetree/bindings/mfd/qcom,tcsr.yaml    | 100 ++++++++++++------
 1 file changed, 69 insertions(+), 31 deletions(-)
  

Comments

Krzysztof Kozlowski Oct. 4, 2023, 9:20 a.m. UTC | #1
On 04/10/2023 11:04, Devi Priya wrote:
> Update the binding to include pwm as the child node to TCSR block and
> add simple-mfd support for IPQ6018.
> 
> Signed-off-by: Devi Priya <quic_devipriy@quicinc.com>
> ---

Thank you for your patch. There is something to discuss/improve.


>    reg:
>      maxItems: 1
>  
> +  ranges: true
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 1
> +
> +patternProperties:
> +  "pwm@[a-f0-9]+$":

type: object

> +    $ref: ../pwm/qcom,ipq6018-pwm.yaml

This should be full patch, so:
$ref: /schemas/pwm/qcom.......


> +
>  required:
>    - compatible
>    - reg

After required (but before additionalProperties), please add:

allOf:if:then: for other compatible (so use keyword "not:") which will
disallow pwm for them. Disallowing is via:

    patternProperties:
      "pwm@[a-f0-9]+$": false

See   Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml
around line 240. We need something similar.


> @@ -57,8 +74,29 @@ required:
>  additionalProperties: false
>  
>  examples:
> +  # Example 1 - Syscon node found on MSM8960
>    - |
>      syscon@1a400000 {
>          compatible = "qcom,tcsr-msm8960", "syscon";
>          reg = <0x1a400000 0x100>;
>      };
> +  # Example 2 - Syscon node found on IPQ6018
> +  - |
> +    #include <dt-bindings/clock/qcom,gcc-ipq6018.h>
> +
> +    syscon@1937000 {
> +        compatible = "qcom,tcsr-ipq6018", "syscon", "simple-mfd";
> +        reg = <0x01937000 0x21000>;
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +        ranges = <0 0x1937000 0x21000>;

Please put ranges just after reg.

> +
> +        pwm: pwm@a010 {
> +            compatible = "qcom,ipq6018-pwm";
> +            reg = <0xa010 0x20>;

Best regards,
Krzysztof
  
Devi Priya Oct. 4, 2023, 9:23 a.m. UTC | #2
On 10/4/2023 2:50 PM, Krzysztof Kozlowski wrote:
> On 04/10/2023 11:04, Devi Priya wrote:
>> Update the binding to include pwm as the child node to TCSR block and
>> add simple-mfd support for IPQ6018.
>>
>> Signed-off-by: Devi Priya <quic_devipriy@quicinc.com>
>> ---
> 
> Thank you for your patch. There is something to discuss/improve.
> 
> 
>>     reg:
>>       maxItems: 1
>>   
>> +  ranges: true
>> +
>> +  "#address-cells":
>> +    const: 1
>> +
>> +  "#size-cells":
>> +    const: 1
>> +
>> +patternProperties:
>> +  "pwm@[a-f0-9]+$":
> 
> type: object
Okay
> 
>> +    $ref: ../pwm/qcom,ipq6018-pwm.yaml
> 
> This should be full patch, so:
> $ref: /schemas/pwm/qcom.......
okay
> 
> 
>> +
>>   required:
>>     - compatible
>>     - reg
> 
> After required (but before additionalProperties), please add:
> 
> allOf:if:then: for other compatible (so use keyword "not:") which will
> disallow pwm for them. Disallowing is via:
> 
>      patternProperties:
>        "pwm@[a-f0-9]+$": false
> 
> See   Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml
> around line 240. We need something similar.
Sure, will add!
> 
> 
>> @@ -57,8 +74,29 @@ required:
>>   additionalProperties: false
>>   
>>   examples:
>> +  # Example 1 - Syscon node found on MSM8960
>>     - |
>>       syscon@1a400000 {
>>           compatible = "qcom,tcsr-msm8960", "syscon";
>>           reg = <0x1a400000 0x100>;
>>       };
>> +  # Example 2 - Syscon node found on IPQ6018
>> +  - |
>> +    #include <dt-bindings/clock/qcom,gcc-ipq6018.h>
>> +
>> +    syscon@1937000 {
>> +        compatible = "qcom,tcsr-ipq6018", "syscon", "simple-mfd";
>> +        reg = <0x01937000 0x21000>;
>> +        #address-cells = <1>;
>> +        #size-cells = <1>;
>> +        ranges = <0 0x1937000 0x21000>;
> 
> Please put ranges just after reg.
Sure,okay

Thanks,
Devi Priya
> 
>> +
>> +        pwm: pwm@a010 {
>> +            compatible = "qcom,ipq6018-pwm";
>> +            reg = <0xa010 0x20>;
> 
> Best regards,
> Krzysztof
>
  

Patch

diff --git a/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml b/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
index 33c3d023a106..14267a493b15 100644
--- a/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
+++ b/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
@@ -15,41 +15,58 @@  description:
 
 properties:
   compatible:
-    items:
-      - enum:
-          - qcom,msm8976-tcsr
-          - qcom,msm8998-tcsr
-          - qcom,qcs404-tcsr
-          - qcom,sc7180-tcsr
-          - qcom,sc7280-tcsr
-          - qcom,sc8280xp-tcsr
-          - qcom,sdm630-tcsr
-          - qcom,sdm845-tcsr
-          - qcom,sdx55-tcsr
-          - qcom,sdx65-tcsr
-          - qcom,sm4450-tcsr
-          - qcom,sm8150-tcsr
-          - qcom,sm8450-tcsr
-          - qcom,tcsr-apq8064
-          - qcom,tcsr-apq8084
-          - qcom,tcsr-ipq5332
-          - qcom,tcsr-ipq6018
-          - qcom,tcsr-ipq8064
-          - qcom,tcsr-ipq8074
-          - qcom,tcsr-ipq9574
-          - qcom,tcsr-mdm9615
-          - qcom,tcsr-msm8226
-          - qcom,tcsr-msm8660
-          - qcom,tcsr-msm8916
-          - qcom,tcsr-msm8953
-          - qcom,tcsr-msm8960
-          - qcom,tcsr-msm8974
-          - qcom,tcsr-msm8996
-      - const: syscon
+    oneOf:
+      - items:
+          - enum:
+              - qcom,msm8976-tcsr
+              - qcom,msm8998-tcsr
+              - qcom,qcs404-tcsr
+              - qcom,sc7180-tcsr
+              - qcom,sc7280-tcsr
+              - qcom,sc8280xp-tcsr
+              - qcom,sdm630-tcsr
+              - qcom,sdm845-tcsr
+              - qcom,sdx55-tcsr
+              - qcom,sdx65-tcsr
+              - qcom,sm4450-tcsr
+              - qcom,sm8150-tcsr
+              - qcom,sm8450-tcsr
+              - qcom,tcsr-apq8064
+              - qcom,tcsr-apq8084
+              - qcom,tcsr-ipq5332
+              - qcom,tcsr-ipq6018
+              - qcom,tcsr-ipq8064
+              - qcom,tcsr-ipq8074
+              - qcom,tcsr-ipq9574
+              - qcom,tcsr-mdm9615
+              - qcom,tcsr-msm8226
+              - qcom,tcsr-msm8660
+              - qcom,tcsr-msm8916
+              - qcom,tcsr-msm8953
+              - qcom,tcsr-msm8960
+              - qcom,tcsr-msm8974
+              - qcom,tcsr-msm8996
+          - const: syscon
+      - items:
+          - const: qcom,tcsr-ipq6018
+          - const: syscon
+          - const: simple-mfd
 
   reg:
     maxItems: 1
 
+  ranges: true
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 1
+
+patternProperties:
+  "pwm@[a-f0-9]+$":
+    $ref: ../pwm/qcom,ipq6018-pwm.yaml
+
 required:
   - compatible
   - reg
@@ -57,8 +74,29 @@  required:
 additionalProperties: false
 
 examples:
+  # Example 1 - Syscon node found on MSM8960
   - |
     syscon@1a400000 {
         compatible = "qcom,tcsr-msm8960", "syscon";
         reg = <0x1a400000 0x100>;
     };
+  # Example 2 - Syscon node found on IPQ6018
+  - |
+    #include <dt-bindings/clock/qcom,gcc-ipq6018.h>
+
+    syscon@1937000 {
+        compatible = "qcom,tcsr-ipq6018", "syscon", "simple-mfd";
+        reg = <0x01937000 0x21000>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0 0x1937000 0x21000>;
+
+        pwm: pwm@a010 {
+            compatible = "qcom,ipq6018-pwm";
+            reg = <0xa010 0x20>;
+            clocks = <&gcc GCC_ADSS_PWM_CLK>;
+            assigned-clocks = <&gcc GCC_ADSS_PWM_CLK>;
+            assigned-clock-rates = <100000000>;
+            #pwm-cells = <2>;
+        };
+    };