]> git.baikalelectronics.ru Git - kernel.git/commit
iio: Add helper functions for enum style channel attributes
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 4 Jun 2012 09:36:11 +0000 (11:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Jun 2012 04:47:29 +0000 (13:47 +0900)
commit701e1c93602070e18ccc59b9bff88e40b0417d18
tree3c823a04bb8b5c1e001bdf4e26f5413c26de7bd7
parentd3615b9f8e8dc4433a661ac42289af7e157daa9b
iio: Add helper functions for enum style channel attributes

We often have the case were we do have a enum style channel attribute. These
attributes have in common that they are a list of string values which usually
map in a 1-to-1 fashion to integer values.

This patch implements some common helper code for implementing enum style
channel attributes using extended channel attributes. The helper functions take
care of converting between the string and integer values, as well providing a
function for "_available" attributes which list all available enum items.

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>
drivers/iio/industrialio-core.c
include/linux/iio/iio.h