#include <linux/err.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/kernel.h>
#include <linux/spi/spi.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/regulator/consumer.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#define AD7303_CFG_EXTERNAL_VREF …
#define AD7303_CFG_POWER_DOWN(ch) …
#define AD7303_CFG_ADDR_OFFSET …
#define AD7303_CMD_UPDATE_DAC …
struct ad7303_state { … };
static int ad7303_write(struct ad7303_state *st, unsigned int chan,
uint8_t val)
{ … }
static ssize_t ad7303_read_dac_powerdown(struct iio_dev *indio_dev,
uintptr_t private, const struct iio_chan_spec *chan, char *buf)
{ … }
static ssize_t ad7303_write_dac_powerdown(struct iio_dev *indio_dev,
uintptr_t private, const struct iio_chan_spec *chan, const char *buf,
size_t len)
{ … }
static int ad7303_get_vref(struct ad7303_state *st,
struct iio_chan_spec const *chan)
{ … }
static int ad7303_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val, int *val2, long info)
{ … }
static int ad7303_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int val, int val2, long mask)
{ … }
static const struct iio_info ad7303_info = …;
static const struct iio_chan_spec_ext_info ad7303_ext_info[] = …;
#define AD7303_CHANNEL(chan) …
static const struct iio_chan_spec ad7303_channels[] = …;
static void ad7303_reg_disable(void *reg)
{ … }
static int ad7303_probe(struct spi_device *spi)
{ … }
static const struct of_device_id ad7303_spi_of_match[] = …;
MODULE_DEVICE_TABLE(of, ad7303_spi_of_match);
static const struct spi_device_id ad7303_spi_ids[] = …;
MODULE_DEVICE_TABLE(spi, ad7303_spi_ids);
static struct spi_driver ad7303_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;