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 v2] iio: adc: ade9000: fix wrong register in CALIBBIAS case for active power
Date: Thu, 26 Feb 2026 16:36:35 +0200 [thread overview]
Message-ID: <aaBac7SCMEOrom6Y@smile.fi.intel.com> (raw)
In-Reply-To: <20260226140700.481317-3-giorgitchankvetadze1997@gmail.com>
On Thu, Feb 26, 2026 at 06:07:02PM +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.
>
> Reference:ADE9000 datasheet (Rev. B), AWATTOS is the offset correction
> register at 0x00F (p. 44), while AWATT is the total active power
> register at 0x210 (p. 48).
Please, avoid sending a new version earlier than 24h after the previous one!
I think the best who can review this is somebody with HW. Preferably
one from vendor company.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-02-26 14:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 14:07 [PATCH v2] iio: adc: ade9000: fix wrong register in CALIBBIAS case for active power Giorgi Tchankvetadze
2026-02-26 14:36 ` Andy Shevchenko [this message]
2026-02-27 10:01 ` Miclaus, Antoniu
2026-02-28 13:18 ` 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=aaBac7SCMEOrom6Y@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