]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: adc: ad7606: move scale_setup as function pointer on chip-info
authorAlexandru Ardelean <aardelean@baylibre.com>
Thu, 19 Sep 2024 13:04:38 +0000 (16:04 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 30 Sep 2024 08:21:04 +0000 (09:21 +0100)
commite571c1902116a376c96e59639820662d7d6a13da
treedc138ea764b98d2c3d9f117e088a6b0d5a05d478
parentd2041446a716a0086436124e8f97bac980ba71bc
iio: adc: ad7606: move scale_setup as function pointer on chip-info

Up until now, all ADCs were 16-bit precision.
With the addition of the AD7606C some things will change. For one thing,
we'll need to setup available-scales for each channel. Also for the 18-bit
precision variants, the scales will be different.

This change adds a function-pointer to the chip-info struct to be able to
set this up (differently) for the new parts. For the current parts, the
scales are the same (for all parts) between HW and SW modes.

Also creating a 'ad7606_sw_mode_setup()' function that must be called
before the scale_setup callback. This is needed in case SW mode is enabled
for some ADCs.

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