Skip to contentSkip to conversation

arm64: dts: qcom: pm8998: Use ADC temperature to temp-alarm node

PATCH In review Matthias Kaehlcke 2 participants 3 messages Sep 27, 2018 – Nov 20, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: qcom: pm8998: Use ADC temperature to temp-alarm node

The temperature information from the temp-alarm block itself is very coarse ("temperature is above/below trip points"). Provide the driver with the die temperature channel of the ADC on the PMIC for more precise readings.

---
- based on agross/for-next (7a002fe0179c "Merge branch 'defconfig-for-4.20' into all-for-4.20-redo"))
- depends on e13d757279bb ("iio: adc: Add QCOM SPMI PMIC5 ADC driver") from IIO pull request:
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git tags/iio-for-4.20a
- to work properly https://patchwork.kernel.org/patch/10594491/ is needed

---
 arch/arm64/boot/dts/qcom/pm8998.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/pm8998.dtsi +2 -0
index 048f19fa0150..fab5a826fb01 100644
@@ -58,6 +58,8 @@
 			compatible = "qcom,spmi-temp-alarm";
 			reg = <0x2400>;
 			interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>;
+			io-channels = <&pm8998_adc ADC5_DIE_TEMP>;
+			io-channel-names = "thermal";
 			#thermal-sensor-cells = <0>;
 		};
 
Signature · 1 line
2.19.0.605.g01d371f741-goog
#1 lore raw
Quoted 23 lines · Matthias Kaehlcke

The temperature information from the temp-alarm block itself is very coarse ("temperature is above/below trip points"). Provide the driver with the die temperature channel of the ADC on the PMIC for more precise readings.

---
- based on agross/for-next (7a002fe0179c "Merge branch 'defconfig-for-4.20' into all-for-4.20-redo"))
- depends on e13d757279bb ("iio: adc: Add QCOM SPMI PMIC5 ADC driver") from IIO pull request:
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git tags/iio-for-4.20a
- to work properly https://patchwork.kernel.org/patch/10594491/ is needed

---
 arch/arm64/boot/dts/qcom/pm8998.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/pm8998.dtsi +0 -0
index 048f19fa0150..fab5a826fb01 100644

arch/arm64/boot/dts/qcom/pm8998.dtsi line 65

Quoted 8 lines
arch/arm64/boot/dts/qcom/pm8998.dtsi +2 -0
@@ -58,6 +58,8 @@
 			compatible = "qcom,spmi-temp-alarm";
 			reg = <0x2400>;
 			interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>;
+			io-channels = <&pm8998_adc ADC5_DIE_TEMP>;
+			io-channel-names = "thermal";
 			#thermal-sensor-cells = <0>;
 		};
 

I think this should be ready to land in for-next now that "arm64: dts:
qcom: pm8998: Add die temperature channel node to the ADC" (a789fd0bab57) has been added.

Cheers

Matthias

Reviewed-by
#2 lore raw

Hi,

Quoted 29 lines · Matthias Kaehlcke
Quoted 27 lines · Matthias Kaehlcke

The temperature information from the temp-alarm block itself is very coarse ("temperature is above/below trip points"). Provide the driver with the die temperature channel of the ADC on the PMIC for more precise readings.

---
- based on agross/for-next (7a002fe0179c "Merge branch 'defconfig-for-4.20' into all-for-4.20-redo"))
- depends on e13d757279bb ("iio: adc: Add QCOM SPMI PMIC5 ADC driver") from IIO pull request:
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git tags/iio-for-4.20a
- to work properly https://patchwork.kernel.org/patch/10594491/ is needed

---
 arch/arm64/boot/dts/qcom/pm8998.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/pm8998.dtsi +1 -0
index 048f19fa0150..fab5a826fb01 100644
@@ -58,6 +58,8 @@
                      compatible = "qcom,spmi-temp-alarm";
                      reg = <0x2400>;
                      interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>;
+                     io-channels = <&pm8998_adc ADC5_DIE_TEMP>;
Quoted 8 lines

arch/arm64/boot/dts/qcom/pm8998.dtsi line 65

Quoted 4 lines
arch/arm64/boot/dts/qcom/pm8998.dtsi +1 -0
+                     io-channel-names = "thermal";
                      #thermal-sensor-cells = <0>;
              };
 

I think this should be ready to land in for-next now that "arm64: dts:
qcom: pm8998: Add die temperature channel node to the ADC" (a789fd0bab57) has been added.

Agreed and this matches my understanding of how things are supposed to work. FWIW: