linux-stable/include/linux/iio
Nuno Sa 08715e4fa5 iio: adc: ad9467: fix scale setting
[ Upstream commit b73f08bb7f ]

When reading in_voltage_scale we can get something like:

root@analog:/sys/bus/iio/devices/iio:device2# cat in_voltage_scale
0.038146

However, when reading the available options:

root@analog:/sys/bus/iio/devices/iio:device2# cat
in_voltage_scale_available
2000.000000 2100.000006 2200.000007 2300.000008 2400.000009 2500.000010

which does not make sense. Moreover, when trying to set a new scale we
get an error because there's no call to __ad9467_get_scale() to give us
values as given when reading in_voltage_scale. Fix it by computing the
available scales during probe and properly pass the list when
.read_available() is called.

While at it, change to use .read_available() from iio_info. Also note
that to properly fix this, adi-axi-adc.c has to be changed accordingly.

Fixes: ad67971202 ("iio: adc: ad9467: add support AD9467 ADC")
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20231207-iio-backend-prep-v2-4-a4a33bc4d70e@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 14:52:51 -08:00
..
accel
adc iio: adc: ad9467: fix scale setting 2024-01-25 14:52:51 -08:00
afe iio: afe: rescale: add offset support 2023-11-08 17:26:42 +01:00
common
dac
frequency
gyro
imu iio: adis: add '__adis_enable_irq()' implementation 2022-12-31 13:14:29 +01:00
timer
buffer-dma.h
buffer-dmaengine.h
buffer.h
buffer_impl.h
configfs.h
consumer.h
driver.h
events.h
hw-consumer.h
iio-opaque.h
iio.h iio: core: introduce iio_device_{claim|release}_buffer_mode() APIs 2023-10-25 11:58:58 +02:00
kfifo_buf.h
machine.h
sw_device.h
sw_trigger.h
sysfs.h
trigger.h
trigger_consumer.h
triggered_buffer.h
triggered_event.h
types.h