From patchwork Tue Nov 15 10:31:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier MOYSAN X-Patchwork-Id: 1659 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2639694wru; Tue, 15 Nov 2022 02:39:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf66Yn4RP5d4maFwMCRb+B4abmSKxbVMsfOWjRQElbf+xO3wzRwwEVUsEDn7KejlR2JvUkup X-Received: by 2002:a05:6402:1d96:b0:458:ad54:20d5 with SMTP id dk22-20020a0564021d9600b00458ad5420d5mr14103991edb.86.1668508761649; Tue, 15 Nov 2022 02:39:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668508761; cv=none; d=google.com; s=arc-20160816; b=cqGuMVfB6E1XAXEgSvhWCxG+fKj7bppGS/PWYqa25HM2IY2Py/fAWW2sS6R5U0KaVO 5JC25jfXEgZozzOtHi/ltmUZQSmMAF2uUJ9vSOtVe0vyloYpKQeBmzDgz4GShmMYc1ul /MHiAOrrfeSWNlbGRwcIYiqNOBGDnEMZxmHLEcHYS0NXM75vQ+hv4zBrZxsgr74RlrMN sO867nyoHHYK274liPo/ukRaSOAJGR9HAyBwwg6TipIfswc1OKbDPRl+XFu/PvHYMKXl v4cm2k2DgIoY4pk2WmK2dhtTf0XQ1hOSNYyKki8CDNtUowl6XAWL6YCFhRaA9GtHddmd d8bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=FR3Ak5brVAj0TlAyXv0t45EkwjMIibLUzSL/a8UA32Y=; b=EfiUqMTgoJGcnF54Rb7xkCwbQ3rmPNSMENhoUwTdKQF6V8hApt3G4y+N6BN5ArLuod fE7IY1HK4H80/TwJUNUuev9ClJl4IbfBnWcYAZYNg7gszepTGb/PcTWFZECoZXtftF0m +c18ODAYr7lX2SHqw2/7RRuvA10H1c0QAlf/iVHUggvkYb1sQ3ZbObOIY31Ey4NBMkNO X1g4o95S0QuxW6Y77tJY1DQNVA/VabaUUME0an2tV55NLPuNIV01p4beWcMOZGQZ5rk2 lCGBR44mw1yDpBkIHqpIaw4Rjbt4pfjMayJaa63EowsIOpRRbbq5GtXhUdijQ3aL0VJh 7RMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=4eWMyPtx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r9-20020a05640251c900b00459c2ac54e2si10413270edd.255.2022.11.15.02.38.57; Tue, 15 Nov 2022 02:39:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=4eWMyPtx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238130AbiKOKfR (ORCPT + 99 others); Tue, 15 Nov 2022 05:35:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238141AbiKOKfF (ORCPT ); Tue, 15 Nov 2022 05:35:05 -0500 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75366A1B8; Tue, 15 Nov 2022 02:35:02 -0800 (PST) Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AFA1qNU007476; Tue, 15 Nov 2022 11:34:36 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=selector1; bh=FR3Ak5brVAj0TlAyXv0t45EkwjMIibLUzSL/a8UA32Y=; b=4eWMyPtx3hpJFKJ43kinjBtc1124Of87Q+elsX3OObiU5Jc8YLzyetXuU1BSAimW1VD5 SxrT0uItxMjx7SqIpZNtAVzICG3d5vnRi+oivbQRPoV3t4OMb16VdTBezbtVdR3DPEam UT3Bab0fG3F3WqN9/ryZhlb0psPVqCnEtoamvg3ACsaTlFOjKaZAgoJvq04ckuGjJP2v bWfwa33Z8hGIYHDGvC+tZq7F5APTC4SY6mC+xHgqg6h+pDTODyG7+/wBm+WhC8ynbrQ+ d4Lz0T/c9C1NbbfBx7ZJAAaX1MPlKHLJ3vqrYq2COZtlogdYK6igzJKN8DEvnzfwXlDv 3Q== 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 3ktq2ynedv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Nov 2022 11:34:36 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2768510002A; Tue, 15 Nov 2022 11:34:31 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 2042321A206; Tue, 15 Nov 2022 11:34:31 +0100 (CET) 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.2375.32; Tue, 15 Nov 2022 11:34:30 +0100 From: Olivier Moysan To: , Jonathan Cameron , Lars-Peter Clausen , Maxime Coquelin , Alexandre Torgue CC: Olivier Moysan , , , , Subject: [PATCH 0/3] iio: adc: stm32: add smart calibration Date: Tue, 15 Nov 2022 11:31:20 +0100 Message-ID: <20221115103124.70074-1-olivier.moysan@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.201.20.178] X-ClientProxiedBy: EQNCAS1NODE4.st.com (10.75.129.82) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-15_05,2022-11-15_01,2022-06-22_01 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749558243552095727?= X-GMAIL-MSGID: =?utf-8?q?1749558243552095727?= Refine offset and linear calibration strategy for STM32MP15 and STM32MP13 SoCs: - offset calibration This calibration depends on factors such as temperature and voltage. As it is not time consuming, it's worth doing it on each ADC start, to get the best accuracy. There is no need to save these data. - linear calibration This calibration is basically SoC dependent, so it can be done only once. When this calibration has been performed at boot stage, the ADC kernel driver can retrieve the calibration data from the ADC registers. Otherwise, the linear calibration is performed once by the ADC driver. The backup of these data, allows to restore them on successive ADC starts. Olivier Moysan (3): iio: adc: stm32-adc: smart calibration support iio: adc: stm32-adc: improve calibration error log iio: adc: stm32-adc: add debugfs to read raw calibration result drivers/iio/adc/stm32-adc-core.h | 1 + drivers/iio/adc/stm32-adc.c | 135 ++++++++++++++++++------------- 2 files changed, 78 insertions(+), 58 deletions(-) Reviewed-by: Fabrice Gasnier