Skip to contentSkip to conversation

hARM: dts: aspeed: romulus: Enable iio-hwmon-battery

PATCH In review Lei YU 2 participants 2 messages Aug 22, 2018 – Oct 21, 2018

Subsystems (2)
lore
Share & tools
lore

Lei YU

author
#0 lore raw

PATCH v3 1/1 hARM: dts: aspeed: romulus: Enable iio-hwmon-battery

Add iio-hwmon-battery using adc channel 12 and enable adc to make adc running. This channel is used to read RTC battery voltage.

Note with Romulus hardware design, it requires GPIOR3 to be pulled high to read the voltage, otherwise the reading is 0.
When GPIOR3 is high, it consumes battery and impacts the battery life. So it is left for user space to toggle the GPIO when trying to read the voltage.

---
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +9 -0
index 9784a59a..cf59472 100644
@@ -91,6 +91,11 @@
 			linux,code = <ASPEED_GPIO(Q, 7)>;
 		};
 	};
+
+	iio-hwmon-battery {
+		compatible = "iio-hwmon";
+		io-channels = <&adc 12>;
+	};
 };
 
 #include "ibm-power9-dual.dtsi"
@@ -311,3 +316,7 @@
 &vhub {
 	status = "okay";
 };
+
+&adc {
+	status = "okay";
+};
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 11 lines · Lei YU

Add iio-hwmon-battery using adc channel 12 and enable adc to make adc running. This channel is used to read RTC battery voltage.

Note with Romulus hardware design, it requires GPIOR3 to be pulled high to read the voltage, otherwise the reading is 0.
When GPIOR3 is high, it consumes battery and impacts the battery life. So it is left for user space to toggle the GPIO when trying to read the voltage.

For the mailing list record: this was applied to dev-4.18 some time ago.

Cheers,

Joel