Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp940622ybe; Fri, 13 Sep 2019 08:39:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuJduQ62WLlxm5Jv2KKnhFCw8BU2TTW49bZpgWsEp9utD3+LYMqRpx5j2f7YSo9r/vwSRi X-Received: by 2002:aa7:c542:: with SMTP id s2mr48868774edr.32.1568389146670; Fri, 13 Sep 2019 08:39:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568389146; cv=none; d=google.com; s=arc-20160816; b=Xq1FCIPujBuR0tcitfXin1eDdQzGqUVOWW7etrgGHUy4+ziQmagpqYdFa5uDPajm8C I2VQWyBOi6386phMOdUFDUcdfiDlHGOtONdVuHL1gFsW18GMseOoO/XHw5lQYrVCVoik vZ0jxDuB4Kre0T3g7FVc798C9dDTRN0dK6J58Edux7fW13mLP1hwDId3WBvsjRwEFHfa 0xfH//o+n3ahRvLdfTyL8fy0kAnWvjYne3eNM/n6htCi5b1XtZkfMPAyfWuOeVv7qpAM wQSTPldMy0Jrj1bZ6q08L86MoXJzevF4dcSmc+fDscF79qvgFhe4RsgODC85TnCJ1qtp 8ncw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=hryKjyfCxTA2dnqKEkk14SmwqqJ3l+c8gAOzB7s0IVA=; b=JgebUYqemJsiZ7XjeJ0ImVKIi9sqGHMo5DX9sTVa2mFKKXlELFCMUDFjH/1gQWVqLu hcarUW9xTzR9fkTGmYaSL1IxssZ5/7fLdowG6P244kdTYxSiIZgSaiKNaPxLebXAfmlQ H7T8HxzfbGRhzzie/By+Sw3yxjN8K2DmZoeNhXYarpyVHlsUofNaTP37NjlAaq6FCHp2 LN6dFvPQ5/xYfxVCvjwRa22hQ2rXbZ+TK2UOWnn2/r/q4ZHxTqA4rAZmIrI9zMAzG/E/ INB52iSsPhGPbBmJ8HuahE1EW6Z+XLAQXyS/wsrtlP9JVxopPwsh+5Yj1c5udvcjsGqa 4oSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=1JWVK43f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t22si15066195ejx.202.2019.09.13.08.38.42; Fri, 13 Sep 2019 08:39:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=1JWVK43f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389482AbfIMOfQ (ORCPT + 99 others); Fri, 13 Sep 2019 10:35:16 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:13192 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387600AbfIMOfP (ORCPT ); Fri, 13 Sep 2019 10:35:15 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8DEV2ZR017903; Fri, 13 Sep 2019 16:35:04 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=hryKjyfCxTA2dnqKEkk14SmwqqJ3l+c8gAOzB7s0IVA=; b=1JWVK43fjD4/dHSvcvQQk318CIAnOUS9PlDb7E9UrkKWBPkvLOhUQAA+ttkePsMr9ScY v0wAZe02xXOOEs86nn3WDwIkFM5mtjWroOoGGMLDl2qwUOIH66HYB7cTTIg+IAYvALCh kZQnAlRPHnrr5Tl1ndalpo8MgsdoDf9Vvs4x1jbD8DHDTqb9eqUiN9gccv3tzRD7a5EE J7ySaocVq0CY8t3500m9LLJZw0LCl+BXRu5K6iXGlSKhSyF3nFfzhqJSZuAVclPByQ+O 1CO7mK+J599J6GnWVml4gJfm+UleSNeDdyiazE6r5inJcWzejyHzDP79Tvg/Q5Lrt5oQ KQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uytdx5n8a-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 13 Sep 2019 16:35:04 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 3639D50; Fri, 13 Sep 2019 14:35:01 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 917192C86AE; Fri, 13 Sep 2019 16:35:00 +0200 (CEST) Received: from SAFEX1HUBCAS22.st.com (10.75.90.92) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 13 Sep 2019 16:35:00 +0200 Received: from localhost (10.48.1.232) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 13 Sep 2019 16:35:00 +0200 From: Fabrice Gasnier To: CC: , , , , , , , Subject: [PATCH 3/3] ARM: dts: stm32: enable ADC support on stm32mp157a-dk1 Date: Fri, 13 Sep 2019 16:34:40 +0200 Message-ID: <1568385280-2633-4-git-send-email-fabrice.gasnier@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1568385280-2633-1-git-send-email-fabrice.gasnier@st.com> References: <1568385280-2633-1-git-send-email-fabrice.gasnier@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.48.1.232] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-13_07:2019-09-11,2019-09-13 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/arm/boot/dts/stm32mp157a-dk1.dts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm/boot/dts/stm32mp157a-dk1.dts b/arch/arm/boot/dts/stm32mp157a-dk1.dts index ebd9f33..2f42fcd 100644 --- a/arch/arm/boot/dts/stm32mp157a-dk1.dts +++ b/arch/arm/boot/dts/stm32mp157a-dk1.dts @@ -97,6 +97,33 @@ }; }; +&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>; -- 2.7.4