]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: ad7606: rework scale-available to be static
authorAlexandru Ardelean <aardelean@baylibre.com>
Fri, 25 Oct 2024 09:59:37 +0000 (12:59 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 28 Oct 2024 20:04:10 +0000 (20:04 +0000)
commit97c6d857041dbde42061bef4a6cad2058b0153ed
tree73fb750e51550dc5cd7e3646e367713d97a2337c
parent0fb11344bb21bc63821f45d0953b2da8cf1ff4f8
iio: adc: ad7606: rework scale-available to be static

The main driver for this change is the AD7607 part, which has a scale of
"1.220703" for the ±10V range. The AD7607 has a resolution of 14-bits.

So, just adding the scale-available list for that part would require some
quirks to handle just that scale value.
But to do it more neatly, the best approach is to rework the scale
available lists to have the same format as it is returned to userspace.
That way, we can also get rid of the allocation for the 'scale_avail_show'
array.

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