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.

Dependency Surface

Detected Declarations

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

Implementation Notes