]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: ad7380: fix event threshold shift
authorDavid Lechner <dlechner@baylibre.com>
Wed, 2 Apr 2025 23:55:58 +0000 (18:55 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 7 Apr 2025 18:32:50 +0000 (19:32 +0100)
commit2d7b60f33da324abe7824037b4829ff7df70e435
tree8e8418e1c17bc66dd3bf33676a00fdfb74e0f494
parent79dabbd505210e41c88060806c92c052496dd61c
iio: adc: ad7380: fix event threshold shift

Add required bit shift to the event threshold read function to get
correct scaling.

When alert support was added, the write function correctly included the
required shift needed to convert the threshold register value to the
same scale as the raw ADC value. However, the shift got missed in the
read function.

Fixes: 27d1a4dbe1e1 ("iio: adc: ad7380: add alert support")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20250402-iio-adc-ad7380-fix-event-threshold-shift-v1-1-ad4975c296b2@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7380.c