]> git.ipfire.org Git - thirdparty/linux.git/commit
iio: adc: ti-ads8688: use read_avail for available attributes
authorGabriel Rondon <grondon@gmail.com>
Mon, 30 Mar 2026 18:15:27 +0000 (19:15 +0100)
committerJonathan Cameron <jic23@kernel.org>
Mon, 27 Apr 2026 08:58:19 +0000 (09:58 +0100)
commit7328d444c19eb31a2b6033969ff4fd170309326c
tree573574e00b38c56c6361a28551aca17953c5d491
parent5bcbbcfb7c91b9ab759397d7ca5b317a87284665
iio: adc: ti-ads8688: use read_avail for available attributes

Convert the in_voltage_scale_available and in_voltage_offset_available
attributes from legacy IIO_DEVICE_ATTR with custom show functions to the
IIO framework's read_avail callback. This uses the framework's built-in
support for _available attributes, removing the need for manual sysfs
formatting.

Precompute the available scale values at probe time since they depend on
the reference voltage which does not change after initialization.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ti-ads8688.c