linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] dt-bindings: thermal: tsens: Add ipq8074 compatible
@ 2022-04-30 20:50 Robert Marko
  2022-04-30 20:50 ` [PATCH 2/5] drivers: thermal: tsens: Add support for combined interrupt Robert Marko
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Robert Marko @ 2022-04-30 20:50 UTC (permalink / raw)
  To: agross, bjorn.andersson, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel
  Cc: Robert Marko

Qualcomm IPQ8074 has tsens v2.3.0 block, though unlike existing v2 IP it
only uses one IRQ, so tsens v2 compatible cannot be used as the fallback.

We also have to make sure that correct interrupts are set according to
compatibles, so populate interrupt information per compatibles.

Signed-off-by: Robert Marko <robimarko@gmail.com>
---
 .../bindings/thermal/qcom-tsens.yaml          | 79 ++++++++++++++++---
 1 file changed, 68 insertions(+), 11 deletions(-)

diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
index b6406bcc683f..44ebdfd4560a 100644
--- a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
+++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
@@ -56,22 +56,19 @@ properties:
               - qcom,sm8350-tsens
           - const: qcom,tsens-v2
 
+      - description: v2 of TSENS with combined interrupt
+        items:
+          - enum:
+              - qcom,ipq8074-tsens
+
   reg:
     items:
       - description: TM registers
       - description: SROT registers
 
-  interrupts:
-    minItems: 1
-    items:
-      - description: Combined interrupt if upper or lower threshold crossed
-      - description: Interrupt if critical threshold crossed
+  interrupts: true
 
-  interrupt-names:
-    minItems: 1
-    items:
-      - const: uplow
-      - const: critical
+  interrupt-names: true
 
   nvmem-cells:
     minItems: 1
@@ -125,21 +122,66 @@ allOf:
       properties:
         interrupts:
           maxItems: 1
+          items:
+            - description: Combined interrupt if upper or lower threshold crossed
         interrupt-names:
           maxItems: 1
+          items:
+            - const: uplow
 
-    else:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,msm8953-tsens
+              - qcom,msm8996-tsens
+              - qcom,msm8998-tsens
+              - qcom,sc7180-tsens
+              - qcom,sc7280-tsens
+              - qcom,sc8180x-tsens
+              - qcom,sdm630-tsens
+              - qcom,sdm845-tsens
+              - qcom,sm8150-tsens
+              - qcom,sm8250-tsens
+              - qcom,sm8350-tsens
+              - qcom,tsens-v2
+    then:
       properties:
         interrupts:
           minItems: 2
+          items:
+            - description: Combined interrupt if upper or lower threshold crossed
+            - description: Interrupt if critical threshold crossed
         interrupt-names:
           minItems: 2
+          items:
+            - const: uplow
+            - const: critical
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,ipq8074-tsens
+    then:
+      properties:
+        interrupts:
+          maxItems: 1
+          items:
+            - description: Combined interrupt if upper, lower or critical thresholds crossed
+        interrupt-names:
+          maxItems: 1
+          items:
+            - const: combined
 
   - if:
       properties:
         compatible:
           contains:
             enum:
+              - qcom,ipq8074-tsens
               - qcom,tsens-v0_1
               - qcom,tsens-v1
               - qcom,tsens-v2
@@ -222,4 +264,19 @@ examples:
            #qcom,sensors = <13>;
            #thermal-sensor-cells = <1>;
     };
+
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    // Example 4 (for any IPQ8074 based SoC-s):
+    tsens4: thermal-sensor@4a9000 {
+           compatible = "qcom,ipq8074-tsens";
+           reg = <0x4a9000 0x1000>,
+                 <0x4a8000 0x1000>;
+
+           interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
+           interrupt-names = "combined";
+
+           #qcom,sensors = <16>;
+           #thermal-sensor-cells = <1>;
+    };
 ...
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-01  8:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-30 20:50 [PATCH 1/5] dt-bindings: thermal: tsens: Add ipq8074 compatible Robert Marko
2022-04-30 20:50 ` [PATCH 2/5] drivers: thermal: tsens: Add support for combined interrupt Robert Marko
2022-04-30 20:50 ` [PATCH 3/5] drivers: thermal: tsens: allow configuring min and max trips Robert Marko
2022-04-30 20:51 ` [PATCH 4/5] drivers: thermal: tsens: add IPQ8074 support Robert Marko
2022-04-30 20:51 ` [PATCH 5/5] arm64: dts: ipq8074: add thermal nodes Robert Marko
2022-05-01  8:33 ` [PATCH 1/5] dt-bindings: thermal: tsens: Add ipq8074 compatible Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).