From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Cong Nguyen" <congnt264@gmail.com>,
"Andy Shevchenko" <andy@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] iio: adc: max1363: sign-extend bipolar differential channel reads
Date: Mon, 17 Aug 2026 02:03:35 +0100 [thread overview]
Message-ID: <20260817020335.347796c4@jic23-huawei> (raw)
In-Reply-To: <anoElwDzKRBoHTcA@ashevche-desk.local>
On Mon, 10 Aug 2026 20:04:23 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Mon, Aug 10, 2026 at 11:44:46PM +0700, Cong Nguyen wrote:
> > MAX1363 differential channels are bipolar (scan_type.sign = 's'), but
>
> The (...) can also be dropped, but I leave that to Jonathan, no need to resend.
>
> > max1363_read_single_chan() masks the raw value to the ADC resolution
> > without sign-extending it. Negative differential readings are therefore
> > reported to userspace as large positive values (e.g. -1 as 4095 on a
> > 12-bit part).
> >
> > Sign-extend the masked value from the resolution bit for differential
> > channels. Single-ended channels are unipolar and are left unchanged.
>
> Now looks good to me,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Applied. Amazing that's sat there for so long given it is
a reasonably common part. Oops - that younger me wrote just
as many bugs as the current version ;)
On the fixes-togreg branch but unlikely I'll do a pull request
until I've rebased that on 7.3-rc1 in a few weeks time.
Jonathan
>
prev parent reply other threads:[~2026-08-17 1:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 16:44 [PATCH v2] iio: adc: max1363: sign-extend bipolar differential channel reads Cong Nguyen
2026-08-10 17:04 ` Andy Shevchenko
2026-08-17 1:03 ` 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=20260817020335.347796c4@jic23-huawei \
--to=jic23@kernel.org \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=congnt264@gmail.com \
--cc=dlechner@baylibre.com \
--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