Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Marcelo Schmitt" <marcelo.schmitt@analog.com>
Subject: Re: [PATCH v2] iio: adc: ad7124: fix temperature channel
Date: Sun, 12 Oct 2025 20:07:50 +0100	[thread overview]
Message-ID: <20251012200750.059b9e77@jic23-huawei> (raw)
In-Reply-To: <l6bq6yqq6iqac3jlnwhzpymbne5e2ulkupl544qlyot3po546g@5seccwwkxrns>

On Sun, 12 Oct 2025 14:47:13 +0200
Uwe Kleine-König <u.kleine-koenig@baylibre.com> wrote:

> Hello David,
> 
> On Fri, Oct 10, 2025 at 03:24:31PM -0500, David Lechner wrote:
> > Fix temperature channel not working due to gain and offset not being
> > initialized.  For channels other than the voltage ones calibration is
> > skipped (which is OK).  However that results in the calibration register
> > values tracked in st->channels[i].cfg all being zero.  These zeros are
> > later written to hardware before a measurement is made which caused the
> > raw temperature readings to be always 8388608 (0x800000).
> > 
> > To fix it, we just make sure the gain and offset values are set to the
> > default values and still return early without doing an internal
> > calibration.
> > 
> > While here, add a comment explaining why we don't bother calibrating
> > the temperature channel.
> > 
> > Fixes: 47036a03a303 ("iio: adc: ad7124: Implement internal calibration at probe time")
> > Reviewed-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
> > Signed-off-by: David Lechner <dlechner@baylibre.com>
> > ---
> > Changes in v2:
> > - Improved commit message.
> > - Expanded code comment.  
> 
> I like both improvements, thanks!
> 
> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>

Applied to the temporary branch I'm queuing fixes on until I can rebase on rc1.
+ marked for stable.

      reply	other threads:[~2025-10-12 19:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-10 20:24 [PATCH v2] iio: adc: ad7124: fix temperature channel David Lechner
2025-10-12 12:47 ` Uwe Kleine-König
2025-10-12 19:07   ` Jonathan Cameron [this message]

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=20251012200750.059b9e77@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt@analog.com \
    --cc=nuno.sa@analog.com \
    --cc=u.kleine-koenig@baylibre.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