]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: ad7606: move 'val' pointer to ad7606_scan_direct()
authorAlexandru Ardelean <aardelean@baylibre.com>
Thu, 19 Sep 2024 13:04:37 +0000 (16:04 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 30 Sep 2024 08:21:04 +0000 (09:21 +0100)
commitd2041446a716a0086436124e8f97bac980ba71bc
treeffac92d09573b21543c504d300d6b04aa08d8015
parent300a90a6ba644cfcea75e5585e74a0e5fd46b94a
iio: adc: ad7606: move 'val' pointer to ad7606_scan_direct()

The ad7606_scan_direct() function returns 'int', which is fine for 16-bit
samples.
But when going to 18-bit samples, these need to be implemented as 32-bit
(or int) type.

In that case when getting samples (which can be negative), we'd get random
error codes.
So, the easiest thing is to just move the 'val' pointer to
'ad7606_scan_direct()'. This doesn't qualify as a fix, it's just a
preparation for 18-bit ADCs (of the AD7606 family).

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Alexandru Ardelean <aardelean@baylibre.com>
Link: https://patch.msgid.link/20240919130444.2100447-3-aardelean@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7606.c