ARM: dts: stm32: add adc support on stm32mp135f-dk
authorOlivier Moysan <olivier.moysan@foss.st.com>
Wed, 12 Oct 2022 14:22:05 +0000 (16:22 +0200)
committerAlexandre Torgue <alexandre.torgue@foss.st.com>
Mon, 24 Oct 2022 09:11:38 +0000 (11:11 +0200)
Configure ADC support on stm32mp135f-dk. ADC can be used for
USB Type-C CC1 & CC2 pins wired to in6 & in12.

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

index c1c4b5a..a87ab06 100644 (file)
        };
 };
 
+&adc_1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&adc1_usb_cc_pins_a>;
+       vdda-supply = <&vdd_adc>;
+       vref-supply = <&vdd_adc>;
+       status = "okay";
+       adc1: adc@0 {
+               status = "okay";
+               /*
+                * Type-C USB_PWR_CC1 & USB_PWR_CC2 on in6 & in12.
+                * Use at least 5 * RC time, e.g. 5 * (Rp + Rd) * C:
+                * 5 * (5.1 + 47kOhms) * 5pF => 1.3us.
+                * Use arbitrary margin here (e.g. 5us).
+                */
+               channel@6 {
+                       reg = <6>;
+                       st,min-sample-time-ns = <5000>;
+               };
+               channel@12 {
+                       reg = <12>;
+                       st,min-sample-time-ns = <5000>;
+               };
+       };
+};
+
 &i2c1 {
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&i2c1_pins_a>;