This patchset adds ADC device-tree nodes to STM32H7 SoC and
enables ADC1 by default on stm32h743i-eval board.
Fabrice Gasnier (2):
ARM: dts: stm32: add ADC support on stm32h7
ARM: dts: stm32: enable ADC on stm32h743i-eval board
arch/arm/boot/dts/stm32h743.dtsi | 53 +++++++++++++++++++++++++++++++++++
arch/arm/boot/dts/stm32h743i-eval.dts | 18 ++++++++++++
2 files changed, 71 insertions(+)
--
1.9.1
Add support for ADC (Analog to Digital Converter) to STM32H7.
It has 3 ADCs, distributed over two ADC blocks:
- ADC1 and ADC2 @0x40022000
- ADC3 @0x58026000 (instantiated separately)
Signed-off-by: Fabrice Gasnier <[email protected]>
---
arch/arm/boot/dts/stm32h743.dtsi | 53 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/arch/arm/boot/dts/stm32h743.dtsi b/arch/arm/boot/dts/stm32h743.dtsi
index 4685629..bc47119 100644
--- a/arch/arm/boot/dts/stm32h743.dtsi
+++ b/arch/arm/boot/dts/stm32h743.dtsi
@@ -74,6 +74,59 @@
interrupts = <50>;
clocks = <&timer_clk>;
};
+
+ adc_12: adc@40022000 {
+ compatible = "st,stm32h7-adc-core";
+ reg = <0x40022000 0x400>;
+ interrupts = <18>;
+ clocks = <&timer_clk>;
+ clock-names = "bus";
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+
+ adc1: adc@0 {
+ compatible = "st,stm32h7-adc";
+ #io-channel-cells = <1>;
+ reg = <0x0>;
+ interrupt-parent = <&adc_12>;
+ interrupts = <0>;
+ status = "disabled";
+ };
+
+ adc2: adc@100 {
+ compatible = "st,stm32h7-adc";
+ #io-channel-cells = <1>;
+ reg = <0x100>;
+ interrupt-parent = <&adc_12>;
+ interrupts = <1>;
+ status = "disabled";
+ };
+ };
+
+ adc_3: adc@58026000 {
+ compatible = "st,stm32h7-adc-core";
+ reg = <0x58026000 0x400>;
+ interrupts = <127>;
+ clocks = <&timer_clk>;
+ clock-names = "bus";
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+
+ adc3: adc@0 {
+ compatible = "st,stm32h7-adc";
+ #io-channel-cells = <1>;
+ reg = <0x0>;
+ interrupt-parent = <&adc_3>;
+ interrupts = <0>;
+ status = "disabled";
+ };
+ };
};
};
--
1.9.1
There's a potentiometer connected to ADC1 and ADC2 in0 on
stm32h743i-eval board.
- Add fixed-voltage 'vdda' regulator that supplies 'vref' pin.
It's used as voltage reference for ADC and/or DAC.
- Enable ADC1 in0 input (arbitrary choice: could be ADC2 as well).
Note: No pinctrl is needed to use in0 dedicated analog input pin
(e.g. ADC12_INP0).
Signed-off-by: Fabrice Gasnier <[email protected]>
---
arch/arm/boot/dts/stm32h743i-eval.dts | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/arch/arm/boot/dts/stm32h743i-eval.dts b/arch/arm/boot/dts/stm32h743i-eval.dts
index c6effbb..6c07786 100644
--- a/arch/arm/boot/dts/stm32h743i-eval.dts
+++ b/arch/arm/boot/dts/stm32h743i-eval.dts
@@ -60,6 +60,24 @@
aliases {
serial0 = &usart1;
};
+
+ vdda: regulator-vdda {
+ compatible = "regulator-fixed";
+ regulator-name = "vdda";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+};
+
+&adc_12 {
+ vref-supply = <&vdda>;
+ status = "okay";
+ adc1: adc@0 {
+ /* potentiometer */
+ st,adc-channels = <0>;
+ status = "okay";
+ };
};
&clk_hse {
--
1.9.1
Hi Fabrice,
On 07/11/2017 06:13 PM, Fabrice Gasnier wrote:
> This patchset adds ADC device-tree nodes to STM32H7 SoC and
> enables ADC1 by default on stm32h743i-eval board.
>
> Fabrice Gasnier (2):
> ARM: dts: stm32: add ADC support on stm32h7
> ARM: dts: stm32: enable ADC on stm32h743i-eval board
>
> arch/arm/boot/dts/stm32h743.dtsi | 53 +++++++++++++++++++++++++++++++++++
> arch/arm/boot/dts/stm32h743i-eval.dts | 18 ++++++++++++
> 2 files changed, 71 insertions(+)
>
Series applied on stm32-dt-for-v4.14 branch.
Thanks
Alex