Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2244632pxp; Mon, 21 Mar 2022 14:50:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyL3g6jnT6VVXh824iubJhW6SuhEGadZsnbFqcPjdWcdb4LUVIeHVBk+0khdcNZ/+SzqMYD X-Received: by 2002:a17:90a:7085:b0:1bd:3db8:6597 with SMTP id g5-20020a17090a708500b001bd3db86597mr1276060pjk.86.1647899434815; Mon, 21 Mar 2022 14:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647899434; cv=none; d=google.com; s=arc-20160816; b=NRkSe3VcYA0B8fyGFBeJkiatKPDE6J/v5yggKt6c4CTYbQ6xgpWu6VA4lHDAhrLB3l 1RLnvMOeNfVwdIw8rCA6sSu1EP0wI9HfWdGvY2U2itIjhTqqBmEI3LC+fkvf6blDpXbf 2KxU7QKGgObAonxGApXiANalKaRZKnzGdsFrYstmZXO8pMLXzCr2orCK/rShpAJo9VIL HMiOs0rL0qRTo5N5uLUboMusBvnFQzrNmj056zRYLb3OjtjOdL1fKVnkfmXnK4TNSZmK 3BCgGpIBLNx2+c0FgKS+EsKSkdJV03l/sAVpaz15+f053xGlLrS8GAcx3fNFcMhooAJ3 foZg== 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=1aSHe2CVucALCB9hGy+dfSTYKs0T/VKIu2kJs34AEWA=; b=yE2e2HyEFRUTGkJwM31C+SE4nA9fwTwXHPK3FSngJXTyEbZT6k+y/hkqygZElrdBX+ igXtJLWcnX6z6ANHtBtov7zaCzGzQFXAQgK1dHhsbTBaLQRCwjnwcO8vrEqBhXyMlcuU FsyJctVlF3iOi6Cw8l4q0sIf2Yho1VHrYSOEXrtEImzZgKldu/NdjgvAcl1iGyJGRyE9 2kFvPXuSo+JiD6NvPQz8ZX+Jc3i45zF6xjqei3wbQHPEn84AsZtszGZImBK0jFlCeEy0 n5aP4qkagTmOL+8OzCYJ8ByHbCB6K3stRSHIMKZYS5rMiLF9RIUbWh3sWOmZdxfG2lH/ kvQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YzLjCxph; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w16-20020a17090a461000b001c6a67af0e4si422735pjg.96.2022.03.21.14.50.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 14:50:34 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YzLjCxph; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D8AB9186EB; Mon, 21 Mar 2022 14:18:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245399AbiCTPrC (ORCPT + 99 others); Sun, 20 Mar 2022 11:47:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233295AbiCTPrB (ORCPT ); Sun, 20 Mar 2022 11:47:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E7093EA80; Sun, 20 Mar 2022 08:45:38 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 383B461173; Sun, 20 Mar 2022 15:45:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 447F0C340E9; Sun, 20 Mar 2022 15:45:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647791137; bh=MnUF6wCu+lWH4VvXQgRyL0zXXsXRlGEixv7B9idCdm0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YzLjCxph/GMrA5ekbgxwc8rsNBuZRV/sZmdrQEqkUoskYOE6GeFek46EKOMDLzi6m 2jfxaI/enLvin7gVW6JWUin2iwZsLCT4aYXTP+f7HwLHJNC0JkTOJfuv9KNgiy9uXO lfoAT0WBG6qoF76MZje/P8fI6S+IKcfqxCXdCyNdnfe0pORHN2aOWK/t/HZFWFo6/A J1krQ8yAFD2MFGZROh38QCYscasstEEzS+BEo3KSTFrDJyxvaWC/CGkmcZSjXla9Rb dB8a5IiS9uuoLn2VjHSIXJ4EaoFNxVMiGFi9JEFw/UH8sPVOigmeJ5qlmhBu4rsC0R LK3LXp4icorzQ== Date: Sun, 20 Mar 2022 15:52:59 +0000 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: <20220320155259.0fc79dd3@jic23-huawei> In-Reply-To: <1cee45bfc3fa2ab59dcc17242fb52468035360a1.1646743982.git.hns@goldelico.com> References: <1cee45bfc3fa2ab59dcc17242fb52468035360a1.1646743982.git.hns@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=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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. 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; > } >