Skip to contentSkip to conversation

qcom: pms405: adc fixes

PATCH In review Amit Kucheria 2 participants 5 messages Mar 20, 2019 – Apr 27, 2019

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

cover qcom: pms405: adc fixes

A couple of fixes to the adc node in PMS405 to get thermistors to work correctly.

Amit Kucheria (2):
arm64: dts: qcom: pms405: calibrate the VADC correctly
arm64: dts: qcom: pms405: Rename adc outputs as per schematics

 arch/arm64/boot/dts/qcom/pms405.dtsi | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 arm64: dts: qcom: pms405: calibrate the VADC correctly

Set the qcom,ratiometric property to make the VADC use the VDD reference (1.875V) and GND for channel calibration of the temperature channels instead of 1.25V. Allow a 200us delay between the AMUX configuration and ADC starting conversion using qcom,hw-settle-time as described in documentation.

Fixes 041b9a7b9fdb ("arm64: dts: pms405: Export PMIC temperature to thermal framework")
---
 arch/arm64/boot/dts/qcom/pms405.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/qcom/pms405.dtsi +6 -0
index 1bb836d1e8aa..8b6aa2334f56 100644
@@ -110,16 +110,22 @@
 
 			xo_therm_100k_pu {
 				reg = <ADC5_XO_THERM_100K_PU>;
+				qcom,ratiometric;
+				qcom,hw-settle-time = <200>;
 				qcom,pre-scaling = <1 1>;
 			};
 
 			amux_thm1_100k_pu {
 				reg = <ADC5_AMUX_THM1_100K_PU>;
+				qcom,ratiometric;
+				qcom,hw-settle-time = <200>;
 				qcom,pre-scaling = <1 1>;
 			};
 
 			amux_thm3_100k_pu {
 				reg = <ADC5_AMUX_THM3_100K_PU>;
+				qcom,ratiometric;
+				qcom,hw-settle-time = <200>;
 				qcom,pre-scaling = <1 1>;
 			};
 		};
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/2 arm64: dts: qcom: pms405: Rename adc outputs as per schematics

In reply to Amit Kucheria

The adc outputs shouldn't contain information about their configuration e.g. 100K pull-up, but just reflect the name of the signal in the schematics.

Making them labels also allows us to overwrite their configuration in board-specific DTs.

Sort them by order as used in adc5_chans_rev2, while we're at it.

---
 arch/arm64/boot/dts/qcom/pms405.dtsi | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/qcom/pms405.dtsi +7 -7
index 8b6aa2334f56..37c8bea24796 100644
@@ -98,7 +98,7 @@
 				qcom,pre-scaling = <1 1>;
 			};
 
-			vph_pwr {
+			pon_1: vph_pwr {
 				reg = <ADC5_VPH_PWR>;
 				qcom,pre-scaling = <1 3>;
 			};
@@ -108,22 +108,22 @@
 				qcom,pre-scaling = <1 1>;
 			};
 
-			xo_therm_100k_pu {
-				reg = <ADC5_XO_THERM_100K_PU>;
+			pa_therm1: thermistor1 {
+				reg = <ADC5_AMUX_THM1_100K_PU>;
 				qcom,ratiometric;
 				qcom,hw-settle-time = <200>;
 				qcom,pre-scaling = <1 1>;
 			};
 
-			amux_thm1_100k_pu {
-				reg = <ADC5_AMUX_THM1_100K_PU>;
+			pa_therm3: thermistor3 {
+				reg = <ADC5_AMUX_THM3_100K_PU>;
 				qcom,ratiometric;
 				qcom,hw-settle-time = <200>;
 				qcom,pre-scaling = <1 1>;
 			};
 
-			amux_thm3_100k_pu {
-				reg = <ADC5_AMUX_THM3_100K_PU>;
+			xo_therm: xo_temp {
+				reg = <ADC5_XO_THERM_100K_PU>;
 				qcom,ratiometric;
 				qcom,hw-settle-time = <200>;
 				qcom,pre-scaling = <1 1>;
Signature · 1 line
2.17.1
#3 lore raw
In reply to Amit Kucheria
Quoted 10 lines · Amit Kucheria

A couple of fixes to the adc node in PMS405 to get thermistors to work correctly.

Amit Kucheria (2):
arm64: dts: qcom: pms405: calibrate the VADC correctly
arm64: dts: qcom: pms405: Rename adc outputs as per schematics

 arch/arm64/boot/dts/qcom/pms405.dtsi | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

Ping!

#4 lore raw
In reply to Amit Kucheria
Quoted 7 lines · Amit Kucheria

A couple of fixes to the adc node in PMS405 to get thermistors to work correctly.

Amit Kucheria (2):
arm64: dts: qcom: pms405: calibrate the VADC correctly
arm64: dts: qcom: pms405: Rename adc outputs as per schematics

Picked up the pair

Thanks,
Bjorn

Quoted 6 lines
 arch/arm64/boot/dts/qcom/pms405.dtsi | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
Signature · 1 line
2.17.1