openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux dev-4.17 v3] hARM: dts: aspeed: romulus: Enable iio-hwmon-battery
@ 2018-08-22  7:47 Lei YU
  2018-10-21 22:22 ` Joel Stanley
  0 siblings, 1 reply; 2+ messages in thread
From: Lei YU @ 2018-08-22  7:47 UTC (permalink / raw)
  To: openbmc

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>
---
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
index 9784a59a..cf59472 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
@@ -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";
+};
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH linux dev-4.17 v3] hARM: dts: aspeed: romulus: Enable iio-hwmon-battery
  2018-08-22  7:47 [PATCH linux dev-4.17 v3] hARM: dts: aspeed: romulus: Enable iio-hwmon-battery Lei YU
@ 2018-10-21 22:22 ` Joel Stanley
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Stanley @ 2018-10-21 22:22 UTC (permalink / raw)
  To: Lei YU; +Cc: OpenBMC Maillist

On Wed, 22 Aug 2018 at 17:17, Lei YU <mine260309@gmail.com> wrote:
>
> 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>

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

Cheers,

Joel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-21 22:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-22  7:47 [PATCH linux dev-4.17 v3] hARM: dts: aspeed: romulus: Enable iio-hwmon-battery Lei YU
2018-10-21 22:22 ` Joel Stanley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).