linux/drivers/iio/adc/ad7606_spi.c

// SPDX-License-Identifier: GPL-2.0
/*
 * AD7606 SPI ADC driver
 *
 * Copyright 2011 Analog Devices Inc.
 */

#include <linux/module.h>
#include <linux/spi/spi.h>
#include <linux/types.h>
#include <linux/err.h>

#include <linux/iio/iio.h>
#include "ad7606.h"

#define MAX_SPI_FREQ_HZ

#define AD7616_CONFIGURATION_REGISTER
#define AD7616_OS_MASK
#define AD7616_BURST_MODE
#define AD7616_SEQEN_MODE
#define AD7616_RANGE_CH_A_ADDR_OFF
#define AD7616_RANGE_CH_B_ADDR_OFF
/*
 * Range of channels from a group are stored in 2 registers.
 * 0, 1, 2, 3 in a register followed by 4, 5, 6, 7 in second register.
 * For channels from second group(8-15) the order is the same, only with
 * an offset of 2 for register address.
 */
#define AD7616_RANGE_CH_ADDR(ch)
/* The range of the channel is stored in 2 bits */
#define AD7616_RANGE_CH_MSK(ch)
#define AD7616_RANGE_CH_MODE(ch, mode)

#define AD7606_CONFIGURATION_REGISTER
#define AD7606_SINGLE_DOUT

/*
 * Range for AD7606B channels are stored in registers starting with address 0x3.
 * Each register stores range for 2 channels(4 bits per channel).
 */
#define AD7606_RANGE_CH_MSK(ch)
#define AD7606_RANGE_CH_MODE(ch, mode)
#define AD7606_RANGE_CH_ADDR(ch)
#define AD7606_OS_MODE

static const struct iio_chan_spec ad7616_sw_channels[] =;

static const struct iio_chan_spec ad7606b_sw_channels[] =;

static const unsigned int ad7606B_oversampling_avail[9] =;

static u16 ad7616_spi_rd_wr_cmd(int addr, char isWriteOp)
{}

static u16 ad7606B_spi_rd_wr_cmd(int addr, char is_write_op)
{}

static int ad7606_spi_read_block(struct device *dev,
				 int count, void *buf)
{}

static int ad7606_spi_reg_read(struct ad7606_state *st, unsigned int addr)
{}

static int ad7606_spi_reg_write(struct ad7606_state *st,
				unsigned int addr,
				unsigned int val)
{}

static int ad7606_spi_write_mask(struct ad7606_state *st,
				 unsigned int addr,
				 unsigned long mask,
				 unsigned int val)
{}

static int ad7616_write_scale_sw(struct iio_dev *indio_dev, int ch, int val)
{}

static int ad7616_write_os_sw(struct iio_dev *indio_dev, int val)
{}

static int ad7606_write_scale_sw(struct iio_dev *indio_dev, int ch, int val)
{}

static int ad7606_write_os_sw(struct iio_dev *indio_dev, int val)
{}

static int ad7616_sw_mode_config(struct iio_dev *indio_dev)
{}

static int ad7606B_sw_mode_config(struct iio_dev *indio_dev)
{}

static const struct ad7606_bus_ops ad7606_spi_bops =;

static const struct ad7606_bus_ops ad7616_spi_bops =;

static const struct ad7606_bus_ops ad7606B_spi_bops =;

static int ad7606_spi_probe(struct spi_device *spi)
{}

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

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

static struct spi_driver ad7606_driver =;
module_spi_driver();

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