linux/drivers/iio/dac/ad5449.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * AD5415, AD5426, AD5429, AD5432, AD5439, AD5443, AD5449 Digital to Analog
 * Converter driver.
 *
 * Copyright 2012 Analog Devices Inc.
 *  Author: Lars-Peter Clausen <[email protected]>
 */

#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/unaligned.h>

#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

#define AD5449_MAX_CHANNELS
#define AD5449_MAX_VREFS

#define AD5449_CMD_NOOP
#define AD5449_CMD_LOAD_AND_UPDATE(x)
#define AD5449_CMD_READ(x)
#define AD5449_CMD_LOAD(x)
#define AD5449_CMD_CTRL

#define AD5449_CTRL_SDO_OFFSET
#define AD5449_CTRL_DAISY_CHAIN
#define AD5449_CTRL_HCLR_TO_MIDSCALE
#define AD5449_CTRL_SAMPLE_RISING

/**
 * struct ad5449_chip_info - chip specific information
 * @channels:		Channel specification
 * @num_channels:	Number of channels
 * @has_ctrl:		Chip has a control register
 */
struct ad5449_chip_info {};

/**
 * struct ad5449 - driver instance specific data
 * @spi:		the SPI device for this driver instance
 * @chip_info:		chip model specific constants, available modes etc
 * @vref_reg:		vref supply regulators
 * @has_sdo:		whether the SDO line is connected
 * @dac_cache:		Cache for the DAC values
 * @data:		spi transfer buffers
 * @lock:		lock to protect the data buffer during SPI ops
 */
struct ad5449 {};

enum ad5449_type {};

static int ad5449_write(struct iio_dev *indio_dev, unsigned int addr,
	unsigned int val)
{}

static int ad5449_read(struct iio_dev *indio_dev, unsigned int addr,
	unsigned int *val)
{}

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

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

static const struct iio_info ad5449_info =;

#define AD5449_CHANNEL(chan, bits)

#define DECLARE_AD5449_CHANNELS(name, bits)

static DECLARE_AD5449_CHANNELS(ad5429_channels, 8);
static DECLARE_AD5449_CHANNELS(ad5439_channels, 10);
static DECLARE_AD5449_CHANNELS(ad5449_channels, 12);

static const struct ad5449_chip_info ad5449_chip_info[] =;

static const char *ad5449_vref_name(struct ad5449 *st, int n)
{}

static int ad5449_spi_probe(struct spi_device *spi)
{}

static void ad5449_spi_remove(struct spi_device *spi)
{}

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

static struct spi_driver ad5449_spi_driver =;
module_spi_driver();

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