diff mbox series

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

Message ID 1534485925-63307-1-git-send-email-mine260309@gmail.com
State Superseded, archived
Headers show
Series [linux,dev-4.17,v2] ARM: dts: aspeed: romulus: Enable iio-hwmon-battery | expand

Commit Message

Lei YU Aug. 17, 2018, 6:05 a.m. UTC
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@gmail.com>
---
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Joel Stanley Aug. 21, 2018, 12:35 a.m. UTC | #1
Hi Lei,

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

>
> 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@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
>
Lei YU Aug. 22, 2018, 6:49 a.m. UTC | #2
On Tue, Aug 21, 2018 at 8:35 AM Joel Stanley <joel@jms.id.au> wrote:
>
> Hi Lei,
>
> On Fri, 17 Aug 2018 at 15:35, Lei YU <mine260309@gmail.com> wrote:
> >
> > 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.

> 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.
diff mbox series

Patch

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";
+};