Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: core: introduce trough info element for minimum values

The IIO_CHAN_INFO_PEAK info element is used for maximum values and
currently there is no equivalent for minimum values. Instead of
overloading the existing peak info element, a new info element can
be added.

In principle there is no need to add a _TROUGH_SCALE element as the
scale will be the same as the one required for INFO_PEAK, which in
turn is sometimes omitted if a single scale for peaks and raw values
is required.

Add an IIO_CHAN_INFO_TROUGH info element for minimum values.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20231211122747.9723-1-579lpy@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Javier Carrasco and committed by
Jonathan Cameron
5bc2ea60 8b0d4c40

+2
+1
drivers/iio/industrialio-core.c
··· 184 184 [IIO_CHAN_INFO_THERMOCOUPLE_TYPE] = "thermocouple_type", 185 185 [IIO_CHAN_INFO_CALIBAMBIENT] = "calibambient", 186 186 [IIO_CHAN_INFO_ZEROPOINT] = "zeropoint", 187 + [IIO_CHAN_INFO_TROUGH] = "trough_raw", 187 188 }; 188 189 /** 189 190 * iio_device_id() - query the unique ID for the device
+1
include/linux/iio/types.h
··· 68 68 IIO_CHAN_INFO_THERMOCOUPLE_TYPE, 69 69 IIO_CHAN_INFO_CALIBAMBIENT, 70 70 IIO_CHAN_INFO_ZEROPOINT, 71 + IIO_CHAN_INFO_TROUGH, 71 72 }; 72 73 73 74 #endif /* _IIO_TYPES_H_ */