Skip to content

Commit 7ea81ea

Browse files
Olivier MoysanAlexandre Torgue
authored andcommitted
ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards
U-Boot enables ADC1&2 to support USB power measurement and ADC calibration on STM32MP15x Disco boards. When leaving U-boot the ADCs do not return to power down state to keep ADC linear calibration available for kernel. Enable ADC1&2 by default on STM32MP15xx-DKx boards to align kernel DT with Uboot. This avoids to shutdown the ADCs VDDA, while the ADCs are not in power down. Use STM32 ADC generic bindings instead of legacy bindings on STM32MP15xx-DKx boards. The ADC pins on Arduino connector are not set by default. These pins are added in A7 Disco example DTs only. Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
1 parent 95ee314 commit 7ea81ea

1 file changed

Lines changed: 20 additions & 9 deletions

File tree

arch/arm/boot/dts/stm32mp15xx-dkx.dtsi

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,28 +93,39 @@
9393

9494
&adc {
9595
pinctrl-names = "default";
96-
pinctrl-0 = <&adc12_ain_pins_a>, <&adc12_usb_cc_pins_a>;
96+
pinctrl-0 = <&adc12_usb_cc_pins_a>;
9797
vdd-supply = <&vdd>;
9898
vdda-supply = <&vdd>;
9999
vref-supply = <&vrefbuf>;
100-
status = "disabled";
100+
status = "okay";
101101
adc1: adc@0 {
102+
status = "okay";
102103
/*
103104
* Type-C USB_PWR_CC1 & USB_PWR_CC2 on in18 & in19.
104105
* Use at least 5 * RC time, e.g. 5 * (Rp + Rd) * C:
105106
* 5 * (56 + 47kOhms) * 5pF => 2.5us.
106107
* Use arbitrary margin here (e.g. 5us).
107108
*/
108-
st,min-sample-time-nsecs = <5000>;
109-
/* AIN connector, USB Type-C CC1 & CC2 */
110-
st,adc-channels = <0 1 6 13 18 19>;
111-
status = "okay";
109+
channel@18 {
110+
reg = <18>;
111+
st,min-sample-time-ns = <5000>;
112+
};
113+
channel@19 {
114+
reg = <19>;
115+
st,min-sample-time-ns = <5000>;
116+
};
112117
};
113118
adc2: adc@100 {
114-
/* AIN connector, USB Type-C CC1 & CC2 */
115-
st,adc-channels = <0 1 2 6 18 19>;
116-
st,min-sample-time-nsecs = <5000>;
117119
status = "okay";
120+
/* USB Type-C CC1 & CC2 */
121+
channel@18 {
122+
reg = <18>;
123+
st,min-sample-time-ns = <5000>;
124+
};
125+
channel@19 {
126+
reg = <19>;
127+
st,min-sample-time-ns = <5000>;
128+
};
118129
};
119130
};
120131

0 commit comments

Comments
 (0)