linux/drivers/iio/dac/ad7303.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * AD7303 Digital to analog converters driver
 *
 * Copyright 2013 Analog Devices Inc.
 */

#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 - driver instance specific data
 * @spi:		the device for this driver instance
 * @config:		cached config register value
 * @dac_cache:		current DAC raw value (chip does not support readback)
 * @vdd_reg:		reference to VDD regulator
 * @vref_reg:		reference to VREF regulator
 * @lock:		protect writes and cache updates
 * @data:		spi transfer buffer
 */

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();