diff options
author | Jonathan Cameron | 2012-02-15 20:48:01 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2012-02-24 21:10:02 +0100 |
commit | e27d75d71c0dbbab83768c6e327d13f445d0214f (patch) | |
tree | 3076216ea6fba337f8a88351c35f40427fa86301 /drivers/staging/iio/driver.h | |
parent | staging:iio:core set the iio_dev.info pointer to null on unregister under lock. (diff) | |
download | kernel-qcow2-linux-e27d75d71c0dbbab83768c6e327d13f445d0214f.tar.gz kernel-qcow2-linux-e27d75d71c0dbbab83768c6e327d13f445d0214f.tar.xz kernel-qcow2-linux-e27d75d71c0dbbab83768c6e327d13f445d0214f.zip |
staging:iio:core add in kernel interface mapping and getting IIO channels.
Lifted from proposal for in kernel interface built on the out of staging
branch.
Two elements here:
* Map as defined in "inkern.h"
* Matching code to actually get the iio_dev and channel
that we want from the global list of IIO devices.
V4: Everything now built if iio is built (rather than being optional)
Removal race condition prevented by using info pointer as a check
of removal under a lock.
V3: Drop the option of registering / getting channels using dev pointer.
Stick to name only as suggested by Mark Brown (this has caused user
confusion in the regulator framework.)
V2: As per Greg KH suggestion, move over to registration by passing
the tables into the provider drivers (how regulator does it).
This does not prevent us using the original more flexible approach
if at a later date there is a usecase that demands it.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio/driver.h')
-rw-r--r-- | drivers/staging/iio/driver.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/staging/iio/driver.h b/drivers/staging/iio/driver.h new file mode 100644 index 000000000000..a4f8b2e05af5 --- /dev/null +++ b/drivers/staging/iio/driver.h @@ -0,0 +1,34 @@ +/* + * Industrial I/O in kernel access map interface. + * + * Copyright (c) 2011 Jonathan Cameron + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + */ + +#ifndef _IIO_INKERN_H_ +#define _IIO_INKERN_H_ + +struct iio_map; + +/** + * iio_map_array_register() - tell the core about inkernel consumers + * @indio_dev: provider device + * @map: array of mappings specifying association of channel with client + */ +int iio_map_array_register(struct iio_dev *indio_dev, + struct iio_map *map); + +/** + * iio_map_array_unregister() - tell the core to remove consumer mappings + * @indio_dev: provider device + * @map: array of mappings to remove. Note these must have same memory + * addresses as those originally added not just equal parameter + * values. + */ +int iio_map_array_unregister(struct iio_dev *indio_dev, + struct iio_map *map); + +#endif |