Re: [PATCH v3] iio: adc: ti-ads8688: use read_avail for available attributes

From: Andy Shevchenko

Date: Tue Mar 31 2026 - 04:10:30 EST


On Mon, Mar 30, 2026 at 07:15:27PM +0100, grondon@xxxxxxxxx wrote:

> 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: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>

(Still BIT_Ux() may be used to avoid overflow warnings.)


--
With Best Regards,
Andy Shevchenko