#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/property.h>
#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#include <linux/regulator/consumer.h>
struct adc081c { … };
#define REG_CONV_RES …
static int adc081c_read_raw(struct iio_dev *iio,
struct iio_chan_spec const *channel, int *value,
int *shift, long mask)
{ … }
#define ADCxx1C_CHAN(_bits) …
#define DEFINE_ADCxx1C_CHANNELS(_name, _bits) … \
#define ADC081C_NUM_CHANNELS …
struct adcxx1c_model { … };
#define ADCxx1C_MODEL(_name, _bits) …
DEFINE_ADCxx1C_CHANNELS(adc081c, 8);
DEFINE_ADCxx1C_CHANNELS(adc101c, 10);
DEFINE_ADCxx1C_CHANNELS(adc121c, 12);
enum adcxx1c_model_id { … };
static struct adcxx1c_model adcxx1c_models[] = …;
static const struct iio_info adc081c_info = …;
static irqreturn_t adc081c_trigger_handler(int irq, void *p)
{ … }
static void adc081c_reg_disable(void *reg)
{ … }
static int adc081c_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id adc081c_id[] = …;
MODULE_DEVICE_TABLE(i2c, adc081c_id);
static const struct acpi_device_id adc081c_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, adc081c_acpi_match);
static const struct of_device_id adc081c_of_match[] = …;
MODULE_DEVICE_TABLE(of, adc081c_of_match);
static struct i2c_driver adc081c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;