2019-03-20 13:42:29

by Amit Kucheria

[permalink] [raw]
Subject: [PATCHv1 0/2] 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(-)

--
2.17.1



2019-03-20 13:42:43

by Amit Kucheria

[permalink] [raw]
Subject: [PATCHv1 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")
Signed-off-by: Amit Kucheria <[email protected]>
---
arch/arm64/boot/dts/qcom/pms405.dtsi | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pms405.dtsi b/arch/arm64/boot/dts/qcom/pms405.dtsi
index 1bb836d1e8aa..8b6aa2334f56 100644
--- a/arch/arm64/boot/dts/qcom/pms405.dtsi
+++ b/arch/arm64/boot/dts/qcom/pms405.dtsi
@@ -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>;
};
};
--
2.17.1


2019-03-20 13:43:03

by Amit Kucheria

[permalink] [raw]
Subject: [PATCHv1 2/2] arm64: dts: qcom: pms405: Rename adc outputs as per schematics

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.

Signed-off-by: Amit Kucheria <[email protected]>
---
arch/arm64/boot/dts/qcom/pms405.dtsi | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/pms405.dtsi b/arch/arm64/boot/dts/qcom/pms405.dtsi
index 8b6aa2334f56..37c8bea24796 100644
--- a/arch/arm64/boot/dts/qcom/pms405.dtsi
+++ b/arch/arm64/boot/dts/qcom/pms405.dtsi
@@ -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>;
--
2.17.1


2019-04-26 21:10:22

by Amit Kucheria

[permalink] [raw]
Subject: Re: [PATCHv1 0/2] qcom: pms405: adc fixes

On Wed, Mar 20, 2019 at 7:10 PM Amit Kucheria <[email protected]> wrote:
>
> 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!

2019-04-27 04:40:07

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCHv1 0/2] qcom: pms405: adc fixes

On Wed 20 Mar 06:39 PDT 2019, Amit Kucheria wrote:

> 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

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