#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/err.h>
#include <linux/mod_devicetable.h>
#include <linux/property.h>
#include <linux/iio/iio.h>
struct mcp4531_cfg { … };
enum mcp4531_type { … };
static const struct mcp4531_cfg mcp4531_cfg[] = …;
#define MCP4531_WRITE …
#define MCP4531_INCR …
#define MCP4531_DECR …
#define MCP4531_READ …
#define MCP4531_WIPER_SHIFT …
struct mcp4531_data { … };
#define MCP4531_CHANNEL(ch) …
static const struct iio_chan_spec mcp4531_channels[] = …;
static int mcp4531_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static int mcp4531_read_avail(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
const int **vals, int *type, int *length,
long mask)
{ … }
static int mcp4531_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ … }
static const struct iio_info mcp4531_info = …;
#define MCP4531_ID_TABLE(_name, cfg) …
static const struct i2c_device_id mcp4531_id[] = …;
MODULE_DEVICE_TABLE(i2c, mcp4531_id);
#define MCP4531_COMPATIBLE(of_compatible, cfg) …
static const struct of_device_id mcp4531_of_match[] = …;
MODULE_DEVICE_TABLE(of, mcp4531_of_match);
static int mcp4531_probe(struct i2c_client *client)
{ … }
static struct i2c_driver mcp4531_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;