[PATCH linux dev-4.17 v2] ARM: dts: aspeed: romulus: Enable iio-hwmon-battery

Lei YU mine260309 at gmail.com
Fri Aug 17 16:05:25 AEST 2018


Add iio-hwmon-battery using adc channel 12;
Enable adc to make adc running.

Note it requires GPIOR3 to be pulled high to read the voltage, and this
is left for user space to toggle the GPIO to save the battery usage.

Signed-off-by: Lei YU <mine260309 at gmail.com>
---
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
index 852b552..a910bc8 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
@@ -83,6 +83,11 @@
 			linux,code = <ASPEED_GPIO(Q, 7)>;
 		};
 	};
+
+	iio-hwmon-battery {
+		compatible = "iio-hwmon";
+		io-channels = <&adc 12>;
+	};
 };
 
 #include "ibm-power9-cfam.dtsi"
@@ -304,3 +309,6 @@
 	status = "okay";
 };
 
+&adc {
+	status = "okay";
+};
-- 
2.7.4



More information about the openbmc mailing list