linux/drivers/iio/test
Matti Vaittinen 6de2f3a1f4 iio: test: gts: test available times and gains sorting
The iio_gts helpers build available times and scales tables based on the
times and gains arrays given from the driver. The driver should be able
to list all valid register values so that conversion from register valu
to correct gain/time works for all supported register values.

It might be more convenient for drivers to list these times and gains in
the order where they're listed in the data-sheet than ascending order.

However, for user who requests the supported scales / times it is more
convenient to get the results in asscending order. Also, listing
duplicated values is not meaning for the user.

Hence the GTS heler should do sorting and deduplication of the scales
and times when it builds the tables listing the available times/scales.
Note, currently duplicated gain values aren't handled by GTS-helpers.

Unsort the gain and time arrays in the test code, and add duplicates to
time array in order to test the sorting and deduplicating works.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/365cc6de3c17a457db738f5fdf8dd3bd6f50d5f2.1714480171.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-05-27 09:48:56 +01:00
..
iio-test-format.c
iio-test-gts.c iio: test: gts: test available times and gains sorting 2024-05-27 09:48:56 +01:00
iio-test-rescale.c iio: test: Mark file local structure arrays static. 2022-08-15 22:30:01 +01:00
Kconfig iio: test: test gain-time-scale helpers 2024-02-17 16:16:09 +00:00
Makefile iio: test: test gain-time-scale helpers 2024-02-17 16:16:09 +00:00