2018-12-17 14:23:36 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2011-02-22 21:46:18 +01:00
|
|
|
/*
|
|
|
|
* AD7606 ADC driver
|
|
|
|
*
|
|
|
|
* Copyright 2011 Analog Devices Inc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef IIO_ADC_AD7606_H_
|
|
|
|
#define IIO_ADC_AD7606_H_
|
|
|
|
|
2024-09-19 16:04:39 +03:00
|
|
|
#define AD760X_MAX_CHANNELS 16
|
|
|
|
|
2025-02-10 17:10:53 +01:00
|
|
|
#define AD7616_CONFIGURATION_REGISTER 0x02
|
|
|
|
#define AD7616_OS_MASK GENMASK(4, 2)
|
|
|
|
#define AD7616_BURST_MODE BIT(6)
|
|
|
|
#define AD7616_SEQEN_MODE BIT(5)
|
|
|
|
#define AD7616_RANGE_CH_A_ADDR_OFF 0x04
|
|
|
|
#define AD7616_RANGE_CH_B_ADDR_OFF 0x06
|
|
|
|
/*
|
|
|
|
* 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) ((ch) >> 2)
|
|
|
|
/* The range of the channel is stored in 2 bits */
|
|
|
|
#define AD7616_RANGE_CH_MSK(ch) (0b11 << (((ch) & 0b11) * 2))
|
|
|
|
#define AD7616_RANGE_CH_MODE(ch, mode) ((mode) << ((((ch) & 0b11)) * 2))
|
|
|
|
|
|
|
|
#define AD7606_CONFIGURATION_REGISTER 0x02
|
|
|
|
#define AD7606_SINGLE_DOUT 0x00
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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) (GENMASK(3, 0) << (4 * ((ch) & 0x1)))
|
|
|
|
#define AD7606_RANGE_CH_MODE(ch, mode) \
|
|
|
|
((GENMASK(3, 0) & (mode)) << (4 * ((ch) & 0x1)))
|
|
|
|
#define AD7606_RANGE_CH_ADDR(ch) (0x03 + ((ch) >> 1))
|
|
|
|
#define AD7606_OS_MODE 0x08
|
|
|
|
|
2025-06-06 16:19:18 +02:00
|
|
|
#define AD7606_CALIB_GAIN(ch) (0x09 + (ch))
|
|
|
|
#define AD7606_CALIB_GAIN_MASK GENMASK(5, 0)
|
|
|
|
#define AD7606_CALIB_OFFSET(ch) (0x11 + (ch))
|
|
|
|
#define AD7606_CALIB_PHASE(ch) (0x19 + (ch))
|
|
|
|
|
2024-09-19 16:04:38 +03:00
|
|
|
struct ad7606_state;
|
|
|
|
|
2024-12-10 10:46:41 +00:00
|
|
|
typedef int (*ad7606_scale_setup_cb_t)(struct iio_dev *indio_dev,
|
2025-03-18 17:52:16 -05:00
|
|
|
struct iio_chan_spec *chan);
|
2025-02-10 17:10:53 +01:00
|
|
|
typedef int (*ad7606_sw_setup_cb_t)(struct iio_dev *indio_dev);
|
2024-09-19 16:04:38 +03:00
|
|
|
|
2011-02-22 21:46:18 +01:00
|
|
|
/**
|
2014-04-22 12:23:00 +01:00
|
|
|
* struct ad7606_chip_info - chip specific information
|
2025-03-18 17:52:13 -05:00
|
|
|
* @max_samplerate: maximum supported sample rate
|
|
|
|
* @name: device name
|
2025-03-18 17:52:17 -05:00
|
|
|
* @bits: data width in bits
|
2025-03-18 17:52:13 -05:00
|
|
|
* @num_adc_channels: the number of physical voltage inputs
|
2024-09-19 16:04:38 +03:00
|
|
|
* @scale_setup_cb: callback to setup the scales for each channel
|
2025-02-10 17:10:53 +01:00
|
|
|
* @sw_setup_cb: callback to setup the software mode if available.
|
2025-03-18 17:52:13 -05:00
|
|
|
* @oversampling_avail: pointer to the array which stores the available
|
2019-04-02 16:18:39 +03:00
|
|
|
* oversampling ratios.
|
2025-03-18 17:52:13 -05:00
|
|
|
* @oversampling_num: number of elements stored in oversampling_avail array
|
|
|
|
* @os_req_reset: some devices require a reset to update oversampling
|
|
|
|
* @init_delay_ms: required delay in milliseconds for initialization
|
2019-08-21 17:16:53 +03:00
|
|
|
* after a restart
|
2025-04-03 18:19:06 +02:00
|
|
|
* @offload_storagebits: storage bits used by the offload hw implementation
|
2025-06-06 16:19:22 +02:00
|
|
|
* @calib_gain_avail: chip supports gain calibration
|
2025-06-06 16:19:18 +02:00
|
|
|
* @calib_offset_avail: pointer to offset calibration range/limits array
|
|
|
|
* @calib_phase_avail: pointer to phase calibration range/limits array
|
2011-02-22 21:46:18 +01:00
|
|
|
*/
|
|
|
|
struct ad7606_chip_info {
|
2024-10-15 13:56:20 +00:00
|
|
|
unsigned int max_samplerate;
|
2024-10-15 13:56:18 +00:00
|
|
|
const char *name;
|
2025-03-18 17:52:17 -05:00
|
|
|
unsigned int bits;
|
2024-10-15 13:56:19 +00:00
|
|
|
unsigned int num_adc_channels;
|
2024-09-19 16:04:38 +03:00
|
|
|
ad7606_scale_setup_cb_t scale_setup_cb;
|
2025-02-10 17:10:53 +01:00
|
|
|
ad7606_sw_setup_cb_t sw_setup_cb;
|
2019-04-02 16:18:39 +03:00
|
|
|
const unsigned int *oversampling_avail;
|
|
|
|
unsigned int oversampling_num;
|
2019-04-02 16:18:40 +03:00
|
|
|
bool os_req_reset;
|
2019-08-21 17:16:53 +03:00
|
|
|
unsigned long init_delay_ms;
|
2025-04-03 18:19:06 +02:00
|
|
|
u8 offload_storagebits;
|
2025-06-06 16:19:22 +02:00
|
|
|
bool calib_gain_avail;
|
2025-06-06 16:19:18 +02:00
|
|
|
const int *calib_offset_avail;
|
|
|
|
const int (*calib_phase_avail)[2];
|
2011-02-22 21:46:18 +01:00
|
|
|
};
|
|
|
|
|
2024-09-19 16:04:39 +03:00
|
|
|
/**
|
2025-06-06 16:19:21 +02:00
|
|
|
* struct ad7606_chan_info - channel configuration
|
2025-03-18 17:52:13 -05:00
|
|
|
* @scale_avail: pointer to the array which stores the available scales
|
|
|
|
* @num_scales: number of elements stored in the scale_avail array
|
|
|
|
* @range: voltage range selection, selects which scale to apply
|
|
|
|
* @reg_offset: offset for the register value, to be applied when
|
iio: adc: ad7606: add support for AD7606C-{16,18} parts
The AD7606C-16 and AD7606C-18 are pretty similar with the AD7606B.
The main difference between AD7606C-16 & AD7606C-18 is the precision in
bits (16 vs 18).
Because of that, some scales need to be defined for the 18-bit variants, as
they need to be computed against 2**18 (vs 2**16 for the 16 bit-variants).
Because the AD7606C-16,18 also supports bipolar & differential channels,
for SW-mode, the default range of 10 V or ±10V should be set at probe.
On reset, the default range (in the registers) is set to value 0x3 which
corresponds to '±10 V single-ended range', regardless of bipolar or
differential configuration.
Aside from the scale/ranges, the AD7606C-16 is similar to the AD7606B.
The AD7606C-18 variant offers 18-bit precision. Because of this, the
requirement to use this chip is that the SPI controller supports padding
of 18-bit sequences to 32-bit arrays.
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606c-16.pdf
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606c-18.pdf
Signed-off-by: Alexandru Ardelean <aardelean@baylibre.com>
Link: https://patch.msgid.link/20240919130444.2100447-9-aardelean@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-19 16:04:43 +03:00
|
|
|
* writing the value of 'range' to the register value
|
2025-06-06 16:19:22 +02:00
|
|
|
* @r_gain: gain resistor value in ohms, to be set to match the
|
|
|
|
* external r_filter value
|
2024-09-19 16:04:39 +03:00
|
|
|
*/
|
2025-06-06 16:19:21 +02:00
|
|
|
struct ad7606_chan_info {
|
2024-09-19 16:04:40 +03:00
|
|
|
#define AD760X_MAX_SCALES 16
|
2024-10-25 12:59:37 +03:00
|
|
|
const unsigned int (*scale_avail)[2];
|
2024-09-19 16:04:39 +03:00
|
|
|
unsigned int num_scales;
|
|
|
|
unsigned int range;
|
iio: adc: ad7606: add support for AD7606C-{16,18} parts
The AD7606C-16 and AD7606C-18 are pretty similar with the AD7606B.
The main difference between AD7606C-16 & AD7606C-18 is the precision in
bits (16 vs 18).
Because of that, some scales need to be defined for the 18-bit variants, as
they need to be computed against 2**18 (vs 2**16 for the 16 bit-variants).
Because the AD7606C-16,18 also supports bipolar & differential channels,
for SW-mode, the default range of 10 V or ±10V should be set at probe.
On reset, the default range (in the registers) is set to value 0x3 which
corresponds to '±10 V single-ended range', regardless of bipolar or
differential configuration.
Aside from the scale/ranges, the AD7606C-16 is similar to the AD7606B.
The AD7606C-18 variant offers 18-bit precision. Because of this, the
requirement to use this chip is that the SPI controller supports padding
of 18-bit sequences to 32-bit arrays.
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606c-16.pdf
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606c-18.pdf
Signed-off-by: Alexandru Ardelean <aardelean@baylibre.com>
Link: https://patch.msgid.link/20240919130444.2100447-9-aardelean@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-19 16:04:43 +03:00
|
|
|
unsigned int reg_offset;
|
2025-06-06 16:19:22 +02:00
|
|
|
unsigned int r_gain;
|
2024-09-19 16:04:39 +03:00
|
|
|
};
|
|
|
|
|
2011-02-22 21:46:18 +01:00
|
|
|
/**
|
|
|
|
* struct ad7606_state - driver instance specific data
|
2025-03-18 17:52:13 -05:00
|
|
|
* @dev: pointer to kernel device
|
|
|
|
* @chip_info: entry in the table of chips that describes this device
|
|
|
|
* @bops: bus operations (SPI or parallel)
|
2025-06-06 16:19:21 +02:00
|
|
|
* @chan_info: scale configuration for channels
|
2025-03-18 17:52:13 -05:00
|
|
|
* @oversampling: oversampling selection
|
|
|
|
* @cnvst_pwm: pointer to the PWM device connected to the cnvst pin
|
|
|
|
* @base_address: address from where to read data in parallel operation
|
|
|
|
* @sw_mode_en: software mode enabled
|
|
|
|
* @oversampling_avail: pointer to the array which stores the available
|
2019-04-02 16:18:39 +03:00
|
|
|
* oversampling ratios.
|
2025-03-18 17:52:13 -05:00
|
|
|
* @num_os_ratios: number of elements stored in oversampling_avail array
|
|
|
|
* @back: pointer to the iio_backend structure, if used
|
|
|
|
* @write_scale: pointer to the function which writes the scale
|
|
|
|
* @write_os: pointer to the function which writes the os
|
|
|
|
* @lock: protect sensor state from concurrent accesses to GPIOs
|
|
|
|
* @gpio_convst: GPIO descriptor for conversion start signal (CONVST)
|
|
|
|
* @gpio_reset: GPIO descriptor for device hard-reset
|
|
|
|
* @gpio_range: GPIO descriptor for range selection
|
|
|
|
* @gpio_standby: GPIO descriptor for stand-by signal (STBY),
|
2018-09-18 15:15:03 +03:00
|
|
|
* controls power-down mode of device
|
2025-03-18 17:52:13 -05:00
|
|
|
* @gpio_frstdata: GPIO descriptor for reading from device when data
|
2018-09-18 15:15:03 +03:00
|
|
|
* is being read on the first channel
|
2025-03-18 17:52:13 -05:00
|
|
|
* @gpio_os: GPIO descriptors to control oversampling on the device
|
|
|
|
* @trig: The IIO trigger associated with the device.
|
|
|
|
* @completion: completion to indicate end of conversion
|
|
|
|
* @data: buffer for reading data from the device
|
2025-04-03 18:19:06 +02:00
|
|
|
* @offload_en: SPI offload enabled
|
|
|
|
* @bus_data: bus-specific variables
|
2025-03-18 17:52:13 -05:00
|
|
|
* @d16: be16 buffer for reading data from the device
|
2011-02-22 21:46:18 +01:00
|
|
|
*/
|
|
|
|
struct ad7606_state {
|
|
|
|
struct device *dev;
|
|
|
|
const struct ad7606_chip_info *chip_info;
|
|
|
|
const struct ad7606_bus_ops *bops;
|
2025-06-06 16:19:21 +02:00
|
|
|
struct ad7606_chan_info chan_info[AD760X_MAX_CHANNELS];
|
2016-03-26 12:50:24 -07:00
|
|
|
unsigned int oversampling;
|
2024-10-15 13:56:17 +00:00
|
|
|
struct pwm_device *cnvst_pwm;
|
2011-02-22 21:46:18 +01:00
|
|
|
void __iomem *base_address;
|
2019-05-27 15:56:48 +03:00
|
|
|
bool sw_mode_en;
|
2019-04-02 16:18:39 +03:00
|
|
|
const unsigned int *oversampling_avail;
|
|
|
|
unsigned int num_os_ratios;
|
2024-10-15 13:56:20 +00:00
|
|
|
struct iio_backend *back;
|
2019-05-27 15:56:47 +03:00
|
|
|
int (*write_scale)(struct iio_dev *indio_dev, int ch, int val);
|
|
|
|
int (*write_os)(struct iio_dev *indio_dev, int val);
|
2011-02-22 21:46:18 +01:00
|
|
|
|
2017-03-21 01:21:34 +05:30
|
|
|
struct mutex lock; /* protect sensor state */
|
2016-10-19 19:07:07 +02:00
|
|
|
struct gpio_desc *gpio_convst;
|
|
|
|
struct gpio_desc *gpio_reset;
|
|
|
|
struct gpio_desc *gpio_range;
|
|
|
|
struct gpio_desc *gpio_standby;
|
|
|
|
struct gpio_desc *gpio_frstdata;
|
|
|
|
struct gpio_descs *gpio_os;
|
2018-12-17 14:23:37 +02:00
|
|
|
struct iio_trigger *trig;
|
2018-12-13 14:46:15 +02:00
|
|
|
struct completion completion;
|
2016-10-19 19:07:07 +02:00
|
|
|
|
2025-04-03 18:19:06 +02:00
|
|
|
bool offload_en;
|
|
|
|
void *bus_data;
|
|
|
|
|
2011-02-22 21:46:18 +01:00
|
|
|
/*
|
2022-05-08 18:55:54 +01:00
|
|
|
* DMA (thus cache coherency maintenance) may require the
|
2011-02-22 21:46:18 +01:00
|
|
|
* transfer buffers to live in their own cache lines.
|
2025-04-28 21:17:14 -05:00
|
|
|
* 16 * 16-bit samples for AD7616
|
|
|
|
* 8 * 32-bit samples for AD7616C-18 (and similar)
|
2011-02-22 21:46:18 +01:00
|
|
|
*/
|
2025-04-28 21:17:14 -05:00
|
|
|
struct {
|
|
|
|
union {
|
|
|
|
u16 buf16[16];
|
|
|
|
u32 buf32[8];
|
|
|
|
};
|
|
|
|
aligned_s64 timestamp;
|
iio: adc: ad7606: add support for AD7606C-{16,18} parts
The AD7606C-16 and AD7606C-18 are pretty similar with the AD7606B.
The main difference between AD7606C-16 & AD7606C-18 is the precision in
bits (16 vs 18).
Because of that, some scales need to be defined for the 18-bit variants, as
they need to be computed against 2**18 (vs 2**16 for the 16 bit-variants).
Because the AD7606C-16,18 also supports bipolar & differential channels,
for SW-mode, the default range of 10 V or ±10V should be set at probe.
On reset, the default range (in the registers) is set to value 0x3 which
corresponds to '±10 V single-ended range', regardless of bipolar or
differential configuration.
Aside from the scale/ranges, the AD7606C-16 is similar to the AD7606B.
The AD7606C-18 variant offers 18-bit precision. Because of this, the
requirement to use this chip is that the SPI controller supports padding
of 18-bit sequences to 32-bit arrays.
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606c-16.pdf
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606c-18.pdf
Signed-off-by: Alexandru Ardelean <aardelean@baylibre.com>
Link: https://patch.msgid.link/20240919130444.2100447-9-aardelean@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-19 16:04:43 +03:00
|
|
|
} data __aligned(IIO_DMA_MINALIGN);
|
2019-07-18 09:27:33 +03:00
|
|
|
__be16 d16[2];
|
2011-02-22 21:46:18 +01:00
|
|
|
};
|
|
|
|
|
2018-09-18 15:15:03 +03:00
|
|
|
/**
|
|
|
|
* struct ad7606_bus_ops - driver bus operations
|
2025-03-18 17:52:13 -05:00
|
|
|
* @iio_backend_config: function pointer for configuring the iio_backend for
|
2024-10-15 13:56:20 +00:00
|
|
|
* the compatibles that use it
|
2025-03-18 17:52:13 -05:00
|
|
|
* @read_block: function pointer for reading blocks of data
|
2019-07-18 09:27:31 +03:00
|
|
|
* @sw_mode_config: pointer to a function which configured the device
|
|
|
|
* for software mode
|
2025-04-03 18:19:06 +02:00
|
|
|
* @offload_config: function pointer for configuring offload support,
|
|
|
|
* where any
|
2025-03-18 17:52:13 -05:00
|
|
|
* @reg_read: function pointer for reading spi register
|
|
|
|
* @reg_write: function pointer for writing spi register
|
|
|
|
* @update_scan_mode: function pointer for handling the calls to iio_info's
|
|
|
|
* update_scan mode when enabling/disabling channels.
|
|
|
|
* @rd_wr_cmd: pointer to the function which calculates the spi address
|
2018-09-18 15:15:03 +03:00
|
|
|
*/
|
2011-02-22 21:46:18 +01:00
|
|
|
struct ad7606_bus_ops {
|
|
|
|
/* more methods added in future? */
|
2024-10-15 13:56:20 +00:00
|
|
|
int (*iio_backend_config)(struct device *dev, struct iio_dev *indio_dev);
|
2025-04-03 18:19:06 +02:00
|
|
|
int (*offload_config)(struct device *dev, struct iio_dev *indio_dev);
|
2018-06-09 00:13:31 +02:00
|
|
|
int (*read_block)(struct device *dev, int num, void *data);
|
2019-07-18 09:27:31 +03:00
|
|
|
int (*sw_mode_config)(struct iio_dev *indio_dev);
|
2019-07-18 09:27:33 +03:00
|
|
|
int (*reg_read)(struct ad7606_state *st, unsigned int addr);
|
|
|
|
int (*reg_write)(struct ad7606_state *st,
|
|
|
|
unsigned int addr,
|
|
|
|
unsigned int val);
|
2024-10-15 13:56:20 +00:00
|
|
|
int (*update_scan_mode)(struct iio_dev *indio_dev, const unsigned long *scan_mask);
|
2025-03-18 17:52:14 -05:00
|
|
|
u16 (*rd_wr_cmd)(int addr, char is_write_op);
|
2011-02-22 21:46:18 +01:00
|
|
|
};
|
|
|
|
|
2024-10-15 13:56:18 +00:00
|
|
|
/**
|
2025-03-18 17:52:13 -05:00
|
|
|
* struct ad7606_bus_info - aggregate ad7606_chip_info and ad7606_bus_ops
|
|
|
|
* @chip_info: entry in the table of chips that describes this device
|
|
|
|
* @bops: bus operations (SPI or parallel)
|
2024-10-15 13:56:18 +00:00
|
|
|
*/
|
|
|
|
struct ad7606_bus_info {
|
|
|
|
const struct ad7606_chip_info *chip_info;
|
|
|
|
const struct ad7606_bus_ops *bops;
|
|
|
|
};
|
|
|
|
|
2016-10-19 19:07:04 +02:00
|
|
|
int ad7606_probe(struct device *dev, int irq, void __iomem *base_address,
|
2024-10-15 13:56:18 +00:00
|
|
|
const struct ad7606_chip_info *info,
|
2016-10-19 19:07:04 +02:00
|
|
|
const struct ad7606_bus_ops *bops);
|
2011-02-22 21:46:18 +01:00
|
|
|
|
iio: adc: ad7606: remove frstdata check for serial mode
The current implementation attempts to recover from an eventual glitch
in the clock by checking frstdata state after reading the first
channel's sample: If frstdata is low, it will reset the chip and
return -EIO.
This will only work in parallel mode, where frstdata pin is set low
after the 2nd sample read starts.
For the serial mode, according to the datasheet, "The FRSTDATA output
returns to a logic low following the 16th SCLK falling edge.", thus
after the Xth pulse, X being the number of bits in a sample, the check
will always be true, and the driver will not work at all in serial
mode if frstdata(optional) is defined in the devicetree as it will
reset the chip, and return -EIO every time read_sample is called.
Hence, this check must be removed for serial mode.
Fixes: b9618c0cacd7 ("staging: IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4")
Signed-off-by: Guillaume Stols <gstols@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240702-cleanup-ad7606-v3-1-18d5ea18770e@baylibre.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-07-02 12:52:51 +00:00
|
|
|
int ad7606_reset(struct ad7606_state *st);
|
2025-04-03 18:19:06 +02:00
|
|
|
int ad7606_pwm_set_swing(struct ad7606_state *st);
|
|
|
|
int ad7606_pwm_set_low(struct ad7606_state *st);
|
iio: adc: ad7606: remove frstdata check for serial mode
The current implementation attempts to recover from an eventual glitch
in the clock by checking frstdata state after reading the first
channel's sample: If frstdata is low, it will reset the chip and
return -EIO.
This will only work in parallel mode, where frstdata pin is set low
after the 2nd sample read starts.
For the serial mode, according to the datasheet, "The FRSTDATA output
returns to a logic low following the 16th SCLK falling edge.", thus
after the Xth pulse, X being the number of bits in a sample, the check
will always be true, and the driver will not work at all in serial
mode if frstdata(optional) is defined in the devicetree as it will
reset the chip, and return -EIO every time read_sample is called.
Hence, this check must be removed for serial mode.
Fixes: b9618c0cacd7 ("staging: IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4")
Signed-off-by: Guillaume Stols <gstols@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240702-cleanup-ad7606-v3-1-18d5ea18770e@baylibre.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-07-02 12:52:51 +00:00
|
|
|
|
2024-10-15 13:56:18 +00:00
|
|
|
extern const struct ad7606_chip_info ad7605_4_info;
|
|
|
|
extern const struct ad7606_chip_info ad7606_8_info;
|
|
|
|
extern const struct ad7606_chip_info ad7606_6_info;
|
|
|
|
extern const struct ad7606_chip_info ad7606_4_info;
|
|
|
|
extern const struct ad7606_chip_info ad7606b_info;
|
|
|
|
extern const struct ad7606_chip_info ad7606c_16_info;
|
|
|
|
extern const struct ad7606_chip_info ad7606c_18_info;
|
iio: adc: ad7606: add support for AD760{7,8,9} parts
The AD7607, AD7608 and AD7609 are some older parts of the AD7606 family.
They are hardware-only, meaning that they don't have any registers
accessible via SPI or Parallel interface.
They are more similar to the AD7605-4 part, which is supported by the
'ad7606' driver, and are configurable via GPIOs.
Like the AD7605-4 part, all 3 parts have 2 CONVST (Conversion Start) pins
(CONVST A and CONVST B). But in practice, these should be tied together to
make reading of samples easier via a serial line.
The AD7607 has an 14-bit resolution and AD7608 & AD7609 have an 18-bit
resolution. The main difference between the AD7608 & AD7609 is that the
AD7609 has a larger range (±10V & ±20V) vs the ±5V & ±10V ranges for AD7608.
However, unlike AD7605-4 part, these 3 parts have oversampling which is
configurable (like for the AD7606 in HW-mode) via GPIOs.
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7607.pdf
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7608.pdf
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7609.pdf
Signed-off-by: Alexandru Ardelean <aardelean@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20241025095939.271811-6-aardelean@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-10-25 12:59:39 +03:00
|
|
|
extern const struct ad7606_chip_info ad7607_info;
|
|
|
|
extern const struct ad7606_chip_info ad7608_info;
|
|
|
|
extern const struct ad7606_chip_info ad7609_info;
|
2024-10-15 13:56:18 +00:00
|
|
|
extern const struct ad7606_chip_info ad7616_info;
|
2011-02-22 21:46:18 +01:00
|
|
|
|
2016-02-08 11:13:29 +01:00
|
|
|
#ifdef CONFIG_PM_SLEEP
|
|
|
|
extern const struct dev_pm_ops ad7606_pm_ops;
|
|
|
|
#define AD7606_PM_OPS (&ad7606_pm_ops)
|
|
|
|
#else
|
|
|
|
#define AD7606_PM_OPS NULL
|
|
|
|
#endif
|
|
|
|
|
2011-02-22 21:46:18 +01:00
|
|
|
#endif /* IIO_ADC_AD7606_H_ */
|