]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM: dts: stm32: enable ADC support on stm32mp157a-dk1
authorFabrice Gasnier <fabrice.gasnier@st.com>
Fri, 13 Sep 2019 14:34:40 +0000 (16:34 +0200)
committerAlexandre Torgue <alexandre.torgue@st.com>
Fri, 25 Oct 2019 12:28:42 +0000 (14:28 +0200)
Configure ADC support on stm32mp157a-dk1. It can be used for various
purpose:
- AIN connector has several analog inputs: ANA0, ANA1, ADC2 in6 & in2,
  ADC1 in13 & in6
- USB Type-C CC1 & CC2 pins wired to in18 & in19
It's easier then to Configure them all. But keep them disabled by default,
so the pins are kept in their initial state to lower power consumption.
This way they can also be used as GPIO.
Add VDD and VDDA supplies to ADC on stm32mp157c-dk1 board. This allows to
get full ADC analog performances in case VDDA is below 2.7V (not the case
by default).

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
arch/arm/boot/dts/stm32mp157a-dk1.dts

index 2bce894b7a4e2d54ba69bbb3a9b73a30031eebfb..5ad4cef9e971ddf91fc1b14af7849e72cf06098f 100644 (file)
@@ -97,6 +97,33 @@ sound {
        };
 };
 
+&adc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&adc12_ain_pins_a>, <&adc12_usb_cc_pins_a>;
+       vdd-supply = <&vdd>;
+       vdda-supply = <&vdd>;
+       vref-supply = <&vrefbuf>;
+       status = "disabled";
+       adc1: adc@0 {
+               /*
+                * Type-C USB_PWR_CC1 & USB_PWR_CC2 on in18 & in19.
+                * Use at least 5 * RC time, e.g. 5 * (Rp + Rd) * C:
+                * 5 * (56 + 47kOhms) * 5pF => 2.5us.
+                * Use arbitrary margin here (e.g. 5us).
+                */
+               st,min-sample-time-nsecs = <5000>;
+               /* AIN connector, USB Type-C CC1 & CC2 */
+               st,adc-channels = <0 1 6 13 18 19>;
+               status = "okay";
+       };
+       adc2: adc@100 {
+               /* AIN connector, USB Type-C CC1 & CC2 */
+               st,adc-channels = <0 1 2 6 18 19>;
+               st,min-sample-time-nsecs = <5000>;
+               status = "okay";
+       };
+};
+
 &cec {
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&cec_pins_b>;