Files
linux/include/linux
Nuno Sa eeeb3861c2 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: 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 15:27:47 -08:00
..
2023-07-19 16:21:11 +02:00
2024-01-25 15:27:47 -08:00
2022-05-22 20:44:29 +01:00
2022-03-23 19:58:38 +01:00
2022-02-01 14:25:50 +02:00
2022-07-05 20:25:39 +02:00
2022-01-22 08:33:34 +02:00
2022-09-21 11:18:28 +09:00
2022-09-26 19:46:29 -07:00
2022-09-26 10:13:13 -07:00
2022-09-26 10:13:13 -07:00
2022-09-26 10:13:14 -07:00
2023-12-20 17:00:20 +01:00
2024-01-10 17:10:30 +01:00
2022-07-01 14:53:01 +02:00
2022-01-20 08:52:54 +02:00
2022-10-03 14:02:45 -07:00
2022-08-16 12:46:26 +02:00
2022-06-09 21:53:09 -07:00
2022-02-28 23:26:27 -08:00
2022-09-01 18:04:43 +02:00
2022-06-27 06:29:12 -06:00
2022-09-08 12:59:00 -06:00
2022-09-26 13:31:20 +02:00
2022-07-17 17:31:38 -07:00
2022-10-03 14:03:19 -07:00
2022-05-02 14:06:20 -06:00
2022-01-27 13:53:26 +00:00
2022-05-03 16:09:03 -04:00
2022-06-19 10:38:26 +01:00
2022-07-27 14:04:52 +02:00
2022-09-26 19:46:18 -07:00
2023-10-10 22:00:35 +02:00
2022-04-28 23:16:14 -07:00
2022-08-02 12:34:04 -04:00
2023-05-30 14:03:22 +01:00
2023-11-20 11:51:55 +01:00
2022-05-17 13:32:46 -04:00
2022-02-09 09:24:40 -05:00
2023-11-20 11:51:50 +01:00
2022-01-12 10:14:09 -06:00
2024-01-25 15:27:20 -08:00
2022-10-03 17:34:32 -07:00
2022-09-26 19:46:27 -07:00
2022-02-02 07:49:59 -07:00
2022-02-09 08:04:44 +01:00
2022-02-09 08:04:44 +01:00
2022-10-04 20:52:38 +02:00
2022-01-08 12:43:57 -06:00
2023-11-28 17:07:03 +00:00
2023-10-19 23:08:50 +02:00
2023-10-19 23:08:50 +02:00
2022-03-08 14:33:36 -06:00
2022-03-23 19:58:41 +01:00
2022-05-22 21:03:01 +01:00
2022-06-27 14:41:31 +02:00
2023-07-19 16:21:54 +02:00
2022-02-24 15:04:51 +00:00
2023-09-19 12:27:58 +02:00
2022-05-08 01:33:08 -07:00
2023-12-13 18:39:08 +01:00
2022-09-07 12:42:25 +01:00
2022-02-25 09:36:06 +01:00
2022-09-29 15:20:29 +02:00
2022-04-11 19:18:27 -06:00
2022-03-22 15:57:11 -07:00
2023-08-16 18:27:20 +02:00
2022-09-22 16:12:34 +02:00
2022-09-22 16:12:34 +02:00
2022-08-31 13:37:32 +02:00
2022-08-28 16:52:28 +01:00
2022-10-07 09:32:40 -04:00
2022-11-10 12:03:36 -07:00
2022-09-26 19:46:18 -07:00
2022-06-13 09:54:52 -07:00
2022-09-26 19:46:18 -07:00
2022-07-10 21:17:30 -04:00