include/linux/iio/consumer.h
Source file repositories/reference/linux-study-clean/include/linux/iio/consumer.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/iio/consumer.h- Extension
.h- Size
- 17008 bytes
- Lines
- 474
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/iio/types.h
Detected Declarations
struct iio_devstruct iio_chan_specstruct devicestruct fwnode_handlestruct iio_channelstruct iio_cb_buffer
Annotated Snippet
struct iio_channel {
struct iio_dev *indio_dev;
const struct iio_chan_spec *channel;
void *data;
};
/**
* iio_channel_get() - get description of all that is needed to access channel.
* @dev: Pointer to consumer device. Device name must match
* the name of the device as provided in the iio_map
* with which the desired provider to consumer mapping
* was registered.
* @consumer_channel: Unique name to identify the channel on the consumer
* side. This typically describes the channels use within
* the consumer. E.g. 'battery_voltage'
*/
struct iio_channel *iio_channel_get(struct device *dev,
const char *consumer_channel);
/**
* iio_channel_release() - release channels obtained via iio_channel_get
* @chan: The channel to be released.
*/
void iio_channel_release(struct iio_channel *chan);
/**
* devm_iio_channel_get() - Resource managed version of iio_channel_get().
* @dev: Pointer to consumer device. Device name must match
* the name of the device as provided in the iio_map
* with which the desired provider to consumer mapping
* was registered.
* @consumer_channel: Unique name to identify the channel on the consumer
* side. This typically describes the channels use within
* the consumer. E.g. 'battery_voltage'
*
* Returns a pointer to negative errno if it is not able to get the iio channel
* otherwise returns valid pointer for iio channel.
*
* The allocated iio channel is automatically released when the device is
* unbound.
*/
struct iio_channel *devm_iio_channel_get(struct device *dev,
const char *consumer_channel);
/**
* iio_channel_get_all() - get all channels associated with a client
* @dev: Pointer to consumer device.
*
* Returns an array of iio_channel structures terminated with one with
* null iio_dev pointer.
* This function is used by fairly generic consumers to get all the
* channels registered as having this consumer.
*/
struct iio_channel *iio_channel_get_all(struct device *dev);
/**
* iio_channel_release_all() - reverse iio_channel_get_all
* @chan: Array of channels to be released.
*/
void iio_channel_release_all(struct iio_channel *chan);
/**
* devm_iio_channel_get_all() - Resource managed version of
* iio_channel_get_all().
* @dev: Pointer to consumer device.
*
* Returns a pointer to negative errno if it is not able to get the iio channel
* otherwise returns an array of iio_channel structures terminated with one with
* null iio_dev pointer.
*
* This function is used by fairly generic consumers to get all the
* channels registered as having this consumer.
*
* The allocated iio channels are automatically released when the device is
* unbounded.
*/
struct iio_channel *devm_iio_channel_get_all(struct device *dev);
/**
* fwnode_iio_channel_get_by_name() - get description of all that is needed to access channel.
* @fwnode: Pointer to consumer Firmware node
* @consumer_channel: Unique name to identify the channel on the consumer
* side. This typically describes the channels use within
* the consumer. E.g. 'battery_voltage'
*/
struct iio_channel *fwnode_iio_channel_get_by_name(struct fwnode_handle *fwnode,
const char *name);
/**
* devm_fwnode_iio_channel_get_by_name() - Resource managed version of
* fwnode_iio_channel_get_by_name().
Annotation
- Immediate include surface: `linux/types.h`, `linux/iio/types.h`.
- Detected declarations: `struct iio_dev`, `struct iio_chan_spec`, `struct device`, `struct fwnode_handle`, `struct iio_channel`, `struct iio_cb_buffer`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.