[PATCH 2/5] dt-bindings: qcom,spmi-temp-alarm: Add compatible for lite temp alarm

Anjelique Melendez posted 5 patches 1 year, 4 months ago
There is a newer version of this series
[PATCH 2/5] dt-bindings: qcom,spmi-temp-alarm: Add compatible for lite temp alarm
Posted by Anjelique Melendez 1 year, 4 months ago
Add compatible "qcom,spmi-temp-alarm-lite" for Temp alarm lite
peripherals. Temp alarm lite peripherals have two stages: warning and
shutdown, and use a pair of registers to configure warning interrupt
threshold temperature and an automatic hardware shutdown threshold
temperature.

When defining thermal zone trips for a temp alarm lite device the first
thermal zone trip is for warning alarm IRQ in HW, the second thermal
zone trip is purely for software to perform a controlled shutdown (no HW
support) and the third thermal zone trip is for automatic hardware
shutdown.

Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
---
 .../thermal/qcom,spmi-temp-alarm.yaml         | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/Documentation/devicetree/bindings/thermal/qcom,spmi-temp-alarm.yaml b/Documentation/devicetree/bindings/thermal/qcom,spmi-temp-alarm.yaml
index f9af88d51c2d..bbf201cad16b 100644
--- a/Documentation/devicetree/bindings/thermal/qcom,spmi-temp-alarm.yaml
+++ b/Documentation/devicetree/bindings/thermal/qcom,spmi-temp-alarm.yaml
@@ -22,6 +22,7 @@ properties:
     enum:
       - qcom,spmi-temp-alarm
       - qcom,spmi-temp-alarm-gen2-rev2
+      - qcom,spmi-temp-alarm-lite
 
   reg:
     maxItems: 1
@@ -84,3 +85,46 @@ examples:
             };
         };
     };
+
+  - |
+
+    pmic {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        pm8550b_lite_tz: pm8550b-temp-alarm-lite@c00 {
+            compatible = "qcom,spmi-temp-alarm-lite";
+            reg = <0xc00>;
+            interrupts = <0x1 0xa 0x0 IRQ_TYPE_EDGE_BOTH>;
+            #thermal-sensor-cells = <0>;
+        };
+    };
+
+    thermal-zones {
+        pm8550b_lite_temp_alarm: pm8550blite-thermal {
+            polling-delay-passive = <100>;
+            polling-delay = <0>;
+            thermal-sensors = <&pm8550b_lite_tz>;
+
+            trips {
+                pm8550b_lite_trip0: trip0 {
+                    temperature = <125000>;
+                    hysteresis = <0>;
+                    type = "passive";
+                };
+
+                pm8550b_lite_trip1: trip1 {
+                    temperature = <135000>;
+                    hysteresis = <0>;
+                    type = "passive";
+                };
+
+                trip2 {
+                    temperature = <145000>;
+                    hysteresis = <0>;
+                    type = "critical";
+                };
+
+            };
+        };
+    };
-- 
2.34.1
Re: [PATCH 2/5] dt-bindings: qcom,spmi-temp-alarm: Add compatible for lite temp alarm
Posted by Krzysztof Kozlowski 1 year, 4 months ago
On 30/07/2024 01:12, Anjelique Melendez wrote:
> Add compatible "qcom,spmi-temp-alarm-lite" for Temp alarm lite
> peripherals. Temp alarm lite peripherals have two stages: warning and
> shutdown, and use a pair of registers to configure warning interrupt
> threshold temperature and an automatic hardware shutdown threshold
> temperature.
> 
> When defining thermal zone trips for a temp alarm lite device the first
> thermal zone trip is for warning alarm IRQ in HW, the second thermal
> zone trip is purely for software to perform a controlled shutdown (no HW
> support) and the third thermal zone trip is for automatic hardware
> shutdown.
> 
> Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
> ---
>  .../thermal/qcom,spmi-temp-alarm.yaml         | 44 +++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/thermal/qcom,spmi-temp-alarm.yaml b/Documentation/devicetree/bindings/thermal/qcom,spmi-temp-alarm.yaml
> index f9af88d51c2d..bbf201cad16b 100644
> --- a/Documentation/devicetree/bindings/thermal/qcom,spmi-temp-alarm.yaml
> +++ b/Documentation/devicetree/bindings/thermal/qcom,spmi-temp-alarm.yaml
> @@ -22,6 +22,7 @@ properties:
>      enum:
>        - qcom,spmi-temp-alarm
>        - qcom,spmi-temp-alarm-gen2-rev2
> +      - qcom,spmi-temp-alarm-lite

Uhu, it's growing, now we have "lite". No, this is way too ambiguous.

NAK. Use PMIC compatibles.

>  
>    reg:
>      maxItems: 1
> @@ -84,3 +85,46 @@ examples:
>              };
>          };
>      };
> +
> +  - |
> +
> +    pmic {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        pm8550b_lite_tz: pm8550b-temp-alarm-lite@c00 {

There is no difference in this example, drop.

> +            compatible = "qcom,spmi-temp-alarm-lite";
> +            reg = <0xc00>;
> +            interrupts = <0x1 0xa 0x0 IRQ_TYPE_EDGE_BOTH>;
> +            #thermal-sensor-cells = <0>;
> +        };
> +    };
> +
> +    thermal-zones {
> +        pm8550b_lite_temp_alarm: pm8550blite-thermal {

Drop as well.


Best regards,
Krzysztof