linux/drivers/iio/adc/ad7923.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * AD7904/AD7914/AD7923/AD7924/AD7908/AD7918/AD7928 SPI ADC driver
 *
 * Copyright 2011 Analog Devices Inc (from AD7923 Driver)
 * Copyright 2012 CS Systemes d'Information
 */

#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/property.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/spi/spi.h>
#include <linux/regulator/consumer.h>
#include <linux/err.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/interrupt.h>

#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/buffer.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>

#define AD7923_WRITE_CR
#define AD7923_RANGE
#define AD7923_CODING
#define AD7923_PM_MODE_AS
#define AD7923_PM_MODE_FS
#define AD7923_PM_MODE_OPS
#define AD7923_SEQUENCE_OFF
#define AD7923_SEQUENCE_PROTECT
#define AD7923_SEQUENCE_ON


#define AD7923_PM_MODE_WRITE(mode)
#define AD7923_CHANNEL_WRITE(channel)
#define AD7923_SEQUENCE_WRITE(sequence)
						/* write sequence fonction */
/* left shift for CR : bit 11 transmit in first */
#define AD7923_SHIFT_REGISTER

/* val = value, dec = left shift, bits = number of bits of the mask */
#define EXTRACT(val, dec, bits)

struct ad7923_state {};

struct ad7923_chip_info {};

enum ad7923_id {};

#define AD7923_V_CHAN(index, bits)

#define DECLARE_AD7923_CHANNELS(name, bits)

#define DECLARE_AD7908_CHANNELS(name, bits)

static DECLARE_AD7923_CHANNELS(ad7904, 8);
static DECLARE_AD7923_CHANNELS(ad7914, 10);
static DECLARE_AD7923_CHANNELS(ad7924, 12);
static DECLARE_AD7908_CHANNELS(ad7908, 8);
static DECLARE_AD7908_CHANNELS(ad7918, 10);
static DECLARE_AD7908_CHANNELS(ad7928, 12);

static const struct ad7923_chip_info ad7923_chip_info[] =;

/*
 * ad7923_update_scan_mode() setup the spi transfer buffer for the new scan mask
 */
static int ad7923_update_scan_mode(struct iio_dev *indio_dev,
				   const unsigned long *active_scan_mask)
{}

static irqreturn_t ad7923_trigger_handler(int irq, void *p)
{}

static int ad7923_scan_direct(struct ad7923_state *st, unsigned int ch)
{}

static int ad7923_get_range(struct ad7923_state *st)
{}

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

static const struct iio_info ad7923_info =;

static void ad7923_regulator_disable(void *data)
{}

static int ad7923_probe(struct spi_device *spi)
{}

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

static const struct of_device_id ad7923_of_match[] =;
MODULE_DEVICE_TABLE(of, ad7923_of_match);

static struct spi_driver ad7923_driver =;
module_spi_driver();

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