FAILED: patch "[PATCH] iio: adc: max1363: sign-extend bipolar differential channel" failed to apply to 5.10-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 91908c0a78baddc8572aa3ab69e62ee2eb496ba4
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026100625-reverse-alabaster-6736@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 91908c0a78baddc8572aa3ab69e62ee2eb496ba4 Mon Sep 17 00:00:00 2001
From: Cong Nguyen <[email protected]>
Date: Mon, 10 Aug 2026 23:44:46 +0700
Subject: [PATCH] iio: adc: max1363: sign-extend bipolar differential channel
reads
MAX1363 differential channels are bipolar, but 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.
drivers/iio/adc/max1363.c +8 -0
@@ -404,6 +404,14 @@ static int max1363_read_single_chan(struct iio_dev *indio_dev, data = rxbuf[0 ]; } + +/* +* Differential channels are bipolar and the device returns the sample +* in two's complement, so sign-extend it from the resolution bit. +*/ +if (chan->differential) + data =sign_extend32 (data, st->chip_info->bits -1 ); + *val = data;return 0 ;
Sasha Levin
maintainerPATCH 1/1 iio: adc: max1363: sign-extend bipolar differential channel reads
From: Cong Nguyen <[email protected]>
[ Upstream commit 91908c0a78baddc8572aa3ab69e62ee2eb496ba4 ]
MAX1363 differential channels are bipolar, but 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.
--- drivers/iio/adc/max1363.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/iio/adc/max1363.c +8 -0
@@ -409,6 +409,14 @@ static int max1363_read_single_chan(struct iio_dev *indio_dev, } data = rxbuf[0 ]; } + +/* +* Differential channels are bipolar and the device returns the sample +* in two's complement, so sign-extend it from the resolution bit. +*/ +if (chan->differential) + data =sign_extend32 (data, st->chip_info->bits -1 ); + *val = data; error_ret:
Signature · 1 line
2.53.0