From mboxrd@z Thu Jan 1 00:00:00 1970 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 A7B83C54E64 for ; Mon, 25 Mar 2024 08:32:54 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uOsFikM+ikI1fYM9l6mQ89m9c+8KD+U3Wog8OhKNP1A=; b=dXT/frLAkMiSJ6 4MT9jdu5FeKpoLZCGLdUA3N2nq43/QzMUfXyRduC7bJ7hFldSW0fYJ1u85eSD/UnpFGQx97ruB/RG PnlHAo6Nx8I2yW1iwzVtj5HNr8namnVnZa2VDFfd/JX+dyXd70x2NVEtDlPwmPneE0/M2XGUtiiC7 Zda/C5qQpGUGOevt7qVFl7wjxkaJOL4gg3NbCMno4+ehYgSMERy3DAEiBtbecPz9w3lWimJf6UGWC 7vcyBk0MLReO6PKUAbAVgsclfSFb3mj+pXnVWtJFuqJ/RfGR8jYdS/JnLcpw01PUa7+pBfLI5Rvls m2RdVmTL3sqX1hsWVlMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rofl7-0000000GB5k-1t8H; Mon, 25 Mar 2024 08:32:45 +0000 Received: from cpanel.siel.si ([46.19.9.99]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rofl4-0000000GB3Q-03AW for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2024 08:32:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=norik.com; s=default; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=YrCunCuDAyPCrU96nP770AWQf4NmnthgUBMgNyJAu48=; b=RQbj2c4f2qRXjxr4gX4KrktSa7 6pyVjGvANCdMY6rnYJZKgB2zZmHJ3xsm0+Wixre/iPhruVV6Q8Rr5rOQylqcDU4EcbRPViemr4e6c J0VLDwjgtUPZCykZG5tFV6kGJXBIeB1sGDCPaB4tNwMw4sU862lgtI/zeHmQaAvjFUK+EYzG19ZXZ Oi75f0rgsWuFu+iC6Z0ucvxHveT9Rk9Eobz2AOGtM7Y48GjhOEfiwnDCOnH+kIRM3BXlyPhmHqOxL YwJqunzsdxF4bC5Gq2g9OUn4h3B9qP2ONgFqhpyU7B6Sfv55eWTaneVMl4RZx28Ckwe1wBEkatnTK pNPIk68A==; Received: from [89.212.21.243] (port=33976 helo=[192.168.69.84]) by cpanel.siel.si with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96.2) (envelope-from ) id 1rofky-009ZHa-1T; Mon, 25 Mar 2024 09:32:36 +0100 Message-ID: <3423ea96-859d-4c4b-a9a7-e0d9c3c00727@norik.com> Date: Mon, 25 Mar 2024 09:32:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/2] i.MX93 ADC calibration settings Content-Language: en-GB To: Jonathan Cameron Cc: haibo.chen@nxp.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, lars@metafoo.de, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, upstream@lists.phytec.de References: <20240320100407.1639082-1-andrej.picej@norik.com> <20240324135559.1640551d@jic23-huawei> From: Andrej Picej In-Reply-To: <20240324135559.1640551d@jic23-huawei> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel.siel.si X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - norik.com X-Get-Message-Sender-Via: cpanel.siel.si: authenticated_id: andrej.picej@norik.com X-Authenticated-Sender: cpanel.siel.si: andrej.picej@norik.com X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240325_013242_670785_BCE2CDF6 X-CRM114-Status: GOOD ( 14.78 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Jonathan, On 24. 03. 24 14:55, Jonathan Cameron wrote: > On Wed, 20 Mar 2024 11:04:04 +0100 > Andrej Picej wrote: > >> Hi all, >> >> we had some problems with failing ADC calibration on the i.MX93 boards. >> Changing default calibration settings fixed this. The board where this >> patches are useful is not yet upstream but will be soon (hopefully). > > Tell us more. My initial instinct is that this shouldn't be board specific. > What's the trade off we are making here? Time vs precision of calibration or > something else? If these are set to a level by default that doesn't work > for our board, maybe we should just change them for all devices? > So we have two different boards with the same SoC. On one, the calibration works with the default values, on the second one the calibration fails, which makes the ADC unusable. What the ADC lines measure differ between the boards though. But the implementation is nothing out of the ordinary. We tried different things but the only thing that helped is to use different calibration properties. We tried deferring the probe and calibration until later boot and after boot, but it did not help. In the Reference Manual [1] (chapter 72.5.1) it is written: > 4. Configure desired calibration settings (default values kept for highest accuracy maximum time). So your assumption is correct, longer calibration time (more averaging samples) -> higher precision. The default values go for a high accuracy. And since we use a NRSMPL (Number of Averaging Samples) of 32 instead of default 512, we reduce the accuracy so the calibration values pass the internal defined limits. I'm not sure that changing default values is the right solution here. We saw default values work with one of the boards. And since the NXP kept these values adjustable I think there is a reason behind it. Note: When I say one of the boards I mean one board form. So same board version, but different HW. Best regards, Andrej [1] i.MX 93 Applications Processor Reference Manual, Rev. 4, 12/2023 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel