drm/panel-edp: Add BOE NV140FHM-NZ panel entry
[drm/drm-misc.git] / Documentation / iio / ad7380.rst
blobc46127700e14ca9ec3cac0bd5776b6702f2659e2
1 .. SPDX-License-Identifier: GPL-2.0-only
3 =============
4 AD7380 driver
5 =============
7 ADC driver for Analog Devices Inc. AD7380 and similar devices. The module name
8 is ``ad7380``.
11 Supported devices
12 =================
14 The following chips are supported by this driver:
16 * `AD7380 <https://www.analog.com/en/products/ad7380.html>`_
17 * `AD7381 <https://www.analog.com/en/products/ad7381.html>`_
18 * `AD7383 <https://www.analog.com/en/products/ad7383.html>`_
19 * `AD7384 <https://www.analog.com/en/products/ad7384.html>`_
20 * `AD7386 <https://www.analog.com/en/products/ad7386.html>`_
21 * `AD7387 <https://www.analog.com/en/products/ad7387.html>`_
22 * `AD7388 <https://www.analog.com/en/products/ad7388.html>`_
23 * `AD7380-4 <https://www.analog.com/en/products/ad7380-4.html>`_
24 * `AD7381-4 <https://www.analog.com/en/products/ad7381-4.html>`_
25 * `AD7383-4 <https://www.analog.com/en/products/ad7383-4.html>`_
26 * `AD7384-4 <https://www.analog.com/en/products/ad7384-4.html>`_
27 * `AD7386-4 <https://www.analog.com/en/products/ad7386-4.html>`_
28 * `AD7387-4 <https://www.analog.com/en/products/ad7387-4.html>`_
29 * `AD7388-4 <https://www.analog.com/en/products/ad7388-4.html>`_
30 * `ADAQ4370-4 <https://www.analog.com/en/products/adaq4370-4.html>`_
31 * `ADAQ4380-4 <https://www.analog.com/en/products/adaq4380-4.html>`_
34 Supported features
35 ==================
37 SPI wiring modes
38 ----------------
40 ad738x ADCs can output data on several SDO lines (1/2/4). The driver currently
41 supports only 1 SDO line.
43 Reference voltage
44 -----------------
46 ad7380-4
47 ~~~~~~~~
49 ad7380-4 supports only an external reference voltage (2.5V to 3.3V). It must be
50 declared in the device tree as ``refin-supply``.
52 ADAQ devices
53 ~~~~~~~~~~~~
55 adaq4370-4 and adaq4380-4 don't have an external reference, but use a 3.3V
56 internal reference derived from one of its supplies (``refin-supply``)
58 All other devices from ad738x family
59 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61 All other devices from ad738x support 2 possible reference voltage sources:
63 - Internal reference (2.5V)
64 - External reference (2.5V to 3.3V)
66 The source is determined by the device tree. If ``refio-supply`` is present,
67 then it is used as external reference, else the internal reference is used.
69 Oversampling and resolution boost
70 ---------------------------------
72 This family supports 2 types of oversampling: normal average and rolling
73 average. Only normal average is supported by the driver, as rolling average can
74 be achieved by processing a captured data buffer. The following ratios are
75 available: 1 (oversampling disabled)/2/4/8/16/32.
77 When the on-chip oversampling function is enabled the performance of the ADC can
78 exceed the default resolution. To accommodate the performance boost achievable,
79 it is possible to enable an additional two bits of resolution. Because the
80 resolution boost feature can only be enabled when oversampling is enabled and
81 oversampling is not as useful without the resolution boost, the driver
82 automatically enables the resolution boost if and only if oversampling is
83 enabled.
85 Since the resolution boost feature causes 16-bit chips to now have 18-bit data
86 which means the storagebits has to change from 16 to 32 bits, we use the new
87 ext_scan_type feature to allow changing the scan_type at runtime. Unfortunately
88 libiio does not support it. So when enabling or disabling oversampling, user
89 must restart iiod using the following command:
91 .. code-block:: bash
93         root:~# systemctl restart iiod
95 Channel selection and sequencer (single-end chips only)
96 -------------------------------------------------------
98 Single-ended chips of this family (ad7386/7/8(-4)) have a 2:1 multiplexer in
99 front of each ADC. They also include additional configuration registers that
100 allow for either manual selection or automatic switching (sequencer mode), of
101 the multiplexer inputs.
103 From an IIO point of view, all inputs are exported, i.e ad7386/7/8
104 export 4 channels and ad7386-4/7-4/8-4 export 8 channels.
106 Inputs ``AinX0`` of multiplexers correspond to the first half of IIO channels (i.e
107 0-1 or 0-3) and inputs ``AinX1`` correspond to second half (i.e 2-3 or 4-7).
108 Example for AD7386/7/8 (2 channels parts):
110 .. code-block::
112            IIO   | AD7386/7/8
113                  |         +----------------------------
114                  |         |     _____        ______
115                  |         |    |     |      |      |
116         voltage0 | AinA0 --|--->|     |      |      |
117                  |         |    | mux |----->| ADCA |---
118         voltage2 | AinA1 --|--->|     |      |      |
119                  |         |    |_____|      |_____ |
120                  |         |     _____        ______
121                  |         |    |     |      |      |
122         voltage1 | AinB0 --|--->|     |      |      |
123                  |         |    | mux |----->| ADCB |---
124         voltage3 | AinB1 --|--->|     |      |      |
125                  |         |    |_____|      |______|
126                  |         |
127                  |         +----------------------------
130 When enabling sequencer mode, the effective sampling rate is divided by two.
132 Gain (ADAQ devices only)
133 ~~~~~~~~~~~~~~~~~~~~~~~~
135 ADAQ devices have a pin selectable gain in front of each ADC. The appropriate
136 gain is selectable from device tree using the ``adi,gain-milli`` property.
137 Refer to the typical connection diagrams section of the datasheet for pin
138 wiring.
140 Unimplemented features
141 ----------------------
143 - 2/4 SDO lines
144 - Rolling average oversampling
145 - Power down mode
146 - CRC indication
147 - Alert
150 Device buffers
151 ==============
153 This driver supports IIO triggered buffers.
155 See :doc:`iio_devbuf` for more information.