Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / Documentation / iio / ad7606.rst
blob930199e03c67f68296ec83176f9e4f82741fb813
1 .. SPDX-License-Identifier: GPL-2.0-only
3 =============
4 AD7606 driver
5 =============
7 ADC driver for Analog Devices Inc. AD7606 and similar devices. The module name
8 is ``ad7606``.
10 Supported devices
11 =================
13 The following chips are supported by this driver:
15 * `AD7605 <https://www.analog.com/en/products/ad7605.html>`_
16 * `AD7606 <https://www.analog.com/en/products/ad7606.html>`_
17 * `AD7606B <https://www.analog.com/en/products/ad7606b.html>`_
18 * `AD7616 <https://www.analog.com/en/products/ad7616.html>`_
20 Supported features
21 ==================
23 SPI wiring modes
24 ----------------
26 These ADCs can output data on several SDO lines (1/2/4/8). The driver
27 currently supports only 1 SDO line.
29 Parallel wiring mode
30 --------------------
32 There is also a parallel interface, with 16 lines (that can be reduced to 8 in
33 byte mode). The parallel interface is selected by declaring the device as
34 platform in the device tree (with no io-backends node defined, see below).
36 IIO-backend mode
37 ----------------
39 This mode allows to reach the best sample rates, but it requires an external
40 hardware (eg HDL or APU) to handle the low level communication.
41 The backend mode is enabled when through the definition of the "io-backends"
42 property in the device tree.
44 The reference configuration for the current implementation of IIO-backend mode
45 is the HDL reference provided by ADI:
46 https://wiki.analog.com/resources/eval/user-guides/ad7606x-fmc/hdl
48 This implementation embeds an IIO-backend compatible IP (adi-axi-adc) and a PWM
49 connected to the conversion trigger pin.
51 .. code-block::
53     +---+                                       +----------------------------
54     |   |               +-------+               |AD76xx
55     | A |  controls     |       |               |
56     | D |-------------->|  PWM  |-------------->| cnvst
57     | 7 |               |       |               |
58     | 6 |               +-------+               |
59     | 0 | controls  +-----------+-----------+   |
60     | 6 |---------->|           |           |<--| frstdata
61     |   |           | Backend   |  Backend  |<--| busy
62     | D |           | Driver    |           |   |
63     | R |           |           |           |-->| clk
64     | I |  requests |+---------+| DMA       |   |
65     | V |----------->|  Buffer ||<----      |<=>| DATA
66     | E |           |+---------+|           |   |
67     | R |           +-----------+-----------+   |
68     |   |-------------------------------------->| reset/configuration gpios
69     +---+                                       +-----------------------------
72 Software and hardware modes
73 ---------------------------
75 While all the AD7606/AD7616 series parts can be configured using GPIOs, some of
76 them can be configured using register.
78 The chips that support software mode have more values available for configuring
79 the device, as well as more settings, and allow to control the range and
80 calibration per channel.
82 The following settings are available per channel in software mode:
83  - Scale
85 Also, there is a broader choice of oversampling ratios in software mode.
87 Conversion triggering
88 ---------------------
90 The conversion can be triggered by two distinct ways:
92  - A GPIO is connected to the conversion trigger pin, and this GPIO is controlled
93    by the driver directly.  In this configuration, the driver sets back the
94    conversion trigger pin to high as soon as it has read all the conversions.
96  - An external source is connected to the conversion trigger pin. In the
97    current implementation, it must be a PWM. In this configuration, the driver
98    does not control directly the conversion trigger pin. Instead, it can
99    control the PWM's frequency. This trigger is enabled only for iio-backend.
101 Reference voltage
102 -----------------
104 2 possible reference voltage sources are supported:
106  - Internal reference (2.5V)
107  - External reference (2.5V)
109 The source is determined by the device tree. If ``refin-supply`` is present,
110 then the external reference is used, otherwise the internal reference is used.
112 Oversampling
113 ------------
115 This family supports oversampling to improve SNR.
116 In software mode, the following ratios are available:
117 1 (oversampling disabled)/2/4/8/16/32/64/128/256.
119 Unimplemented features
120 ----------------------
122 - 2/4/8 SDO lines
123 - CRC indication
124 - Calibration
126 Device buffers
127 ==============
129 IIO triggered buffer
130 --------------------
132 This driver supports IIO triggered buffers, with a "built in" trigger, i.e the
133 trigger is allocated and linked by the driver, and a new conversion is triggered
134 as soon as the samples are transferred, and a timestamp channel is added to make
135 up for the potential jitter induced by the delays in the interrupt handling.
137 IIO backend buffer
138 ------------------
140 When IIO backend is used, the trigger is not needed, and the sample rate is
141 considered as stable. There is no timestamp channel. The communication is
142 delegated to an external logic, called a backend, and the backend's driver
143 handles the buffer. When this mode is enabled, the driver cannot control the
144 conversion pin, because the busy pin is bound to the backend.