]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Jun 2025 10:43:57 +0000 (12:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Jun 2025 10:43:57 +0000 (12:43 +0200)
added patches:
iio-adc-ad7606_spi-fix-reg-write-value-mask.patch

queue-5.4/iio-adc-ad7606_spi-fix-reg-write-value-mask.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/iio-adc-ad7606_spi-fix-reg-write-value-mask.patch b/queue-5.4/iio-adc-ad7606_spi-fix-reg-write-value-mask.patch
new file mode 100644 (file)
index 0000000..b9bb7e6
--- /dev/null
@@ -0,0 +1,35 @@
+From 89944d88f8795c6c89b9514cb365998145511cd4 Mon Sep 17 00:00:00 2001
+From: David Lechner <dlechner@baylibre.com>
+Date: Mon, 28 Apr 2025 20:55:34 -0500
+Subject: iio: adc: ad7606_spi: fix reg write value mask
+
+From: David Lechner <dlechner@baylibre.com>
+
+commit 89944d88f8795c6c89b9514cb365998145511cd4 upstream.
+
+Fix incorrect value mask for register write. Register values are 8-bit,
+not 9. If this function was called with a value > 0xFF and an even addr,
+it would cause writing to the next register.
+
+Fixes: f2a22e1e172f ("iio: adc: ad7606: Add support for software mode for ad7616")
+Signed-off-by: David Lechner <dlechner@baylibre.com>
+Reviewed-by: Angelo Dureghello <adureghello@baylibre.com>
+Link: https://patch.msgid.link/20250428-iio-adc-ad7606_spi-fix-write-value-mask-v1-1-a2d5e85a809f@baylibre.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/adc/ad7606_spi.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/iio/adc/ad7606_spi.c
++++ b/drivers/iio/adc/ad7606_spi.c
+@@ -151,7 +151,7 @@ static int ad7606_spi_reg_write(struct a
+       struct spi_device *spi = to_spi_device(st->dev);
+       st->d16[0] = cpu_to_be16((st->bops->rd_wr_cmd(addr, 1) << 8) |
+-                                (val & 0x1FF));
++                                (val & 0xFF));
+       return spi_write(spi, &st->d16[0], sizeof(st->d16[0]));
+ }
index 142ca65d87d708fcd79fa6e8f56ce2f25e40fd10..dc09eb1b11095112e88dd5823abb29bcb0b8706f 100644 (file)
@@ -131,3 +131,4 @@ regulator-max14577-add-error-check-for-max14577_read_reg.patch
 uio_hv_generic-use-correct-size-for-interrupt-and-monitor-pages.patch
 pci-add-acs-quirk-for-loongson-pcie.patch
 pci-fix-lock-symmetry-in-pci_slot_unlock.patch
+iio-adc-ad7606_spi-fix-reg-write-value-mask.patch