[v2,12/15] arm64: dts: qcom: sa8775p: pmic: add thermal zones

Message ID 20230320154841.327908-13-brgl@bgdev.pl
State New
Headers
Series arm64: dts: qcom: sa8775p: add basic PMIC support |

Commit Message

Bartosz Golaszewski March 20, 2023, 3:48 p.m. UTC
  From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Add the thermal zones and associated alarm nodes for the PMICs that have
them hooked up on sa8775p-ride.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi | 58 +++++++++++++++++++++
 1 file changed, 58 insertions(+)
  

Comments

Konrad Dybcio March 20, 2023, 5:28 p.m. UTC | #1
On 20.03.2023 16:48, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> Add the thermal zones and associated alarm nodes for the PMICs that have
> them hooked up on sa8775p-ride.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi | 58 +++++++++++++++++++++
>  1 file changed, 58 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi b/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi
> index 8616ead3daf5..276070b62ccd 100644
> --- a/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi
> @@ -6,6 +6,50 @@
>  #include <dt-bindings/input/input.h>
>  #include <dt-bindings/spmi/spmi.h>
>  
> +/ {
> +	thermal-zones {
> +		pmm8654au_1_thermal: pm8775-1-thermal {
Please reindex this, downstream uses _1 for pmic@0, but this
makes little sense. Make it match the SID.

> +			polling-delay-passive = <100>;
> +			polling-delay = <0>;
> +			thermal-sensors = <&pmm8654au_1_temp_alarm>;
> +
> +			trips {
> +				trip0 {
> +					temperature = <105000>;
> +					hysteresis = <0>;
> +					type = "passive";
> +				};
> +
> +				trip1 {
> +					temperature = <125000>;
> +					hysteresis = <0>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +
What happened to the downstream _2 (pmic@2) one and _4 (pmic@6)?

Konrad

> +		pmm8654au_3_thermal: pm8775-3-thermal {
> +			polling-delay-passive = <100>;
> +			polling-delay = <0>;
> +			thermal-sensors = <&pmm8654au_3_temp_alarm>;
> +
> +			trips {
> +				trip0 {
> +					temperature = <105000>;
> +					hysteresis = <0>;
> +					type = "passive";
> +				};
> +
> +				trip1 {
> +					temperature = <125000>;
> +					hysteresis = <0>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +	};
> +};
> +
>  &spmi_bus {
>  	pmm8654au_0: pmic@0 {
>  		compatible = "qcom,pmm8654au", "qcom,spmi-pmic";
> @@ -41,6 +85,13 @@ pmm8654au_1: pmic@2 {
>  		reg = <0x2 SPMI_USID>;
>  		#address-cells = <1>;
>  		#size-cells = <0>;
> +
> +		pmm8654au_1_temp_alarm: temp-alarm@a00 {
> +			compatible = "qcom,spmi-temp-alarm";
> +			reg = <0xa00>;
> +			interrupts-extended = <&spmi_bus 0x2 0xa 0x0 IRQ_TYPE_EDGE_BOTH>;
> +			#thermal-sensor-cells = <0>;
> +		};
>  	};
>  
>  	pmm8654au_2: pmic@4 {
> @@ -55,5 +106,12 @@ pmm8654au_3: pmic@6 {
>  		reg = <0x6 SPMI_USID>;
>  		#address-cells = <1>;
>  		#size-cells = <0>;
> +
> +		pmm8654au_3_temp_alarm: temp-alarm@a00 {
> +			compatible = "qcom,spmi-temp-alarm";
> +			reg = <0xa00>;
> +			interrupts-extended = <&spmi_bus 0x6 0xa 0x0 IRQ_TYPE_EDGE_BOTH>;
> +			#thermal-sensor-cells = <0>;
> +		};
>  	};
>  };
  
Bjorn Andersson March 22, 2023, 2:50 a.m. UTC | #2
On Mon, Mar 20, 2023 at 06:28:20PM +0100, Konrad Dybcio wrote:
> 
> 
> On 20.03.2023 16:48, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > 
> > Add the thermal zones and associated alarm nodes for the PMICs that have
> > them hooked up on sa8775p-ride.
> > 
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > ---
> >  arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi | 58 +++++++++++++++++++++
> >  1 file changed, 58 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi b/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi
> > index 8616ead3daf5..276070b62ccd 100644
> > --- a/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi
> > @@ -6,6 +6,50 @@
> >  #include <dt-bindings/input/input.h>
> >  #include <dt-bindings/spmi/spmi.h>
> >  
> > +/ {
> > +	thermal-zones {
> > +		pmm8654au_1_thermal: pm8775-1-thermal {
> Please reindex this, downstream uses _1 for pmic@0, but this
> makes little sense. Make it match the SID.
> 

Please use the naming from the schematics for these things, rather than
just an iterator (which might be what Bartosz is doing here).

Regards,
Bjorn

> > +			polling-delay-passive = <100>;
> > +			polling-delay = <0>;
> > +			thermal-sensors = <&pmm8654au_1_temp_alarm>;
> > +
> > +			trips {
> > +				trip0 {
> > +					temperature = <105000>;
> > +					hysteresis = <0>;
> > +					type = "passive";
> > +				};
> > +
> > +				trip1 {
> > +					temperature = <125000>;
> > +					hysteresis = <0>;
> > +					type = "critical";
> > +				};
> > +			};
> > +		};
> > +
> What happened to the downstream _2 (pmic@2) one and _4 (pmic@6)?
> 
> Konrad
> 
> > +		pmm8654au_3_thermal: pm8775-3-thermal {
> > +			polling-delay-passive = <100>;
> > +			polling-delay = <0>;
> > +			thermal-sensors = <&pmm8654au_3_temp_alarm>;
> > +
> > +			trips {
> > +				trip0 {
> > +					temperature = <105000>;
> > +					hysteresis = <0>;
> > +					type = "passive";
> > +				};
> > +
> > +				trip1 {
> > +					temperature = <125000>;
> > +					hysteresis = <0>;
> > +					type = "critical";
> > +				};
> > +			};
> > +		};
> > +	};
> > +};
> > +
> >  &spmi_bus {
> >  	pmm8654au_0: pmic@0 {
> >  		compatible = "qcom,pmm8654au", "qcom,spmi-pmic";
> > @@ -41,6 +85,13 @@ pmm8654au_1: pmic@2 {
> >  		reg = <0x2 SPMI_USID>;
> >  		#address-cells = <1>;
> >  		#size-cells = <0>;
> > +
> > +		pmm8654au_1_temp_alarm: temp-alarm@a00 {
> > +			compatible = "qcom,spmi-temp-alarm";
> > +			reg = <0xa00>;
> > +			interrupts-extended = <&spmi_bus 0x2 0xa 0x0 IRQ_TYPE_EDGE_BOTH>;
> > +			#thermal-sensor-cells = <0>;
> > +		};
> >  	};
> >  
> >  	pmm8654au_2: pmic@4 {
> > @@ -55,5 +106,12 @@ pmm8654au_3: pmic@6 {
> >  		reg = <0x6 SPMI_USID>;
> >  		#address-cells = <1>;
> >  		#size-cells = <0>;
> > +
> > +		pmm8654au_3_temp_alarm: temp-alarm@a00 {
> > +			compatible = "qcom,spmi-temp-alarm";
> > +			reg = <0xa00>;
> > +			interrupts-extended = <&spmi_bus 0x6 0xa 0x0 IRQ_TYPE_EDGE_BOTH>;
> > +			#thermal-sensor-cells = <0>;
> > +		};
> >  	};
> >  };
  
Bartosz Golaszewski March 22, 2023, 3:30 p.m. UTC | #3
On Wed, Mar 22, 2023 at 3:47 AM Bjorn Andersson <andersson@kernel.org> wrote:
>
> On Mon, Mar 20, 2023 at 06:28:20PM +0100, Konrad Dybcio wrote:
> >
> >
> > On 20.03.2023 16:48, Bartosz Golaszewski wrote:
> > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > >
> > > Add the thermal zones and associated alarm nodes for the PMICs that have
> > > them hooked up on sa8775p-ride.
> > >
> > > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > > ---
> > >  arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi | 58 +++++++++++++++++++++
> > >  1 file changed, 58 insertions(+)
> > >
> > > diff --git a/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi b/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi
> > > index 8616ead3daf5..276070b62ccd 100644
> > > --- a/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi
> > > +++ b/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi
> > > @@ -6,6 +6,50 @@
> > >  #include <dt-bindings/input/input.h>
> > >  #include <dt-bindings/spmi/spmi.h>
> > >
> > > +/ {
> > > +   thermal-zones {
> > > +           pmm8654au_1_thermal: pm8775-1-thermal {
> > Please reindex this, downstream uses _1 for pmic@0, but this
> > makes little sense. Make it match the SID.
> >
>
> Please use the naming from the schematics for these things, rather than
> just an iterator (which might be what Bartosz is doing here).
>

Not sure how to approach that. All currently existing
"qcom,spmi-temp-alarm" nodes use the PMIC name for the label.
Otherwise it would have to go into the board file and be replicated
for each board using the same PMIC?

Bart

> Regards,
> Bjorn
>
> > > +                   polling-delay-passive = <100>;
> > > +                   polling-delay = <0>;
> > > +                   thermal-sensors = <&pmm8654au_1_temp_alarm>;
> > > +
> > > +                   trips {
> > > +                           trip0 {
> > > +                                   temperature = <105000>;
> > > +                                   hysteresis = <0>;
> > > +                                   type = "passive";
> > > +                           };
> > > +
> > > +                           trip1 {
> > > +                                   temperature = <125000>;
> > > +                                   hysteresis = <0>;
> > > +                                   type = "critical";
> > > +                           };
> > > +                   };
> > > +           };
> > > +
> > What happened to the downstream _2 (pmic@2) one and _4 (pmic@6)?
> >
> > Konrad
> >
> > > +           pmm8654au_3_thermal: pm8775-3-thermal {
> > > +                   polling-delay-passive = <100>;
> > > +                   polling-delay = <0>;
> > > +                   thermal-sensors = <&pmm8654au_3_temp_alarm>;
> > > +
> > > +                   trips {
> > > +                           trip0 {
> > > +                                   temperature = <105000>;
> > > +                                   hysteresis = <0>;
> > > +                                   type = "passive";
> > > +                           };
> > > +
> > > +                           trip1 {
> > > +                                   temperature = <125000>;
> > > +                                   hysteresis = <0>;
> > > +                                   type = "critical";
> > > +                           };
> > > +                   };
> > > +           };
> > > +   };
> > > +};
> > > +
> > >  &spmi_bus {
> > >     pmm8654au_0: pmic@0 {
> > >             compatible = "qcom,pmm8654au", "qcom,spmi-pmic";
> > > @@ -41,6 +85,13 @@ pmm8654au_1: pmic@2 {
> > >             reg = <0x2 SPMI_USID>;
> > >             #address-cells = <1>;
> > >             #size-cells = <0>;
> > > +
> > > +           pmm8654au_1_temp_alarm: temp-alarm@a00 {
> > > +                   compatible = "qcom,spmi-temp-alarm";
> > > +                   reg = <0xa00>;
> > > +                   interrupts-extended = <&spmi_bus 0x2 0xa 0x0 IRQ_TYPE_EDGE_BOTH>;
> > > +                   #thermal-sensor-cells = <0>;
> > > +           };
> > >     };
> > >
> > >     pmm8654au_2: pmic@4 {
> > > @@ -55,5 +106,12 @@ pmm8654au_3: pmic@6 {
> > >             reg = <0x6 SPMI_USID>;
> > >             #address-cells = <1>;
> > >             #size-cells = <0>;
> > > +
> > > +           pmm8654au_3_temp_alarm: temp-alarm@a00 {
> > > +                   compatible = "qcom,spmi-temp-alarm";
> > > +                   reg = <0xa00>;
> > > +                   interrupts-extended = <&spmi_bus 0x6 0xa 0x0 IRQ_TYPE_EDGE_BOTH>;
> > > +                   #thermal-sensor-cells = <0>;
> > > +           };
> > >     };
> > >  };
  

Patch

diff --git a/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi b/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi
index 8616ead3daf5..276070b62ccd 100644
--- a/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi
+++ b/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi
@@ -6,6 +6,50 @@ 
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/spmi/spmi.h>
 
+/ {
+	thermal-zones {
+		pmm8654au_1_thermal: pm8775-1-thermal {
+			polling-delay-passive = <100>;
+			polling-delay = <0>;
+			thermal-sensors = <&pmm8654au_1_temp_alarm>;
+
+			trips {
+				trip0 {
+					temperature = <105000>;
+					hysteresis = <0>;
+					type = "passive";
+				};
+
+				trip1 {
+					temperature = <125000>;
+					hysteresis = <0>;
+					type = "critical";
+				};
+			};
+		};
+
+		pmm8654au_3_thermal: pm8775-3-thermal {
+			polling-delay-passive = <100>;
+			polling-delay = <0>;
+			thermal-sensors = <&pmm8654au_3_temp_alarm>;
+
+			trips {
+				trip0 {
+					temperature = <105000>;
+					hysteresis = <0>;
+					type = "passive";
+				};
+
+				trip1 {
+					temperature = <125000>;
+					hysteresis = <0>;
+					type = "critical";
+				};
+			};
+		};
+	};
+};
+
 &spmi_bus {
 	pmm8654au_0: pmic@0 {
 		compatible = "qcom,pmm8654au", "qcom,spmi-pmic";
@@ -41,6 +85,13 @@  pmm8654au_1: pmic@2 {
 		reg = <0x2 SPMI_USID>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+
+		pmm8654au_1_temp_alarm: temp-alarm@a00 {
+			compatible = "qcom,spmi-temp-alarm";
+			reg = <0xa00>;
+			interrupts-extended = <&spmi_bus 0x2 0xa 0x0 IRQ_TYPE_EDGE_BOTH>;
+			#thermal-sensor-cells = <0>;
+		};
 	};
 
 	pmm8654au_2: pmic@4 {
@@ -55,5 +106,12 @@  pmm8654au_3: pmic@6 {
 		reg = <0x6 SPMI_USID>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+
+		pmm8654au_3_temp_alarm: temp-alarm@a00 {
+			compatible = "qcom,spmi-temp-alarm";
+			reg = <0xa00>;
+			interrupts-extended = <&spmi_bus 0x6 0xa 0x0 IRQ_TYPE_EDGE_BOTH>;
+			#thermal-sensor-cells = <0>;
+		};
 	};
 };