ARM: dts: stm32: add adc internal channels to stm32mp15
authorOlivier Moysan <olivier.moysan@foss.st.com>
Tue, 30 May 2023 12:45:29 +0000 (14:45 +0200)
committerAlexandre Torgue <alexandre.torgue@foss.st.com>
Fri, 2 Jun 2023 10:24:40 +0000 (12:24 +0200)
Add STM32 ADC2 internal channels VREFINT and VDDCORE to STM32MP15x SoCs.
VBAT internal channel is not defined by default in SoC DT, and
has be defined in board DT when needed, instead. This avoids unwanted
current consumption on battery, when ADC conversions are performed
on any other channels.

The internal channels are defined in STM32MP15 SoC DT according to the
generic IIO channel bindings. The STM32 driver does not support a mixed
use of legacy and generic channels. When generic channels are defined,
legacy channels are ignored. This involves that the board device trees
using legacy bindings for ADC2, have to be reworked.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
arch/arm/boot/dts/stm32mp151.dtsi

index bf3830d..7b360ee 100644 (file)
                        adc1: adc@0 {
                                compatible = "st,stm32mp1-adc";
                                #io-channel-cells = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
                                reg = <0x0>;
                                interrupt-parent = <&adc>;
                                interrupts = <0>;
                        adc2: adc@100 {
                                compatible = "st,stm32mp1-adc";
                                #io-channel-cells = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
                                reg = <0x100>;
                                interrupt-parent = <&adc>;
                                interrupts = <1>;
                                dmas = <&dmamux1 10 0x400 0x01>;
                                dma-names = "rx";
                                status = "disabled";
+                               channel@13 {
+                                       reg = <13>;
+                                       label = "vrefint";
+                               };
+                               channel@14 {
+                                       reg = <14>;
+                                       label = "vddcore";
+                               };
                        };
                };