Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Colin Ian King <colin.king@intel.com>,
	Sergiu Cuciurean <sergiu.cuciurean@analog.com>,
	Julia Lawall <Julia.Lawall@inria.fr>,
	Lars-Peter Clausen <lars@metafoo.de>,
	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)
Date: Sun, 20 Mar 2022 15:52:59 +0000	[thread overview]
Message-ID: <20220320155259.0fc79dd3@jic23-huawei> (raw)
In-Reply-To: <1cee45bfc3fa2ab59dcc17242fb52468035360a1.1646743982.git.hns@goldelico.com>

On Tue,  8 Mar 2022 13:53:03 +0100
"H. Nikolaus Schaller" <hns@goldelico.com> 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 <hns@goldelico.com>
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;
>  	}
>  


  reply	other threads:[~2022-03-20 15:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 12:53 [PATCH] iio: palmas: shut up warning about calibration mismatch (due to noise) H. Nikolaus Schaller
2022-03-20 15:52 ` Jonathan Cameron [this message]
2022-03-20 16:28   ` H. Nikolaus Schaller
2022-03-27 16:13     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220320155259.0fc79dd3@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Julia.Lawall@inria.fr \
    --cc=colin.king@intel.com \
    --cc=hns@goldelico.com \
    --cc=kernel@pyra-handheld.com \
    --cc=lars@metafoo.de \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=sergiu.cuciurean@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox