#define pr_fmt(fmt) …
#include <linux/anon_inodes.h>
#include <linux/cdev.h>
#include <linux/cleanup.h>
#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/fs.h>
#include <linux/idr.h>
#include <linux/kdev_t.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/poll.h>
#include <linux/property.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/wait.h>
#include <linux/iio/buffer.h>
#include <linux/iio/buffer_impl.h>
#include <linux/iio/events.h>
#include <linux/iio/iio-opaque.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include "iio_core.h"
#include "iio_core_trigger.h"
static DEFINE_IDA(iio_ida);
static dev_t iio_devt;
#define IIO_DEV_MAX …
const struct bus_type iio_bus_type = …;
EXPORT_SYMBOL(…);
static struct dentry *iio_debugfs_dentry;
static const char * const iio_direction[] = …;
static const char * const iio_chan_type_name_spec[] = …;
static const char * const iio_modifier_names[] = …;
static const char * const iio_chan_info_postfix[] = …;
int iio_device_id(struct iio_dev *indio_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
bool iio_buffer_enabled(struct iio_dev *indio_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
#if defined(CONFIG_DEBUG_FS)
struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
#endif
const struct iio_chan_spec
*iio_find_channel_from_si(struct iio_dev *indio_dev, int si)
{ … }
ssize_t iio_read_const_attr(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
EXPORT_SYMBOL(…);
int iio_device_set_clock(struct iio_dev *indio_dev, clockid_t clock_id)
{ … }
EXPORT_SYMBOL(…);
clockid_t iio_device_get_clock(const struct iio_dev *indio_dev)
{ … }
EXPORT_SYMBOL(…);
s64 iio_get_time_ns(const struct iio_dev *indio_dev)
{ … }
EXPORT_SYMBOL(…);
static int __init iio_init(void)
{ … }
static void __exit iio_exit(void)
{ … }
#if defined(CONFIG_DEBUG_FS)
static ssize_t iio_debugfs_read_reg(struct file *file, char __user *userbuf,
size_t count, loff_t *ppos)
{ … }
static ssize_t iio_debugfs_write_reg(struct file *file,
const char __user *userbuf, size_t count, loff_t *ppos)
{ … }
static const struct file_operations iio_debugfs_reg_fops = …;
static void iio_device_unregister_debugfs(struct iio_dev *indio_dev)
{ … }
static void iio_device_register_debugfs(struct iio_dev *indio_dev)
{ … }
#else
static void iio_device_register_debugfs(struct iio_dev *indio_dev)
{
}
static void iio_device_unregister_debugfs(struct iio_dev *indio_dev)
{
}
#endif
static ssize_t iio_read_channel_ext_info(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t iio_write_channel_ext_info(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t len)
{ … }
ssize_t iio_enum_available_read(struct iio_dev *indio_dev,
uintptr_t priv, const struct iio_chan_spec *chan, char *buf)
{ … }
EXPORT_SYMBOL_GPL(…);
ssize_t iio_enum_read(struct iio_dev *indio_dev,
uintptr_t priv, const struct iio_chan_spec *chan, char *buf)
{ … }
EXPORT_SYMBOL_GPL(…);
ssize_t iio_enum_write(struct iio_dev *indio_dev,
uintptr_t priv, const struct iio_chan_spec *chan, const char *buf,
size_t len)
{ … }
EXPORT_SYMBOL_GPL(…);
static const struct iio_mount_matrix iio_mount_idmatrix = …;
static int iio_setup_mount_idmatrix(const struct device *dev,
struct iio_mount_matrix *matrix)
{ … }
ssize_t iio_show_mount_matrix(struct iio_dev *indio_dev, uintptr_t priv,
const struct iio_chan_spec *chan, char *buf)
{ … }
EXPORT_SYMBOL_GPL(…);
int iio_read_mount_matrix(struct device *dev, struct iio_mount_matrix *matrix)
{ … }
EXPORT_SYMBOL(…);
static ssize_t __iio_format_value(char *buf, size_t offset, unsigned int type,
int size, const int *vals)
{ … }
ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals)
{ … }
EXPORT_SYMBOL_GPL(…);
ssize_t do_iio_read_channel_label(struct iio_dev *indio_dev,
const struct iio_chan_spec *c,
char *buf)
{ … }
static ssize_t iio_read_channel_label(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t iio_read_channel_info(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t iio_format_list(char *buf, const int *vals, int type, int length,
const char *prefix, const char *suffix)
{ … }
static ssize_t iio_format_avail_list(char *buf, const int *vals,
int type, int length)
{ … }
static ssize_t iio_format_avail_range(char *buf, const int *vals, int type)
{ … }
static ssize_t iio_read_channel_info_avail(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static int __iio_str_to_fixpoint(const char *str, int fract_mult,
int *integer, int *fract, bool scale_db)
{ … }
int iio_str_to_fixpoint(const char *str, int fract_mult,
int *integer, int *fract)
{ … }
EXPORT_SYMBOL_GPL(…);
static ssize_t iio_write_channel_info(struct device *dev,
struct device_attribute *attr,
const char *buf,
size_t len)
{ … }
static
int __iio_device_attr_init(struct device_attribute *dev_attr,
const char *postfix,
struct iio_chan_spec const *chan,
ssize_t (*readfunc)(struct device *dev,
struct device_attribute *attr,
char *buf),
ssize_t (*writefunc)(struct device *dev,
struct device_attribute *attr,
const char *buf,
size_t len),
enum iio_shared_by shared_by)
{ … }
static void __iio_device_attr_deinit(struct device_attribute *dev_attr)
{ … }
int __iio_add_chan_devattr(const char *postfix,
struct iio_chan_spec const *chan,
ssize_t (*readfunc)(struct device *dev,
struct device_attribute *attr,
char *buf),
ssize_t (*writefunc)(struct device *dev,
struct device_attribute *attr,
const char *buf,
size_t len),
u64 mask,
enum iio_shared_by shared_by,
struct device *dev,
struct iio_buffer *buffer,
struct list_head *attr_list)
{ … }
static int iio_device_add_channel_label(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan)
{ … }
static int iio_device_add_info_mask_type(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
enum iio_shared_by shared_by,
const long *infomask)
{ … }
static int iio_device_add_info_mask_type_avail(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
enum iio_shared_by shared_by,
const long *infomask)
{ … }
static int iio_device_add_channel_sysfs(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan)
{ … }
void iio_free_chan_devattr_list(struct list_head *attr_list)
{ … }
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(name);
static ssize_t label_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(label);
static const char * const clock_names[] = …;
static ssize_t current_timestamp_clock_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t current_timestamp_clock_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t len)
{ … }
int iio_device_register_sysfs_group(struct iio_dev *indio_dev,
const struct attribute_group *group)
{ … }
static DEVICE_ATTR_RW(current_timestamp_clock);
static int iio_device_register_sysfs(struct iio_dev *indio_dev)
{ … }
static void iio_device_unregister_sysfs(struct iio_dev *indio_dev)
{ … }
static void iio_dev_release(struct device *device)
{ … }
const struct device_type iio_device_type = …;
struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv)
{ … }
EXPORT_SYMBOL(…);
void iio_device_free(struct iio_dev *dev)
{ … }
EXPORT_SYMBOL(…);
static void devm_iio_device_release(void *iio_dev)
{ … }
struct iio_dev *devm_iio_device_alloc(struct device *parent, int sizeof_priv)
{ … }
EXPORT_SYMBOL_GPL(…);
static int iio_chrdev_open(struct inode *inode, struct file *filp)
{ … }
static int iio_chrdev_release(struct inode *inode, struct file *filp)
{ … }
void iio_device_ioctl_handler_register(struct iio_dev *indio_dev,
struct iio_ioctl_handler *h)
{ … }
void iio_device_ioctl_handler_unregister(struct iio_ioctl_handler *h)
{ … }
static long iio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{ … }
static const struct file_operations iio_buffer_fileops = …;
static const struct file_operations iio_event_fileops = …;
static int iio_check_unique_scan_index(struct iio_dev *indio_dev)
{ … }
static int iio_check_extended_name(const struct iio_dev *indio_dev)
{ … }
static const struct iio_buffer_setup_ops noop_ring_setup_ops;
static void iio_sanity_check_avail_scan_masks(struct iio_dev *indio_dev)
{ … }
int __iio_device_register(struct iio_dev *indio_dev, struct module *this_mod)
{ … }
EXPORT_SYMBOL(…);
void iio_device_unregister(struct iio_dev *indio_dev)
{ … }
EXPORT_SYMBOL(…);
static void devm_iio_device_unreg(void *indio_dev)
{ … }
int __devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev,
struct module *this_mod)
{ … }
EXPORT_SYMBOL_GPL(…);
int iio_device_claim_direct_mode(struct iio_dev *indio_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
void iio_device_release_direct_mode(struct iio_dev *indio_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
int iio_device_claim_buffer_mode(struct iio_dev *indio_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
void iio_device_release_buffer_mode(struct iio_dev *indio_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
int iio_device_get_current_mode(struct iio_dev *indio_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
subsys_initcall(iio_init);
module_exit(iio_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;