linux/drivers/iio/dac/ad5360.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Analog devices AD5360, AD5361, AD5362, AD5363, AD5370, AD5371, AD5373
 * multi-channel Digital to Analog Converters driver
 *
 * Copyright 2011 Analog Devices Inc.
 */

#include <linux/device.h>
#include <linux/err.h>
#include <linux/module.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 AD5360_CMD(x)
#define AD5360_ADDR(x)

#define AD5360_READBACK_TYPE(x)
#define AD5360_READBACK_ADDR(x)

#define AD5360_CHAN_ADDR(chan)

#define AD5360_CMD_WRITE_DATA
#define AD5360_CMD_WRITE_OFFSET
#define AD5360_CMD_WRITE_GAIN
#define AD5360_CMD_SPECIAL_FUNCTION

/* Special function register addresses */
#define AD5360_REG_SF_NOP
#define AD5360_REG_SF_CTRL
#define AD5360_REG_SF_OFS(x)
#define AD5360_REG_SF_READBACK

#define AD5360_SF_CTRL_PWR_DOWN

#define AD5360_READBACK_X1A
#define AD5360_READBACK_X1B
#define AD5360_READBACK_OFFSET
#define AD5360_READBACK_GAIN
#define AD5360_READBACK_SF


/**
 * struct ad5360_chip_info - chip specific information
 * @channel_template:	channel specification template
 * @num_channels:	number of channels
 * @channels_per_group:	number of channels per group
 * @num_vrefs:		number of vref supplies for the chip
*/

struct ad5360_chip_info {};

/**
 * struct ad5360_state - driver instance specific data
 * @spi:		spi_device
 * @chip_info:		chip model specific constants, available modes etc
 * @vref_reg:		vref supply regulators
 * @ctrl:		control register cache
 * @lock:		lock to protect the data buffer during SPI ops
 * @data:		spi transfer buffers
 */

struct ad5360_state {};

enum ad5360_type {};

#define AD5360_CHANNEL(bits)

static const struct ad5360_chip_info ad5360_chip_info_tbl[] =;

static unsigned int ad5360_get_channel_vref_index(struct ad5360_state *st,
	unsigned int channel)
{}

static int ad5360_get_channel_vref(struct ad5360_state *st,
	unsigned int channel)
{}


static int ad5360_write_unlocked(struct iio_dev *indio_dev,
	unsigned int cmd, unsigned int addr, unsigned int val,
	unsigned int shift)
{}

static int ad5360_write(struct iio_dev *indio_dev, unsigned int cmd,
	unsigned int addr, unsigned int val, unsigned int shift)
{}

static int ad5360_read(struct iio_dev *indio_dev, unsigned int type,
	unsigned int addr)
{}

static ssize_t ad5360_read_dac_powerdown(struct device *dev,
					   struct device_attribute *attr,
					   char *buf)
{}

static int ad5360_update_ctrl(struct iio_dev *indio_dev, unsigned int set,
	unsigned int clr)
{}

static ssize_t ad5360_write_dac_powerdown(struct device *dev,
	struct device_attribute *attr, const char *buf, size_t len)
{}

static IIO_DEVICE_ATTR(out_voltage_powerdown,
			S_IRUGO | S_IWUSR,
			ad5360_read_dac_powerdown,
			ad5360_write_dac_powerdown, 0);

static struct attribute *ad5360_attributes[] =;

static const struct attribute_group ad5360_attribute_group =;

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

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

static const struct iio_info ad5360_info =;

static const char * const ad5360_vref_name[] =;

static int ad5360_alloc_channels(struct iio_dev *indio_dev)
{}

static int ad5360_probe(struct spi_device *spi)
{}

static void ad5360_remove(struct spi_device *spi)
{}

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

static struct spi_driver ad5360_driver =;
module_spi_driver();

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