Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp4745180pxb; Mon, 28 Mar 2022 02:40:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyATK9baJ1rfqsX6l1RdroTkw/FyabUOWLdCD7srwyLZspx9+DRV20476RpdBKrg1RKyCwP X-Received: by 2002:a17:906:154c:b0:6ce:21d7:2826 with SMTP id c12-20020a170906154c00b006ce21d72826mr26389063ejd.9.1648460439541; Mon, 28 Mar 2022 02:40:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648460439; cv=none; d=google.com; s=arc-20160816; b=0dxuUPWCWg3l7SHeDsWA3Q+F+r9JU8awgsIuV82vpfOTVe/fYwDN5Be15yshG7r/Wk KJJvIQOI4Lm/h3I/pwEEzbV2bTNHHslXUxPJrOcGRvhnu7gKY98B03GgBIoY89kN1vpc X90NtpUBbIHTgKu3vwH7XGDrnnQV3zqCUdbr3Vfy04qA3KAMRzXYUzQQH041bhD2VN2p XnLv/T/TzxupENEEX9zDNU+78/m4K7Y1HKVpRy6RdHriYpWB4fMd1fCdS2Sd+nP7cgUy etNNfPQ66r4Kvc5MSPDOHjClLAOJqpz4zQR2I8f2lfEEHnhpthuIKdWqOcB2lSTE/WVt MHtw== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=2uI/hn8gD0qeQrDVuUC95vBWCtv7QYykkVC74FaVNh4=; b=0Y76/9DFMXrOlTyN5+vs9zDftRHdhtEbXNMf65wlrgA4gT/rEdAbDaY52G/eXbcmGJ qSGiJFC1UGrYMwSWwYRks1oK5kuIZpF2QvI7RPrOZ4jdsG91RyY08W6p9dsSYSdxBowl DAqMnp4v9+D35Cfmp0iN572Dj49Fl7baG8W7asTp0tmQHz6VvTaq17AepHZ/MTjciQHy KRqDqLRmRo7sD66Yp5mS6sSTPd5xo3yNK07ECe3RFQPfEXLxUUFreBNH/xRLO1pMfYkj sjnWBc9+i7BQLC0R0Hf2iybusCEJN4yRf5/f0FHVj84iZ1do0T215H3EEoMRDPY6Nlh9 B08g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="pc8P3/fm"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l23-20020a056402029700b0041933337939si12684230edv.97.2022.03.28.02.40.12; Mon, 28 Mar 2022 02:40:39 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b="pc8P3/fm"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235960AbiC0QHz (ORCPT + 99 others); Sun, 27 Mar 2022 12:07:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230232AbiC0QHx (ORCPT ); Sun, 27 Mar 2022 12:07:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B1FC12617; Sun, 27 Mar 2022 09:06:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 14A39B80BFA; Sun, 27 Mar 2022 16:06:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A56A8C340EC; Sun, 27 Mar 2022 16:06:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648397171; bh=hInmacrtqqLCdMotd9oxcwLtJbwkVKG97iU/e/STNnk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pc8P3/fmvIb2IQx5O871aJOyhREnvqIDmex0+sOUHG2RVUHs5rzDKGvWqCs8qY5/2 YOt+Ou3wzKTRnISQeAnWqWmegSjYKsimFBOJjVHs6Ehtd+AsPPIzk+ol+4G6qXX7aB 40O9SIHJPnTcLgM0fmvuCfR3EMc50PRUf2PIMn2sPIRyjRDemvcaDFiP8UejGpWG3l FjWPgyeb198uLZWEgGdN+F2exmzLZ4s7sAQKGI1t72fFfNIpPeVCbsKwYSdS6R8l5U kOwUvhj/DQD1W26rQKnU1ZcazYmPSFTNmu7rI4uZosUBK4B6K708m4VFRlhH9rorNa 5vLdpMhsADq3g== Date: Sun, 27 Mar 2022 17:13:43 +0100 From: Jonathan Cameron To: "H. Nikolaus Schaller" Cc: Colin Ian King , Sergiu Cuciurean , Julia Lawall , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, kernel@pyra-handheld.com, linux-omap@vger.kernel.org Subject: Re: [PATCH] iio: palmas: shut up warning about calibration mismatch (due to noise) Message-ID: <20220327171343.28d582e7@jic23-huawei> In-Reply-To: <18533164-C17A-4CA1-A882-5A160D370498@goldelico.com> References: <1cee45bfc3fa2ab59dcc17242fb52468035360a1.1646743982.git.hns@goldelico.com> <20220320155259.0fc79dd3@jic23-huawei> <18533164-C17A-4CA1-A882-5A160D370498@goldelico.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Sun, 20 Mar 2022 17:28:21 +0100 "H. Nikolaus Schaller" wrote: > Hi Jonathan, > > > Am 20.03.2022 um 16:52 schrieb Jonathan Cameron : > > > > On Tue, 8 Mar 2022 13:53:03 +0100 > > "H. Nikolaus Schaller" wrote: > > > >> Although technically checking for ADC values below 0 is correct, > >> because they are outside of the calibration values, there is usually > >> noise which spuriously fills the console log with error messages if > >> calculated input voltage gets close to 0V. > >> > >> Ignore small negative calculated values, but clamp them to 0. > >> > >> Signed-off-by: H. Nikolaus Schaller > > Hi. > > > > Should we treat this as a fix or a cleanup? > > > > I don't mind either way. > > I don't mind either since we have it for long time in our distribution kernel. > > BR and thanks, > Nikolaus Treated as cleanup so applied to the togreg branch of iio.git, but for now only pushed out as testing because I'll be rebasing on rc1 next week. Thanks, Jonathan > > > > > Jonathan > > > > > >> --- > >> drivers/iio/adc/palmas_gpadc.c | 3 ++- > >> 1 file changed, 2 insertions(+), 1 deletion(-) > >> > >> diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c > >> index f9c8385c72d3..bcfa6a7f6cb2 100644 > >> --- a/drivers/iio/adc/palmas_gpadc.c > >> +++ b/drivers/iio/adc/palmas_gpadc.c > >> @@ -376,7 +376,8 @@ static int palmas_gpadc_get_calibrated_code(struct palmas_gpadc *adc, > >> adc->adc_info[adc_chan].gain_error; > >> > >> if (val < 0) { > >> - dev_err(adc->dev, "Mismatch with calibration\n"); > >> + if (val < -10) > >> + dev_err(adc->dev, "Mismatch with calibration var = %d\n", val); > >> return 0; > >> } > >> > > >