Skip to contentSkip to conversation

ARM64: dts: meson-gxbb-wetek: fix hwmon temperature sensor output

PATCH In review Christian Hewitt 2 participants 2 messages Nov 19, 2018

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

PATCH 1/1 ARM64: dts: meson-gxbb-wetek: fix hwmon temperature sensor output

Add &saradc and supporting vddio_ao18 nodes to fix hwmon temperature readings on the WeTek Hub and Play2 devices. Without these nodes the temp is reported as 4294967295 degrees C.

Thanks to Martin Blumenstingl for assisting debug and the winning guess at what was missing.

---
 arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi +12 -0
index 70325b2..dd12e02 100644
@@ -59,6 +59,13 @@
 		regulator-max-microvolt = <3300000>;
 	};
 
+	vddio_ao18: regulator-vddio_ao18 {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDIO_AO18";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+
 	vcc_3v3: regulator-vcc_3v3 {
 		compatible = "regulator-fixed";
 		regulator-name = "VCC_3V3";
@@ -173,6 +180,11 @@
 	clock-names = "clkin0";
 };
 
+&saradc {
+	status = "okay";
+	vref-supply = <&vddio_ao18>;
+};
+
 /* Wireless SDIO Module */
 &sd_emmc_a {
 	status = "okay";
Signature · 1 line
2.7.4
#1 lore raw

Hi,

Quoted 6 lines · Christian Hewitt

Add &saradc and supporting vddio_ao18 nodes to fix hwmon temperature readings on the WeTek Hub and Play2 devices. Without these nodes the temp is reported as 4294967295 degrees C.

Thanks to Martin Blumenstingl for assisting debug and the winning guess at what was missing.

It's a good workaround, but the real solution is that we should instead add the CLKID_SAR_ADC* clock in the scpi_sensors node and update the driver to keep these clocks enabled.

We hit the same issue as the clk_div2/3 which should be kept enabled by the SCPI scpi_dvfs driver.

Neil

Quoted 37 lines
---
 arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi +12 -0
index 70325b2..dd12e02 100644
@@ -59,6 +59,13 @@
 		regulator-max-microvolt = <3300000>;
 	};
 
+	vddio_ao18: regulator-vddio_ao18 {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDIO_AO18";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+
 	vcc_3v3: regulator-vcc_3v3 {
 		compatible = "regulator-fixed";
 		regulator-name = "VCC_3V3";
@@ -173,6 +180,11 @@
 	clock-names = "clkin0";
 };
 
+&saradc {
+	status = "okay";
+	vref-supply = <&vddio_ao18>;
+};
+
 /* Wireless SDIO Module */
 &sd_emmc_a {
 	status = "okay";