arm64: qcom: sc7180: trogdor: Add ADC nodes and thermal zone for charger thermistor
authorAntony Wang <antony_wang@compal.corp-partner.google.com>
Fri, 30 Oct 2020 15:48:43 +0000 (08:48 -0700)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 24 Nov 2020 23:02:46 +0000 (17:02 -0600)
Trogdor has a thermistor to monitor the temperature of the charger IC.
Add the ADC (monitor) nodes and a thermal zone for this thermistor.

Signed-off-by: Antony Wang <antony_wang@compal.corp-partner.google.com>
[mka: tweaked commit message]
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Link: https://lore.kernel.org/r/20201030084840.1.If389f211a8532b83095ff8c66ec181424440f8d6@changeid
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi

index 3eb1ff2483beeca01c3e20e88b6c3ccda578b6e3..e854a12f45f268705a35e8b2e4b9b9e6d0f13c97 100644 (file)
 #include "pm6150.dtsi"
 #include "pm6150l.dtsi"
 
+/ {
+       thermal-zones {
+               charger-thermal {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+
+                       thermal-sensors = <&pm6150_adc_tm 1>;
+
+                       trips {
+                               temperature = <125000>;
+                               hysteresis = <1000>;
+                               type = "critical";
+                       };
+               };
+       };
+};
+
 /*
  * Reserved memory changes
  *
@@ -741,6 +758,25 @@ hp_i2c: &i2c9 {
        status = "okay";
 };
 
+&pm6150_adc {
+       charger-thermistor@4f {
+               reg = <ADC5_AMUX_THM3_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time = <200>;
+       };
+};
+
+&pm6150_adc_tm {
+       status = "okay";
+
+       charger-thermistor@1 {
+               reg = <1>;
+               io-channels = <&pm6150_adc ADC5_AMUX_THM3_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time-us = <200>;
+       };
+};
+
 &pm6150_pwrkey {
        status = "disabled";
 };