Skip to contentSkip to conversation

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

PATCH Superseded Lei YU 1 participant 2 messages Jul 27, 2018 – Jul 30, 2018

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Lei YU

author
#0 lore raw

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

Add iio-hwmon-battery using adc channel 12;
Pull GPIOR3 high to enable RTC_ADC;
Enable adc to make adc running.

---
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +15 -0
index 852b552..461564c 100644
@@ -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"
@@ -236,6 +241,12 @@
 		output-low;
 		line-name = "seq_cont";
 	};
+	rtc_adc_en {
+		gpio-hog;
+		gpios = <ASPEED_GPIO(R, 3) GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "rtc_adc_en";
+	};
 };
 
 &vuart {
@@ -304,3 +315,7 @@
 	status = "okay";
 };
 
+&adc {
+	status = "okay";
+};
+
Signature · 1 line
2.7.4
author
#1 lore raw

Please do NOT merge this patch, as toggling GPIOR3 drains the battery.

Quoted 50 lines · Lei YU

Add iio-hwmon-battery using adc channel 12;
Pull GPIOR3 high to enable RTC_ADC;
Enable adc to make adc running.

---
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +15 -1
index 852b552..461564c 100644
@@ -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"
@@ -236,6 +241,12 @@
                output-low;
                line-name = "seq_cont";
        };
+       rtc_adc_en {
+               gpio-hog;
+               gpios = <ASPEED_GPIO(R, 3) GPIO_ACTIVE_HIGH>;
+               output-high;
+               line-name = "rtc_adc_en";
+       };
 };
 
 &vuart {
@@ -304,3 +315,7 @@
        status = "okay";
 };
 
+&adc {
+       status = "okay";
+};
+
--

2.7.4