linux/drivers/iio/dac/ad5761.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * AD5721, AD5721R, AD5761, AD5761R, Voltage Output Digital to Analog Converter
 *
 * Copyright 2016 Qtechnology A/S
 * 2016 Ricardo Ribalda <[email protected]>
 */
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/spi/spi.h>
#include <linux/bitops.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/regulator/consumer.h>
#include <linux/platform_data/ad5761.h>

#define AD5761_ADDR(addr)
#define AD5761_ADDR_NOOP
#define AD5761_ADDR_DAC_WRITE
#define AD5761_ADDR_CTRL_WRITE_REG
#define AD5761_ADDR_SW_DATA_RESET
#define AD5761_ADDR_DAC_READ
#define AD5761_ADDR_CTRL_READ_REG
#define AD5761_ADDR_SW_FULL_RESET

#define AD5761_CTRL_USE_INTVREF
#define AD5761_CTRL_ETS

/**
 * struct ad5761_chip_info - chip specific information
 * @int_vref:	Value of the internal reference voltage in mV - 0 if external
 *		reference voltage is used
 * @channel:	channel specification
*/

struct ad5761_chip_info {};

struct ad5761_range_params {};

enum ad5761_supported_device_ids {};

/**
 * struct ad5761_state - driver instance specific data
 * @spi:		spi_device
 * @vref_reg:		reference voltage regulator
 * @use_intref:		true when the internal voltage reference is used
 * @vref:		actual voltage reference in mVolts
 * @range:		output range mode used
 * @lock:		lock to protect the data buffer during SPI ops
 * @data:		cache aligned spi buffer
 */
struct ad5761_state {};

static const struct ad5761_range_params ad5761_range_params[] =;

static int _ad5761_spi_write(struct ad5761_state *st, u8 addr, u16 val)
{}

static int ad5761_spi_write(struct iio_dev *indio_dev, u8 addr, u16 val)
{}

static int _ad5761_spi_read(struct ad5761_state *st, u8 addr, u16 *val)
{}

static int ad5761_spi_read(struct iio_dev *indio_dev, u8 addr, u16 *val)
{}

static int ad5761_spi_set_range(struct ad5761_state *st,
				enum ad5761_voltage_range range)
{}

static int ad5761_read_raw(struct iio_dev *indio_dev,
			   struct iio_chan_spec const *chan,
			   int *val,
			   int *val2,
			   long mask)
{}

static int ad5761_write_raw(struct iio_dev *indio_dev,
			    struct iio_chan_spec const *chan,
			    int val,
			    int val2,
			    long mask)
{}

static const struct iio_info ad5761_info =;

#define AD5761_CHAN(_bits)

static const struct ad5761_chip_info ad5761_chip_infos[] =;

static int ad5761_get_vref(struct ad5761_state *st,
			   const struct ad5761_chip_info *chip_info)
{}

static int ad5761_probe(struct spi_device *spi)
{}

static void ad5761_remove(struct spi_device *spi)
{}

static const struct spi_device_id ad5761_id[] =;
MODULE_DEVICE_TABLE(spi, ad5761_id);

static struct spi_driver ad5761_driver =;
module_spi_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();