#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/spi/spi.h>
#include <linux/delay.h>
#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
#include <linux/iio/trigger.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#define MAX1027_CONV_REG …
#define MAX1027_SETUP_REG …
#define MAX1027_AVG_REG …
#define MAX1027_RST_REG …
#define MAX1027_TEMP …
#define MAX1027_SCAN_0_N …
#define MAX1027_SCAN_N_M …
#define MAX1027_SCAN_N …
#define MAX1027_NOSCAN …
#define MAX1027_CHAN(n) …
#define MAX1027_UNIPOLAR …
#define MAX1027_BIPOLAR …
#define MAX1027_REF_MODE0 …
#define MAX1027_REF_MODE1 …
#define MAX1027_REF_MODE2 …
#define MAX1027_REF_MODE3 …
#define MAX1027_CKS_MODE0 …
#define MAX1027_CKS_MODE1 …
#define MAX1027_CKS_MODE2 …
#define MAX1027_CKS_MODE3 …
#define MAX1027_NSCAN_4 …
#define MAX1027_NSCAN_8 …
#define MAX1027_NSCAN_12 …
#define MAX1027_NSCAN_16 …
#define MAX1027_NAVG_4 …
#define MAX1027_NAVG_8 …
#define MAX1027_NAVG_16 …
#define MAX1027_NAVG_32 …
#define MAX1027_AVG_EN …
#define MAX1027_CONVERSION_UDELAY …
enum max1027_id { … };
static const struct spi_device_id max1027_id[] = …;
MODULE_DEVICE_TABLE(spi, max1027_id);
static const struct of_device_id max1027_adc_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids);
#define MAX1027_V_CHAN(index, depth) …
#define MAX1027_T_CHAN …
#define MAX1X27_CHANNELS(depth) …
#define MAX1X29_CHANNELS(depth) …
#define MAX1X31_CHANNELS(depth) …
static const struct iio_chan_spec max1027_channels[] = …;
static const struct iio_chan_spec max1029_channels[] = …;
static const struct iio_chan_spec max1031_channels[] = …;
static const struct iio_chan_spec max1227_channels[] = …;
static const struct iio_chan_spec max1229_channels[] = …;
static const struct iio_chan_spec max1231_channels[] = …;
#define MAX1X27_SCAN_MASK_TEMP …
#define MAX1X27_SCAN_MASKS(temp) …
#define MAX1X29_SCAN_MASKS(temp) …
#define MAX1X31_SCAN_MASKS(temp) …
static const unsigned long max1027_available_scan_masks[] = …;
static const unsigned long max1029_available_scan_masks[] = …;
static const unsigned long max1031_available_scan_masks[] = …;
struct max1027_chip_info { … };
static const struct max1027_chip_info max1027_chip_info_tbl[] = …;
struct max1027_state { … };
static int max1027_wait_eoc(struct iio_dev *indio_dev)
{ … }
static int max1027_configure_chans_and_start(struct iio_dev *indio_dev)
{ … }
static int max1027_enable_trigger(struct iio_dev *indio_dev, bool enable)
{ … }
static int max1027_read_single_value(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val)
{ … }
static int max1027_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static int max1027_debugfs_reg_access(struct iio_dev *indio_dev,
unsigned int reg, unsigned int writeval,
unsigned int *readval)
{ … }
static int max1027_set_cnvst_trigger_state(struct iio_trigger *trig, bool state)
{ … }
static int max1027_read_scan(struct iio_dev *indio_dev)
{ … }
static irqreturn_t max1027_handler(int irq, void *private)
{ … }
static irqreturn_t max1027_trigger_handler(int irq, void *private)
{ … }
static const struct iio_trigger_ops max1027_trigger_ops = …;
static const struct iio_info max1027_info = …;
static int max1027_probe(struct spi_device *spi)
{ … }
static struct spi_driver max1027_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;