openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux dev-5.10] ARM: dts: aspeed: Add ADC for AST2600 and enable for Rainier and Everest
@ 2021-09-16 21:00 Eddie James
  2021-09-22  2:29 ` Joel Stanley
  0 siblings, 1 reply; 2+ messages in thread
From: Eddie James @ 2021-09-16 21:00 UTC (permalink / raw)
  To: openbmc; +Cc: Thomas.Ippolito, Eddie James

Add the ADC nodes to the AST2600 devicetree. Enable ADC1 for Rainier and
Everest systems and add an iio-hwmon node for the 7th channel to report
the battery voltage.

Tested on Rainier:
~# cat /sys/class/hwmon/hwmon11/in1_input
1347

Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
 arch/arm/boot/dts/aspeed-bmc-ibm-everest.dts | 15 +++++++++++++++
 arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts | 15 +++++++++++++++
 arch/arm/boot/dts/aspeed-g6.dtsi             | 20 ++++++++++++++++++++
 3 files changed, 50 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-bmc-ibm-everest.dts b/arch/arm/boot/dts/aspeed-bmc-ibm-everest.dts
index 91242983a7b2..4682c005440d 100644
--- a/arch/arm/boot/dts/aspeed-bmc-ibm-everest.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-ibm-everest.dts
@@ -243,6 +243,21 @@ led-pcieslot-power {
 			gpios = <&gpio0 ASPEED_GPIO(P, 4) GPIO_ACTIVE_LOW>;
 		};
 	};
+
+	iio-hwmon {
+		compatible = "iio-hwmon";
+		io-channels = <&adc1 7>;
+	};
+};
+
+&adc1 {
+	status = "okay";
+	aspeed,int-vref-microvolt = <2500000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_adc8_default &pinctrl_adc9_default
+				 &pinctrl_adc10_default &pinctrl_adc11_default
+				 &pinctrl_adc12_default &pinctrl_adc13_default
+				 &pinctrl_adc14_default &pinctrl_adc15_default>;
 };
 
 &gpio0 {
diff --git a/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts b/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts
index 665c61ab6710..3e8d34a8729e 100644
--- a/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts
@@ -218,6 +218,21 @@ fan5-presence {
 			linux,code = <11>;
 		};
 	};
+
+	iio-hwmon {
+		compatible = "iio-hwmon";
+		io-channels = <&adc1 7>;
+	};
+};
+
+&adc1 {
+	status = "okay";
+	aspeed,int-vref-microvolt = <2500000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_adc8_default &pinctrl_adc9_default
+		&pinctrl_adc10_default &pinctrl_adc11_default
+		&pinctrl_adc12_default &pinctrl_adc13_default
+		&pinctrl_adc14_default &pinctrl_adc15_default>;
 };
 
 &ehci1 {
diff --git a/arch/arm/boot/dts/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed-g6.dtsi
index f96607b7b4e2..02e54fb13815 100644
--- a/arch/arm/boot/dts/aspeed-g6.dtsi
+++ b/arch/arm/boot/dts/aspeed-g6.dtsi
@@ -364,6 +364,26 @@ xdma: xdma@1e6e7000 {
 				status = "disabled";
 			};
 
+			adc0: adc@1e6e9000 {
+				compatible = "aspeed,ast2600-adc0";
+				reg = <0x1e6e9000 0x100>;
+				clocks = <&syscon ASPEED_CLK_APB2>;
+				resets = <&syscon ASPEED_RESET_ADC>;
+				interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
+				#io-channel-cells = <1>;
+				status = "disabled";
+			};
+
+			adc1: adc@1e6e9100 {
+				compatible = "aspeed,ast2600-adc1";
+				reg = <0x1e6e9100 0x100>;
+				clocks = <&syscon ASPEED_CLK_APB2>;
+				resets = <&syscon ASPEED_RESET_ADC>;
+				interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
+				#io-channel-cells = <1>;
+				status = "disabled";
+			};
+
 			gpio0: gpio@1e780000 {
 				#gpio-cells = <2>;
 				gpio-controller;
-- 
2.27.0


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

* Re: [PATCH linux dev-5.10] ARM: dts: aspeed: Add ADC for AST2600 and enable for Rainier and Everest
  2021-09-16 21:00 [PATCH linux dev-5.10] ARM: dts: aspeed: Add ADC for AST2600 and enable for Rainier and Everest Eddie James
@ 2021-09-22  2:29 ` Joel Stanley
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Stanley @ 2021-09-22  2:29 UTC (permalink / raw)
  To: Eddie James; +Cc: Thomas.Ippolito, OpenBMC Maillist

On Thu, 16 Sept 2021 at 21:00, Eddie James <eajames@linux.ibm.com> wrote:
>
> Add the ADC nodes to the AST2600 devicetree. Enable ADC1 for Rainier and
> Everest systems and add an iio-hwmon node for the 7th channel to report
> the battery voltage.
>
> Tested on Rainier:
> ~# cat /sys/class/hwmon/hwmon11/in1_input
> 1347
>
> Signed-off-by: Eddie James <eajames@linux.ibm.com>

Applied, thanks.


> ---
>  arch/arm/boot/dts/aspeed-bmc-ibm-everest.dts | 15 +++++++++++++++
>  arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts | 15 +++++++++++++++
>  arch/arm/boot/dts/aspeed-g6.dtsi             | 20 ++++++++++++++++++++
>  3 files changed, 50 insertions(+)
>
> diff --git a/arch/arm/boot/dts/aspeed-bmc-ibm-everest.dts b/arch/arm/boot/dts/aspeed-bmc-ibm-everest.dts
> index 91242983a7b2..4682c005440d 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-ibm-everest.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-ibm-everest.dts
> @@ -243,6 +243,21 @@ led-pcieslot-power {
>                         gpios = <&gpio0 ASPEED_GPIO(P, 4) GPIO_ACTIVE_LOW>;
>                 };
>         };
> +
> +       iio-hwmon {
> +               compatible = "iio-hwmon";
> +               io-channels = <&adc1 7>;
> +       };
> +};
> +
> +&adc1 {
> +       status = "okay";
> +       aspeed,int-vref-microvolt = <2500000>;
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&pinctrl_adc8_default &pinctrl_adc9_default
> +                                &pinctrl_adc10_default &pinctrl_adc11_default
> +                                &pinctrl_adc12_default &pinctrl_adc13_default
> +                                &pinctrl_adc14_default &pinctrl_adc15_default>;
>  };
>
>  &gpio0 {
> diff --git a/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts b/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts
> index 665c61ab6710..3e8d34a8729e 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts
> @@ -218,6 +218,21 @@ fan5-presence {
>                         linux,code = <11>;
>                 };
>         };
> +
> +       iio-hwmon {
> +               compatible = "iio-hwmon";
> +               io-channels = <&adc1 7>;
> +       };
> +};
> +
> +&adc1 {
> +       status = "okay";
> +       aspeed,int-vref-microvolt = <2500000>;
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&pinctrl_adc8_default &pinctrl_adc9_default
> +               &pinctrl_adc10_default &pinctrl_adc11_default
> +               &pinctrl_adc12_default &pinctrl_adc13_default
> +               &pinctrl_adc14_default &pinctrl_adc15_default>;
>  };
>
>  &ehci1 {
> diff --git a/arch/arm/boot/dts/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed-g6.dtsi
> index f96607b7b4e2..02e54fb13815 100644
> --- a/arch/arm/boot/dts/aspeed-g6.dtsi
> +++ b/arch/arm/boot/dts/aspeed-g6.dtsi
> @@ -364,6 +364,26 @@ xdma: xdma@1e6e7000 {
>                                 status = "disabled";
>                         };
>
> +                       adc0: adc@1e6e9000 {
> +                               compatible = "aspeed,ast2600-adc0";
> +                               reg = <0x1e6e9000 0x100>;
> +                               clocks = <&syscon ASPEED_CLK_APB2>;
> +                               resets = <&syscon ASPEED_RESET_ADC>;
> +                               interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
> +                               #io-channel-cells = <1>;
> +                               status = "disabled";
> +                       };
> +
> +                       adc1: adc@1e6e9100 {
> +                               compatible = "aspeed,ast2600-adc1";
> +                               reg = <0x1e6e9100 0x100>;
> +                               clocks = <&syscon ASPEED_CLK_APB2>;
> +                               resets = <&syscon ASPEED_RESET_ADC>;
> +                               interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
> +                               #io-channel-cells = <1>;
> +                               status = "disabled";
> +                       };
> +
>                         gpio0: gpio@1e780000 {
>                                 #gpio-cells = <2>;
>                                 gpio-controller;
> --
> 2.27.0
>

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

end of thread, other threads:[~2021-09-22  2:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 21:00 [PATCH linux dev-5.10] ARM: dts: aspeed: Add ADC for AST2600 and enable for Rainier and Everest Eddie James
2021-09-22  2:29 ` 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).