#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/sysfs.h>
#include <linux/list.h>
#include <linux/i2c.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/property.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/events.h>
#include <linux/iio/buffer.h>
#include <linux/iio/kfifo_buf.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#define MAX1363_SETUP_BYTE(a) …
#define MAX1363_SETUP_AIN3_IS_AIN3_REF_IS_VDD …
#define MAX1363_SETUP_AIN3_IS_REF_EXT_TO_REF …
#define MAX1363_SETUP_AIN3_IS_AIN3_REF_IS_INT …
#define MAX1363_SETUP_AIN3_IS_REF_REF_IS_INT …
#define MAX1363_SETUP_POWER_UP_INT_REF …
#define MAX1363_SETUP_POWER_DOWN_INT_REF …
#define MAX1363_SETUP_EXT_CLOCK …
#define MAX1363_SETUP_INT_CLOCK …
#define MAX1363_SETUP_UNIPOLAR …
#define MAX1363_SETUP_BIPOLAR …
#define MAX1363_SETUP_RESET …
#define MAX1363_SETUP_NORESET …
#define MAX1363_SETUP_MONITOR_SETUP …
#define MAX1363_MON_RESET_CHAN(a) …
#define MAX1363_MON_INT_ENABLE …
#define MAX1363_CONFIG_BYTE(a) …
#define MAX1363_CONFIG_SE …
#define MAX1363_CONFIG_DE …
#define MAX1363_CONFIG_SCAN_TO_CS …
#define MAX1363_CONFIG_SCAN_SINGLE_8 …
#define MAX1363_CONFIG_SCAN_MONITOR_MODE …
#define MAX1363_CONFIG_SCAN_SINGLE_1 …
#define MAX1236_SCAN_MID_TO_CHANNEL …
#define MAX1363_CONFIG_EN_MON_MODE_READ …
#define MAX1363_CHANNEL_SEL(a) …
#define MAX1363_CHANNEL_SEL_MASK …
#define MAX1363_SCAN_MASK …
#define MAX1363_SE_DE_MASK …
#define MAX1363_MAX_CHANNELS …
struct max1363_mode { … };
enum max1363_modes { … };
struct max1363_chip_info { … };
struct max1363_state { … };
#define MAX1363_MODE_SINGLE(_num, _mask) …
#define MAX1363_MODE_SCAN_TO_CHANNEL(_num, _mask) …
#define MAX1236_MODE_SCAN_MID_TO_CHANNEL(_mid, _num, _mask) …
#define MAX1363_MODE_DIFF_SINGLE(_nump, _numm, _mask) …
#define MAX1363_MODE_DIFF_SCAN_TO_CHANNEL(_num, _numvals, _mask) …
#define MAX1236_MODE_DIFF_SCAN_MID_TO_CHANNEL(_num, _numvals, _mask) …
static const struct max1363_mode max1363_mode_table[] = …;
static const struct max1363_mode
*max1363_match_mode(const unsigned long *mask,
const struct max1363_chip_info *ci)
{ … }
static int max1363_smbus_send(const struct i2c_client *client, const char *buf,
int count)
{ … }
static int max1363_smbus_recv(const struct i2c_client *client, char *buf,
int count)
{ … }
static int max1363_write_basic_config(struct max1363_state *st)
{ … }
static int max1363_set_scan_mode(struct max1363_state *st)
{ … }
static int max1363_read_single_chan(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val,
long m)
{ … }
static int max1363_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val,
int *val2,
long m)
{ … }
static const enum max1363_modes max1363_mode_list[] = …;
static const struct iio_event_spec max1363_events[] = …;
#define MAX1363_CHAN_U(num, addr, si, bits, ev_spec, num_ev_spec) …
#define MAX1363_CHAN_B(num, num2, addr, si, bits, ev_spec, num_ev_spec) …
#define MAX1363_4X_CHANS(bits, ev_spec, num_ev_spec) …
static const struct iio_chan_spec max1036_channels[] = …;
static const struct iio_chan_spec max1136_channels[] = …;
static const struct iio_chan_spec max1236_channels[] = …;
static const struct iio_chan_spec max1361_channels[] = …;
static const struct iio_chan_spec max1363_channels[] = …;
static const enum max1363_modes max1236_mode_list[] = …;
static const enum max1363_modes max1238_mode_list[] = …;
#define MAX1363_12X_CHANS(bits) …
static const struct iio_chan_spec max1038_channels[] = …;
static const struct iio_chan_spec max1138_channels[] = …;
static const struct iio_chan_spec max1238_channels[] = …;
static const enum max1363_modes max11607_mode_list[] = …;
static const enum max1363_modes max11608_mode_list[] = …;
#define MAX1363_8X_CHANS(bits) …
static const struct iio_chan_spec max11602_channels[] = …;
static const struct iio_chan_spec max11608_channels[] = …;
static const struct iio_chan_spec max11614_channels[] = …;
static const enum max1363_modes max11644_mode_list[] = …;
#define MAX1363_2X_CHANS(bits) …
static const struct iio_chan_spec max11646_channels[] = …;
static const struct iio_chan_spec max11644_channels[] = …;
enum { … };
static const int max1363_monitor_speeds[] = …;
static ssize_t max1363_monitor_show_freq(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t max1363_monitor_store_freq(struct device *dev,
struct device_attribute *attr,
const char *buf,
size_t len)
{ … }
static IIO_DEV_ATTR_SAMP_FREQ(S_IRUGO | S_IWUSR,
max1363_monitor_show_freq,
max1363_monitor_store_freq);
static IIO_CONST_ATTR(sampling_frequency_available,
"133000 665000 33300 16600 8300 4200 2000 1000");
static int max1363_read_thresh(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan, enum iio_event_type type,
enum iio_event_direction dir, enum iio_event_info info, int *val,
int *val2)
{ … }
static int max1363_write_thresh(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan, enum iio_event_type type,
enum iio_event_direction dir, enum iio_event_info info, int val,
int val2)
{ … }
static const u64 max1363_event_codes[] = …;
static irqreturn_t max1363_event_handler(int irq, void *private)
{ … }
static int max1363_read_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan, enum iio_event_type type,
enum iio_event_direction dir)
{ … }
static int max1363_monitor_mode_update(struct max1363_state *st, int enabled)
{ … }
static inline int __max1363_check_event_mask(int thismask, int checkmask)
{ … }
static int max1363_write_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan, enum iio_event_type type,
enum iio_event_direction dir, int state)
{ … }
static struct attribute *max1363_event_attributes[] = …;
static const struct attribute_group max1363_event_attribute_group = …;
static int max1363_update_scan_mode(struct iio_dev *indio_dev,
const unsigned long *scan_mask)
{ … }
static const struct iio_info max1238_info = …;
static const struct iio_info max1363_info = …;
static const struct max1363_chip_info max1363_chip_info_tbl[] = …;
static int max1363_initial_setup(struct max1363_state *st)
{ … }
static int max1363_alloc_scan_masks(struct iio_dev *indio_dev)
{ … }
static irqreturn_t max1363_trigger_handler(int irq, void *p)
{ … }
#define MAX1363_COMPATIBLE(of_compatible, cfg) …
static const struct of_device_id max1363_of_match[] = …;
MODULE_DEVICE_TABLE(of, max1363_of_match);
static int max1363_probe(struct i2c_client *client)
{ … }
#define MAX1363_ID_TABLE(_name, cfg) …
static const struct i2c_device_id max1363_id[] = …;
MODULE_DEVICE_TABLE(i2c, max1363_id);
static struct i2c_driver max1363_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;