summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorLars-Peter Clausen2012-02-21 18:38:12 +0100
committerGreg Kroah-Hartman2012-02-24 21:12:24 +0100
commit5f420b42079c115daf3b45bbd15bcb6b7b05ad21 (patch)
tree748a58b40d17bebbe57e2e90c5f1d5f871561199 /usr
parentstaging:iio: Convert remaining drivers to module_spi_driver (diff)
downloadkernel-qcow2-linux-5f420b42079c115daf3b45bbd15bcb6b7b05ad21.tar.gz
kernel-qcow2-linux-5f420b42079c115daf3b45bbd15bcb6b7b05ad21.tar.xz
kernel-qcow2-linux-5f420b42079c115daf3b45bbd15bcb6b7b05ad21.zip
staging:iio: Add extended IIO channel info
Sometimes devices have per channel properties which either do not map nicely to the current channel info scheme (e.g. string properties) or are very device specific, so it does not make sense to add generic support for them. Currently drivers define these attributes by hand for each channel. Depending on the number of channels this can amount to quite a few lines of boilerplate code. Especially if a driver supports multiple variations of a chip with different numbers of channels. In this case it becomes necessary to have a individual attribute list per chip variation and also a individual iio_info struct. This patch introduces a new scheme for handling such per channel attributes called extended channel info attributes. A extended channel info attribute consist of a name, a flag whether it is shared and read and write callbacks. The read and write callbacks are similar to the {read,write}_raw callbacks and take a IIO device and a channel as their first parameters, but instead of pre-parsed integer values they directly get passed the raw string value, which has been written to the sysfs file. It is possible to assign a list of extended channel info attributes to a channel. For each extended channel info attribute the IIO core will create a new sysfs attribute conforming to the IIO channel naming spec for the channels type, similar as for normal info attributes. Read and write access to this sysfs attribute will be redirected to the extended channel info attributes read and write callbacks. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'usr')
0 files changed, 0 insertions, 0 deletions