summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRodrigo Alencar <rodrigo.alencar@analog.com>2026-07-29 09:25:35 +0100
committerJonathan Cameron <jonathan.cameron@oss.qualcomm.com>2026-09-23 02:53:57 +0100
commitef7fcf86cc65822ca091adda6e865a1bfbbd99de (patch)
treea8fd53fbb721897bd785e8a7f268aeb74d1487a2 /include
parentb9f9044be76f8494ff48bbf438ecc5b15e7bd3d4 (diff)
downloadlinux-next-ef7fcf86cc65822ca091adda6e865a1bfbbd99de.tar.gz
linux-next-ef7fcf86cc65822ca091adda6e865a1bfbbd99de.zip
iio: core: add hierarchical channel relationships
Add parent-child relationship between iio channels by creating a parent pointer field in iio_chan_spec struct and exposing a sysfs attribute that returns the parent channel prefix. Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/iio/iio.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index c227e292aaf1..7c751e117ccc 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -264,6 +264,10 @@ struct iio_scan_type {
* @ext_info: Array of extended info attributes for this channel.
* The array is NULL terminated, the last element should
* have its name field set to NULL.
+ * @parent: Optional pointer to the parent channel spec for
+ * hierarchical channel relationships. When set, a read-only
+ * "parent" sysfs attribute is created containing the
+ * parent channel's sysfs name prefix (e.g. "in_voltage0").
* @extend_name: Allows labeling of channel attributes with an
* informative name. Note this has no effect codes etc,
* unlike modifiers.
@@ -309,6 +313,7 @@ struct iio_chan_spec {
const struct iio_event_spec *event_spec;
unsigned int num_event_specs;
const struct iio_chan_spec_ext_info *ext_info;
+ const struct iio_chan_spec *parent;
const char *extend_name;
const char *datasheet_name;
unsigned int modified:1;