Skip to contentSkip to conversation

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

PATCH Superseded Lei YU 2 participants 3 messages Aug 17, 2018 – Aug 22, 2018

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Lei YU

author
#0 lore raw

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

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.

---
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +8 -0
index 852b552..a910bc8 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"
@@ -304,3 +309,6 @@
 	status = "okay";
 };
 
+&adc {
+	status = "okay";
+};
Signature · 1 line
2.7.4
maintainer
#1 lore raw

Hi Lei,

Quoted 3 lines · Lei YU

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

I assume we're doing this to read a battery voltage of some kind (was it the RTC)? The commit message should describe why the change is being made (as we can read the patch to see what is being done).

This patch does not apply to dev-4.17. Can you rebase and test on top of the latest?

Cheers,

Joel

Quoted 35 lines

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.

---
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +8 -1
index 852b552..a910bc8 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"
@@ -304,3 +309,6 @@
        status = "okay";
 };
 
+&adc {
+       status = "okay";
+};
--

2.7.4

author
#2 lore raw
Quoted 12 lines · Joel Stanley

Hi Lei,

Quoted 3 lines · Lei YU

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

I assume we're doing this to read a battery voltage of some kind (was it the RTC)? The commit message should describe why the change is being made (as we can read the patch to see what is being done).

Yes, the commit message will be updated.

Quoted 2 lines

This patch does not apply to dev-4.17. Can you rebase and test on top of the latest?

Will check and submit a new version.