#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/spi/spi.h>
#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
#include <linux/iio/triggered_buffer.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/regulator/consumer.h>
enum max1118_id { … };
struct max1118 { … };
#define MAX1118_CHANNEL(ch) …
static const struct iio_chan_spec max1118_channels[] = …;
static int max1118_read(struct iio_dev *indio_dev, int channel)
{ … }
static int max1118_get_vref_mV(struct iio_dev *indio_dev)
{ … }
static int max1118_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static const struct iio_info max1118_info = …;
static irqreturn_t max1118_trigger_handler(int irq, void *p)
{ … }
static void max1118_reg_disable(void *reg)
{ … }
static int max1118_probe(struct spi_device *spi)
{ … }
static const struct spi_device_id max1118_id[] = …;
MODULE_DEVICE_TABLE(spi, max1118_id);
static const struct of_device_id max1118_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, max1118_dt_ids);
static struct spi_driver max1118_spi_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;