summaryrefslogtreecommitdiff
path: root/include/linux/iio/iio.h
diff options
context:
space:
mode:
authorCristian Pop <cristian.pop@analog.com>2020-09-28 12:09:55 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-11-08 19:07:39 +0300
commit1d4ef9b39ebecca827642b8897d2d79ea2026682 (patch)
tree3c0259063f447a9346efe0c2695f3138b722c34c /include/linux/iio/iio.h
parent397f45ed26c5dad70426ab372c250c8b903c996d (diff)
downloadlinux-1d4ef9b39ebecca827642b8897d2d79ea2026682.tar.xz
iio: core: Add optional symbolic label to a device channel
If a label is defined in the device tree for this channel add that to the channel specific attributes. This is useful for userspace to be able to identify an individual channel. Signed-off-by: Cristian Pop <cristian.pop@analog.com> Link: https://lore.kernel.org/r/20200928090959.88842-1-cristian.pop@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include/linux/iio/iio.h')
-rw-r--r--include/linux/iio/iio.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 2e45b3ceafa7..9a3cf4815148 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -362,6 +362,8 @@ struct iio_trigger; /* forward declaration */
* and max. For lists, all possible values are enumerated.
* @write_raw: function to write a value to the device.
* Parameters are the same as for read_raw.
+ * @read_label: function to request label name for a specified label,
+ * for better channel identification.
* @write_raw_get_fmt: callback function to query the expected
* format/precision. If not set by the driver, write_raw
* returns IIO_VAL_INT_PLUS_MICRO.
@@ -420,6 +422,10 @@ struct iio_info {
int val2,
long mask);
+ int (*read_label)(struct iio_dev *indio_dev,
+ struct iio_chan_spec const *chan,
+ char *label);
+
int (*write_raw_get_fmt)(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
long mask);