aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/iio
diff options
context:
space:
mode:
authorAlexandru Ardelean <alexandru.ardelean@analog.com>2021-02-15 12:40:30 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-03-11 20:47:03 +0000
commite2b4d7aca9db5c1f0789e5a8e0fd1f4953d0be9e (patch)
tree0891ec9ce43a1e1aab87c867cbdd61d41647e0dd /include/linux/iio
parentiio: core: rework iio device group creation (diff)
downloadlinux-dev-e2b4d7aca9db5c1f0789e5a8e0fd1f4953d0be9e.tar.xz
linux-dev-e2b4d7aca9db5c1f0789e5a8e0fd1f4953d0be9e.zip
iio: buffer: group attr count and attr alloc
If we want to merge the attributes of the buffer/ and scan_elements/ directories, we'll need to count all attributes first, then (depending on the attribute group) either allocate 2 attribute groups, or a single one. Historically an IIO buffer was described by 2 subdirectories under /sys/bus/iio/iio:devicesX (i.e. buffer/ and scan_elements/); these subdirs were actually 2 separate attribute groups on the iio_buffer object. Moving forward, if we want to allow more than one buffer per IIO device, keeping 2 subdirectories for each IIO buffer is a bit cumbersome (especially for userpace ABI). So, we will merge the attributes of these 2 subdirs under a /sys/bus/iio/iio:devicesX/bufferY subdirectory. To do this, we need to count all attributes first, and then distribute them based on which buffer this is. For the first buffer, we'll need to also allocate the legacy 2 attribute groups (for buffer/ and scan_elements/), and also a /sys/bus/iio/iio:devicesX/buffer0 attribute group. For buffer1 and above, just a single attribute group will be allocated (the merged one). Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Link: https://lore.kernel.org/r/20210215104043.91251-12-alexandru.ardelean@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include/linux/iio')
0 files changed, 0 insertions, 0 deletions