diff options
author | Cristian Pop <cristian.pop@analog.com> | 2020-09-28 12:09:55 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-11-08 16:07:39 +0000 |
commit | 1d4ef9b39ebecca827642b8897d2d79ea2026682 (patch) | |
tree | 3c0259063f447a9346efe0c2695f3138b722c34c /include/linux | |
parent | 397f45ed26c5dad70426ab372c250c8b903c996d (diff) | |
download | linux-stable-1d4ef9b39ebecca827642b8897d2d79ea2026682.tar.gz linux-stable-1d4ef9b39ebecca827642b8897d2d79ea2026682.tar.bz2 linux-stable-1d4ef9b39ebecca827642b8897d2d79ea2026682.zip |
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')
-rw-r--r-- | include/linux/iio/iio.h | 6 |
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); |