ARM: dts: aspeed: romulus: Enable iio-hwmon-battery
authorLei YU <mine260309@gmail.com>
Wed, 22 Aug 2018 07:47:28 +0000 (15:47 +0800)
committerJoel Stanley <joel@jms.id.au>
Sun, 2 Dec 2018 22:44:05 +0000 (09:14 +1030)
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.

Signed-off-by: Lei YU <mine260309@gmail.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts

index 1c6c8cc..76fe994 100644 (file)
                        linux,code = <ASPEED_GPIO(Q, 7)>;
                };
        };
+
+       iio-hwmon-battery {
+               compatible = "iio-hwmon";
+               io-channels = <&adc 12>;
+       };
 };
 
 &fmc {
 &vhub {
        status = "okay";
 };
+
+&adc {
+       status = "okay";
+};