From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Cc: antoniu.miclaus@analog.com, lars@metafoo.de,
Michael.Hennerich@analog.com, jic23@kernel.org,
dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: ade9000: fix wrong register in CALIBBIAS case
Date: Thu, 26 Feb 2026 15:44:05 +0200 [thread overview]
Message-ID: <aaBOJWYk5xvLo2FB@smile.fi.intel.com> (raw)
In-Reply-To: <20260226133741.437403-2-giorgitchankvetadze1997@gmail.com>
On Thu, Feb 26, 2026 at 05:37:42PM +0400, Giorgi Tchankvetadze wrote:
> The switch statement in ade9000_write_raw() attempts to match
> chan->address against ADE9000_REG_AWATTOS (0x00F) to dispatch
> the calibration offset write for active power channels. However,
> chan->address is set via ADE9000_ADDR_ADJUST(ADE9000_REG_AWATT,
> num), so after masking the phase bits, tmp holds
> ADE9000_REG_AWATT (0x210), which never matches 0x00F.
>
> As a result, writing IIO_CHAN_INFO_CALIBBIAS for IIO_POWER always
> falls through to the default case and returns -EINVAL, making
> active power offset calibration silently broken.
>
> Fix this by matching against ADE9000_REG_AWATT instead, which is
> the actual base address stored in chan->address for watt channels.
Sounds like a good fix, but:
- needs a Fixes tag
- needs a reference to datasheet section / table / et cetera to prove the point
Also, how did you found this? Code inspection? Testing on real HW?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-02-26 13:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 13:37 [PATCH] iio: adc: ade9000: fix wrong register in CALIBBIAS case Giorgi Tchankvetadze
2026-02-26 13:44 ` Andy Shevchenko [this message]
2026-02-26 14:05 ` Giorgi Tchankvetadze
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=aaBOJWYk5xvLo2FB@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=dlechner@baylibre.com \
--cc=giorgitchankvetadze1997@gmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@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