diff mbox series

[09/11] arm64: dts: qcom: sc8280xp-x13s: Add PM8280_{1/2} VADC channels

Message ID 20221027063006.9056-10-manivannan.sadhasivam@linaro.org
State Superseded
Headers show
Series Updates to sc8280xp-pmic | expand

Commit Message

Manivannan Sadhasivam Oct. 27, 2022, 6:30 a.m. UTC
Add VADC channels of PM8280_{1/2} PMICs for measuring the on-chip die
temperature and external thermistors connected to the AMUX pins.

The measurements are collected by the primary PMIC PMK8280 from the
slave PMICs PM8280_{1/2} and exposed them over the PMK8280's VADC
channels.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    | 61 +++++++++++++++++++
 1 file changed, 61 insertions(+)

Comments

Krzysztof Kozlowski Oct. 27, 2022, 2:09 p.m. UTC | #1
On 27/10/2022 02:30, Manivannan Sadhasivam wrote:
> Add VADC channels of PM8280_{1/2} PMICs for measuring the on-chip die
> temperature and external thermistors connected to the AMUX pins.
> 
> The measurements are collected by the primary PMIC PMK8280 from the
> slave PMICs PM8280_{1/2} and exposed them over the PMK8280's VADC

secondary PMICs

Drop "them"


> channels.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>  .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    | 61 +++++++++++++++++++
>  1 file changed, 61 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> index 9ac5d5c22832..d300d217fdc6 100644
> --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> @@ -7,6 +7,7 @@
>  /dts-v1/;
>  
>  #include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/iio/qcom,spmi-adc7-pm8350.h>
>  #include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
>  #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
>  
> @@ -189,6 +190,66 @@ pmk8280-xo-therm@44 {
>  		qcom,ratiometric;
>  		qcom,hw-settle-time = <200>;
>  	};
> +
> +	pm8280-1-die-temp@103 {

pmic-die-temp? What pm8280 stands here?


> +		reg = <PM8350_ADC7_DIE_TEMP(1)>;
> +		label = "pm8280_1_die_temp";
> +		qcom,pre-scaling = <1 1>;
> +	};
> +
> +	sys-therm1@144 {

I would say sys-therm@... why do we need the "1" suffix in node name?

> +		reg = <PM8350_ADC7_AMUX_THM1_100K_PU(1)>;
> +		qcom,ratiometric;
> +		qcom,hw-settle-time = <200>;
> +	};

Best regards,
Krzysztof
Manivannan Sadhasivam Oct. 29, 2022, 4:48 a.m. UTC | #2
On Thu, Oct 27, 2022 at 10:09:21AM -0400, Krzysztof Kozlowski wrote:
> On 27/10/2022 02:30, Manivannan Sadhasivam wrote:
> > Add VADC channels of PM8280_{1/2} PMICs for measuring the on-chip die
> > temperature and external thermistors connected to the AMUX pins.
> > 
> > The measurements are collected by the primary PMIC PMK8280 from the
> > slave PMICs PM8280_{1/2} and exposed them over the PMK8280's VADC
> 
> secondary PMICs
> 
> Drop "them"
> 
> 
> > channels.
> > 
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > ---
> >  .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    | 61 +++++++++++++++++++
> >  1 file changed, 61 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> > index 9ac5d5c22832..d300d217fdc6 100644
> > --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> > +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> > @@ -7,6 +7,7 @@
> >  /dts-v1/;
> >  
> >  #include <dt-bindings/gpio/gpio.h>
> > +#include <dt-bindings/iio/qcom,spmi-adc7-pm8350.h>
> >  #include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
> >  #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
> >  
> > @@ -189,6 +190,66 @@ pmk8280-xo-therm@44 {
> >  		qcom,ratiometric;
> >  		qcom,hw-settle-time = <200>;
> >  	};
> > +
> > +	pm8280-1-die-temp@103 {
> 
> pmic-die-temp? What pm8280 stands here?
> 

As agreed, will use "pmic-die-temp"

> 
> > +		reg = <PM8350_ADC7_DIE_TEMP(1)>;
> > +		label = "pm8280_1_die_temp";
> > +		qcom,pre-scaling = <1 1>;
> > +	};
> > +
> > +	sys-therm1@144 {
> 
> I would say sys-therm@... why do we need the "1" suffix in node name?
> 

Suffix represents the index of the thermistor as per the schematics but I guess
it can be dropped.

Thanks,
Mani

> > +		reg = <PM8350_ADC7_AMUX_THM1_100K_PU(1)>;
> > +		qcom,ratiometric;
> > +		qcom,hw-settle-time = <200>;
> > +	};
> 
> Best regards,
> Krzysztof
>
Manivannan Sadhasivam Oct. 30, 2022, 7:16 a.m. UTC | #3
On Sat, Oct 29, 2022 at 10:18:37AM +0530, Manivannan Sadhasivam wrote:
> On Thu, Oct 27, 2022 at 10:09:21AM -0400, Krzysztof Kozlowski wrote:
> > On 27/10/2022 02:30, Manivannan Sadhasivam wrote:
> > > Add VADC channels of PM8280_{1/2} PMICs for measuring the on-chip die
> > > temperature and external thermistors connected to the AMUX pins.
> > > 
> > > The measurements are collected by the primary PMIC PMK8280 from the
> > > slave PMICs PM8280_{1/2} and exposed them over the PMK8280's VADC
> > 
> > secondary PMICs
> > 
> > Drop "them"
> > 
> > 
> > > channels.
> > > 
> > > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > > ---
> > >  .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    | 61 +++++++++++++++++++
> > >  1 file changed, 61 insertions(+)
> > > 
> > > diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> > > index 9ac5d5c22832..d300d217fdc6 100644
> > > --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> > > +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> > > @@ -7,6 +7,7 @@
> > >  /dts-v1/;
> > >  
> > >  #include <dt-bindings/gpio/gpio.h>
> > > +#include <dt-bindings/iio/qcom,spmi-adc7-pm8350.h>
> > >  #include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
> > >  #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
> > >  
> > > @@ -189,6 +190,66 @@ pmk8280-xo-therm@44 {
> > >  		qcom,ratiometric;
> > >  		qcom,hw-settle-time = <200>;
> > >  	};
> > > +
> > > +	pm8280-1-die-temp@103 {
> > 
> > pmic-die-temp? What pm8280 stands here?
> > 
> 
> As agreed, will use "pmic-die-temp"
> 
> > 
> > > +		reg = <PM8350_ADC7_DIE_TEMP(1)>;
> > > +		label = "pm8280_1_die_temp";
> > > +		qcom,pre-scaling = <1 1>;
> > > +	};
> > > +
> > > +	sys-therm1@144 {
> > 
> > I would say sys-therm@... why do we need the "1" suffix in node name?
> > 
> 
> Suffix represents the index of the thermistor as per the schematics but I guess
> it can be dropped.
> 

I was wrong. Suffix is necessary since IIO core registers the channel based on
the node name, so it has to be unique.

Thanks,
Mani

> Thanks,
> Mani
> 
> > > +		reg = <PM8350_ADC7_AMUX_THM1_100K_PU(1)>;
> > > +		qcom,ratiometric;
> > > +		qcom,hw-settle-time = <200>;
> > > +	};
> > 
> > Best regards,
> > Krzysztof
> > 
> 
> -- 
> மணிவண்ணன் சதாசிவம்
Krzysztof Kozlowski Nov. 2, 2022, 4:21 p.m. UTC | #4
On 30/10/2022 03:16, Manivannan Sadhasivam wrote:

>>>
>>>> +		reg = <PM8350_ADC7_DIE_TEMP(1)>;
>>>> +		label = "pm8280_1_die_temp";
>>>> +		qcom,pre-scaling = <1 1>;
>>>> +	};
>>>> +
>>>> +	sys-therm1@144 {
>>>
>>> I would say sys-therm@... why do we need the "1" suffix in node name?
>>>
>>
>> Suffix represents the index of the thermistor as per the schematics but I guess
>> it can be dropped.
>>
> 
> I was wrong. Suffix is necessary since IIO core registers the channel based on
> the node name, so it has to be unique.
> 

Makes sense then.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
index 9ac5d5c22832..d300d217fdc6 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
@@ -7,6 +7,7 @@ 
 /dts-v1/;
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/iio/qcom,spmi-adc7-pm8350.h>
 #include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 
@@ -189,6 +190,66 @@  pmk8280-xo-therm@44 {
 		qcom,ratiometric;
 		qcom,hw-settle-time = <200>;
 	};
+
+	pm8280-1-die-temp@103 {
+		reg = <PM8350_ADC7_DIE_TEMP(1)>;
+		label = "pm8280_1_die_temp";
+		qcom,pre-scaling = <1 1>;
+	};
+
+	sys-therm1@144 {
+		reg = <PM8350_ADC7_AMUX_THM1_100K_PU(1)>;
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+	};
+
+	sys-therm2@145 {
+		reg = <PM8350_ADC7_AMUX_THM2_100K_PU(1)>;
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+	};
+
+	sys-therm3@146 {
+		reg = <PM8350_ADC7_AMUX_THM3_100K_PU(1)>;
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+	};
+
+	sys-therm4@147 {
+		reg = <PM8350_ADC7_AMUX_THM4_100K_PU(1)>;
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+	};
+
+	pm8280-2-die-temp@303 {
+		reg = <PM8350_ADC7_DIE_TEMP(3)>;
+		label = "pm8250_2_die_temp";
+		qcom,pre-scaling = <1 1>;
+	};
+
+	sys-therm5@344 {
+		reg = <PM8350_ADC7_AMUX_THM1_100K_PU(3)>;
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+	};
+
+	sys-therm6@345 {
+		reg = <PM8350_ADC7_AMUX_THM2_100K_PU(3)>;
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+	};
+
+	sys-therm7@346 {
+		reg = <PM8350_ADC7_AMUX_THM3_100K_PU(3)>;
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+	};
+
+	sys-therm8@347 {
+		reg = <PM8350_ADC7_AMUX_THM4_100K_PU(3)>;
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+	};
 };
 
 &qup0 {