#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/spi/spi.h>
#include <linux/iio/iio.h>
#include <linux/iio/types.h>
#include <asm/unaligned.h>
#define MCP4821_ACTIVE_MODE …
#define MCP4802_SECOND_CHAN …
#define MCP4821_2X_GAIN_VREF_MV …
enum mcp4821_supported_drvice_ids { … };
struct mcp4821_state { … };
struct mcp4821_chip_info { … };
#define MCP4821_CHAN(channel_id, resolution) …
static const struct mcp4821_chip_info mcp4821_chip_info_table[6] = …;
static int mcp4821_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val,
int *val2, long mask)
{ … }
static int mcp4821_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int val,
int val2, long mask)
{ … }
static const struct iio_info mcp4821_info = …;
static int mcp4821_probe(struct spi_device *spi)
{ … }
#define MCP4821_COMPATIBLE(of_compatible, id) …
static const struct of_device_id mcp4821_of_table[] = …;
MODULE_DEVICE_TABLE(of, mcp4821_of_table);
static const struct spi_device_id mcp4821_id_table[] = …;
MODULE_DEVICE_TABLE(spi, mcp4821_id_table);
static struct spi_driver mcp4821_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;