[PATCH linux dev-4.17] ARM: dts: aspeed: romulus: Enable iio-hwmon-battery
Lei YU
mine260309 at gmail.com
Mon Jul 30 12:29:33 AEST 2018
Please do NOT merge this patch, as toggling GPIOR3 drains the battery.
On Fri, Jul 27, 2018 at 1:29 PM Lei YU <mine260309 at gmail.com> wrote:
>
> Add iio-hwmon-battery using adc channel 12;
> Pull GPIOR3 high to enable RTC_ADC;
> Enable adc to make adc running.
>
> Signed-off-by: Lei YU <mine260309 at gmail.com>
> ---
> arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 15 +++++++++++++++
> 1 file changed, 15 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..461564c 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"
> @@ -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
>
More information about the openbmc
mailing list