kernel_samsung_a53x/include/linux/iio
Nuno Sa 7f83e105bd iio: adc: ad9467: fix scale setting
[ Upstream commit b73f08bb7fe5a0901646ca5ceaa1e7a2d5ee6293 ]

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: ad6797120238 ("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-11-18 12:12:49 +01:00
..
accel Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
adc iio: adc: ad9467: fix scale setting 2024-11-18 12:12:49 +01:00
common Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dac Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
frequency Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gyro Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
imu Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
timer Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
buffer-dma.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
buffer-dmaengine.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
buffer.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
buffer_impl.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
configfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
consumer.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
driver.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
events.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hw-consumer.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
iio-opaque.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
iio.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kfifo_buf.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
machine.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sw_device.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sw_trigger.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trigger.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trigger_consumer.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
triggered_buffer.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
triggered_event.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00