All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Cong Nguyen <congnt264@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"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, 10 Aug 2026 20:04:23 +0300	[thread overview]
Message-ID: <anoElwDzKRBoHTcA@ashevche-desk.local> (raw)
In-Reply-To: <20260810164446.2555239-1-congnt264@gmail.com>

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>

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-08-10 17:04 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 [this message]
2026-08-17  1:03   ` 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=anoElwDzKRBoHTcA@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=congnt264@gmail.com \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.