From patchwork Tue May 30 12:45:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Moysan X-Patchwork-Id: 13259979 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7324C77B73 for ; Tue, 30 May 2023 12:47:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zBqBbUF13ZxftJ/y4WbnAbw+NsDfeRKc37nwAZJZOwI=; b=HW0AgwAhdsOIhr LDlg/fdjhQTE/Z7GFVb1QDX0Ovsm3BOCZoo56Kgt9QMYCGEJEck0HZMDx8J41/IxjQTC/HfF0DiEn HaVkUEF2CXApYbbNC/NR/IFEySIz80A6bVeJleKWLtOCx/oGJPPasHAt6w6jvREfc2hvjgplbvNI8 3u/u8bNz3PYwzeoA7hsc/didUj+6b7Y3A8+Vrgb0zLAiIkvcifVFdpTIo14X4aSGnhKsp6+sLmvbl vIVlRCONwsTZIPurC3wK5PDE9cofRlcnRzzkr9DXa/dE0aEr4n/qjDhKIQLdIxwnrhmu112PdDyqS PE/1K9YfyqPFtKFkfEOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q3yl4-00DutF-1h; Tue, 30 May 2023 12:47:26 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q3yl1-00DurA-0F for linux-arm-kernel@lists.infradead.org; Tue, 30 May 2023 12:47:24 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34UC5UDX018243; Tue, 30 May 2023 14:47:16 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=Tvfrm/SClKPXJ+Bcvot4iUqoxk3JAMST0yYmkqmtgDs=; b=guAo0Ke2/Oq/rND0RKy/3TQx2FlloTnvBGidgmd8uAaa1l5qrb5K9VllqEII91m3Zx4B MN7Y+uUi5y64wuj/cittyNy0LkqIughbvJiohfBDDAfjETQHUPl/9di/INkmMDjsKZm/ mXY9Zh1R7cw2tOUwLZwPRAN83LIieNLxDQaRKkqCoew7GRQZ/OhmNSTOyPigM9WBjTai TUsd5IFw3w59mhkO0lunEUFTczyR/czlmLAziiYmKwO1Ty1lG/Qg9UxzN0jPlYFBTSPh 6edPhiWCBvaTFjA/6eNiKq3zuvhizVZnVDom90tl3KedUczEvQk9p0OWPtIQ7ePe0kp+ rA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3qwdm5hs5f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 May 2023 14:47:16 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 255F410002A; Tue, 30 May 2023 14:47:16 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 1E2A52248D6; Tue, 30 May 2023 14:47:16 +0200 (CEST) Received: from localhost (10.201.20.178) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Tue, 30 May 2023 14:47:15 +0200 From: Olivier Moysan To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue CC: Olivier Moysan , , , , Subject: [PATCH v2 3/9] ARM: dts: stm32: add vrefint support to adc2 on stm32mp15 Date: Tue, 30 May 2023 14:45:31 +0200 Message-ID: <20230530124538.621760-4-olivier.moysan@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230530124538.621760-1-olivier.moysan@foss.st.com> References: <20230530124538.621760-1-olivier.moysan@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.178] X-ClientProxiedBy: EQNCAS1NODE3.st.com (10.75.129.80) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-30_09,2023-05-30_01,2023-05-22_02 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230530_054723_404744_0CBBE4D5 X-CRM114-Status: GOOD ( 17.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Set STM32 ADC2 as a consumer of BSEC on STM32MP15, to retrieve vrefint calibration data saved in OTP. During the calibration process vrefp is set to 3.3V and the data acquired is saved to the OTP. This data is used by the ADC driver to calculated the actual value of vrefp according to the formula: vrefp = 3.3 x vrefint_cal / vrefint_data The vrefint channel provides the actual value of vrefp, which can be used to correct ADC acquisition data. Signed-off-by: Olivier Moysan --- arch/arm/boot/dts/stm32mp151.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi index 3d0c39d847b5..61508917521c 100644 --- a/arch/arm/boot/dts/stm32mp151.dtsi +++ b/arch/arm/boot/dts/stm32mp151.dtsi @@ -1113,6 +1113,8 @@ adc2: adc@100 { interrupts = <1>; dmas = <&dmamux1 10 0x400 0x01>; dma-names = "rx"; + nvmem-cells = <&vrefint>; + nvmem-cell-names = "vrefint"; status = "disabled"; channel@13 { reg = <13>;