Skip to content

Commit 4085044

Browse files
RaduSabau1jic23
authored andcommitted
iio: adc: ad4691: add initial driver for AD4691 family
Add support for the Analog Devices AD4691 family of high-speed, low-power multichannel SAR ADCs: AD4691 (16-ch, 500 kSPS), AD4692 (16-ch, 1 MSPS), AD4693 (8-ch, 500 kSPS) and AD4694 (8-ch, 1 MSPS). The driver implements a custom regmap layer over raw SPI to handle the device's mixed 1/2/3/4-byte register widths and uses the standard IIO read_raw/write_raw interface for single-channel reads. The chip idles in Autonomous Mode so that single-shot read_raw can use the internal oscillator without disturbing the hardware configuration. Three voltage supply domains are managed: avdd (required), vio, and a reference supply on either the REF pin (ref-supply, external buffer) or the REFIN pin (refin-supply, uses the on-chip reference buffer; REFBUF_EN is set accordingly). Hardware reset is performed by asserting then deasserting the reset-gpios GPIO line (tRESETL minimum pulse width is 10 ns, satisfied by function-call overhead); the driver then waits 300 µs for the chip to complete its internal reset sequence. A software reset via SPI_CONFIG_A is used as fallback when no reset GPIO is provided. Accumulator channel masking for single-shot reads uses ACC_MASK_REG via an ADDR_DESCENDING SPI write, which covers both mask bytes in a single 16-bit transfer. Reviewed-by: David Lechner <dlechner@baylibre.com> Signed-off-by: Radu Sabau <radu.sabau@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent 1ea5792 commit 4085044

4 files changed

Lines changed: 797 additions & 0 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,7 @@ L: linux-iio@vger.kernel.org
14821482
S: Supported
14831483
W: https://ez.analog.com/linux-software-drivers
14841484
F: Documentation/devicetree/bindings/iio/adc/adi,ad4691.yaml
1485+
F: drivers/iio/adc/ad4691.c
14851486

14861487
ANALOG DEVICES INC AD4695 DRIVER
14871488
M: Michael Hennerich <michael.hennerich@analog.com>

drivers/iio/adc/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,18 @@ config AD4170_4
144144
To compile this driver as a module, choose M here: the module will be
145145
called ad4170-4.
146146

147+
config AD4691
148+
tristate "Analog Devices AD4691 Family ADC Driver"
149+
depends on SPI
150+
depends on REGULATOR || COMPILE_TEST
151+
select REGMAP
152+
help
153+
Say yes here to build support for Analog Devices AD4691 Family MuxSAR
154+
SPI analog to digital converters (ADC).
155+
156+
To compile this driver as a module, choose M here: the module will be
157+
called ad4691.
158+
147159
config AD4695
148160
tristate "Analog Device AD4695 ADC Driver"
149161
depends on SPI

drivers/iio/adc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ obj-$(CONFIG_AD4080) += ad4080.o
1616
obj-$(CONFIG_AD4130) += ad4130.o
1717
obj-$(CONFIG_AD4134) += ad4134.o
1818
obj-$(CONFIG_AD4170_4) += ad4170-4.o
19+
obj-$(CONFIG_AD4691) += ad4691.o
1920
obj-$(CONFIG_AD4695) += ad4695.o
2021
obj-$(CONFIG_AD4851) += ad4851.o
2122
obj-$(CONFIG_AD7091R) += ad7091r-base.o

0 commit comments

Comments
 (0)