linux/drivers/iio/inkern.c

// SPDX-License-Identifier: GPL-2.0-only
/* The industrial I/O core in kernel channel mapping
 *
 * Copyright (c) 2011 Jonathan Cameron
 */
#include <linux/cleanup.h>
#include <linux/err.h>
#include <linux/export.h>
#include <linux/minmax.h>
#include <linux/mutex.h>
#include <linux/property.h>
#include <linux/slab.h>

#include <linux/iio/iio.h>
#include <linux/iio/iio-opaque.h>
#include "iio_core.h"
#include <linux/iio/machine.h>
#include <linux/iio/driver.h>
#include <linux/iio/consumer.h>

struct iio_map_internal {};

static LIST_HEAD(iio_map_list);
static DEFINE_MUTEX(iio_map_list_lock);

static int iio_map_array_unregister_locked(struct iio_dev *indio_dev)
{}

int iio_map_array_register(struct iio_dev *indio_dev, struct iio_map *maps)
{}
EXPORT_SYMBOL_GPL();

/*
 * Remove all map entries associated with the given iio device
 */
int iio_map_array_unregister(struct iio_dev *indio_dev)
{}
EXPORT_SYMBOL_GPL();

static void iio_map_array_unregister_cb(void *indio_dev)
{}

int devm_iio_map_array_register(struct device *dev, struct iio_dev *indio_dev, struct iio_map *maps)
{}
EXPORT_SYMBOL_GPL();

static const struct iio_chan_spec
*iio_chan_spec_from_name(const struct iio_dev *indio_dev, const char *name)
{}

/**
 * __fwnode_iio_simple_xlate - translate iiospec to the IIO channel index
 * @indio_dev:	pointer to the iio_dev structure
 * @iiospec:	IIO specifier as found in the device tree
 *
 * This is simple translation function, suitable for the most 1:1 mapped
 * channels in IIO chips. This function performs only one sanity check:
 * whether IIO index is less than num_channels (that is specified in the
 * iio_dev).
 */
static int __fwnode_iio_simple_xlate(struct iio_dev *indio_dev,
				     const struct fwnode_reference_args *iiospec)
{}

static int __fwnode_iio_channel_get(struct iio_channel *channel,
				    struct fwnode_handle *fwnode, int index)
{}

static struct iio_channel *fwnode_iio_channel_get(struct fwnode_handle *fwnode,
						  int index)
{}

static struct iio_channel *
__fwnode_iio_channel_get_by_name(struct fwnode_handle *fwnode, const char *name)
{}

struct iio_channel *fwnode_iio_channel_get_by_name(struct fwnode_handle *fwnode,
						   const char *name)
{}
EXPORT_SYMBOL_GPL();

static struct iio_channel *fwnode_iio_channel_get_all(struct device *dev)
{}

static struct iio_channel *iio_channel_get_sys(const char *name,
					       const char *channel_name)
{}

struct iio_channel *iio_channel_get(struct device *dev,
				    const char *channel_name)
{}
EXPORT_SYMBOL_GPL();

void iio_channel_release(struct iio_channel *channel)
{}
EXPORT_SYMBOL_GPL();

static void devm_iio_channel_free(void *iio_channel)
{}

struct iio_channel *devm_iio_channel_get(struct device *dev,
					 const char *channel_name)
{}
EXPORT_SYMBOL_GPL();

struct iio_channel *devm_fwnode_iio_channel_get_by_name(struct device *dev,
							struct fwnode_handle *fwnode,
							const char *channel_name)
{}
EXPORT_SYMBOL_GPL();

struct iio_channel *iio_channel_get_all(struct device *dev)
{}
EXPORT_SYMBOL_GPL();

void iio_channel_release_all(struct iio_channel *channels)
{}
EXPORT_SYMBOL_GPL();

static void devm_iio_channel_free_all(void *iio_channels)
{}

struct iio_channel *devm_iio_channel_get_all(struct device *dev)
{}
EXPORT_SYMBOL_GPL();

static int iio_channel_read(struct iio_channel *chan, int *val, int *val2,
			    enum iio_chan_info_enum info)
{}

int iio_read_channel_raw(struct iio_channel *chan, int *val)
{}
EXPORT_SYMBOL_GPL();

int iio_read_channel_average_raw(struct iio_channel *chan, int *val)
{}
EXPORT_SYMBOL_GPL();

static int iio_convert_raw_to_processed_unlocked(struct iio_channel *chan,
						 int raw, int *processed,
						 unsigned int scale)
{}

int iio_convert_raw_to_processed(struct iio_channel *chan, int raw,
				 int *processed, unsigned int scale)
{}
EXPORT_SYMBOL_GPL();

int iio_read_channel_attribute(struct iio_channel *chan, int *val, int *val2,
			       enum iio_chan_info_enum attribute)
{}
EXPORT_SYMBOL_GPL();

int iio_read_channel_offset(struct iio_channel *chan, int *val, int *val2)
{}
EXPORT_SYMBOL_GPL();

int iio_read_channel_processed_scale(struct iio_channel *chan, int *val,
				     unsigned int scale)
{}
EXPORT_SYMBOL_GPL();

int iio_read_channel_processed(struct iio_channel *chan, int *val)
{}
EXPORT_SYMBOL_GPL();

int iio_read_channel_scale(struct iio_channel *chan, int *val, int *val2)
{}
EXPORT_SYMBOL_GPL();

static int iio_channel_read_avail(struct iio_channel *chan,
				  const int **vals, int *type, int *length,
				  enum iio_chan_info_enum info)
{}

int iio_read_avail_channel_attribute(struct iio_channel *chan,
				     const int **vals, int *type, int *length,
				     enum iio_chan_info_enum attribute)
{}
EXPORT_SYMBOL_GPL();

int iio_read_avail_channel_raw(struct iio_channel *chan,
			       const int **vals, int *length)
{}
EXPORT_SYMBOL_GPL();

static int iio_channel_read_max(struct iio_channel *chan,
				int *val, int *val2, int *type,
				enum iio_chan_info_enum info)
{}

int iio_read_max_channel_raw(struct iio_channel *chan, int *val)
{}
EXPORT_SYMBOL_GPL();

static int iio_channel_read_min(struct iio_channel *chan,
				int *val, int *val2, int *type,
				enum iio_chan_info_enum info)
{}

int iio_read_min_channel_raw(struct iio_channel *chan, int *val)
{}
EXPORT_SYMBOL_GPL();

int iio_get_channel_type(struct iio_channel *chan, enum iio_chan_type *type)
{}
EXPORT_SYMBOL_GPL();

static int iio_channel_write(struct iio_channel *chan, int val, int val2,
			     enum iio_chan_info_enum info)
{}

int iio_write_channel_attribute(struct iio_channel *chan, int val, int val2,
				enum iio_chan_info_enum attribute)
{}
EXPORT_SYMBOL_GPL();

int iio_write_channel_raw(struct iio_channel *chan, int val)
{}
EXPORT_SYMBOL_GPL();

unsigned int iio_get_channel_ext_info_count(struct iio_channel *chan)
{}
EXPORT_SYMBOL_GPL();

static const struct iio_chan_spec_ext_info *
iio_lookup_ext_info(const struct iio_channel *chan, const char *attr)
{}

ssize_t iio_read_channel_ext_info(struct iio_channel *chan,
				  const char *attr, char *buf)
{}
EXPORT_SYMBOL_GPL();

ssize_t iio_write_channel_ext_info(struct iio_channel *chan, const char *attr,
				   const char *buf, size_t len)
{}
EXPORT_SYMBOL_GPL();

ssize_t iio_read_channel_label(struct iio_channel *chan, char *buf)
{}
EXPORT_SYMBOL_GPL();