drm/tests: hdmi: Fix memory leaks in drm_display_mode_from_cea_vic()
[drm/drm-misc.git] / Documentation / iio / ad7380.rst
blob9c784c1e652e9afc116fd206a6cdb70fa6e2adf0
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>`_
32 Supported features
33 ==================
35 SPI wiring modes
36 ----------------
38 ad738x ADCs can output data on several SDO lines (1/2/4). The driver currently
39 supports only 1 SDO line.
41 Reference voltage
42 -----------------
44 2 possible reference voltage sources are supported:
46 - Internal reference (2.5V)
47 - External reference (2.5V to 3.3V)
49 The source is determined by the device tree. If ``refio-supply`` is present,
50 then the external reference is used, else the internal reference is used.
52 Oversampling and resolution boost
53 ---------------------------------
55 This family supports 2 types of oversampling: normal average and rolling
56 average. Only normal average is supported by the driver, as rolling average can
57 be achieved by processing a captured data buffer. The following ratios are
58 available: 1 (oversampling disabled)/2/4/8/16/32.
60 When the on-chip oversampling function is enabled the performance of the ADC can
61 exceed the default resolution. To accommodate the performance boost achievable,
62 it is possible to enable an additional two bits of resolution. Because the
63 resolution boost feature can only be enabled when oversampling is enabled and
64 oversampling is not as useful without the resolution boost, the driver
65 automatically enables the resolution boost if and only if oversampling is
66 enabled.
68 Since the resolution boost feature causes 16-bit chips to now have 18-bit data
69 which means the storagebits has to change from 16 to 32 bits, we use the new
70 ext_scan_type feature to allow changing the scan_type at runtime. Unfortunately
71 libiio does not support it. So when enabling or disabling oversampling, user
72 must restart iiod using the following command:
74 .. code-block:: bash
76         root:~# systemctl restart iiod
78 Channel selection and sequencer (single-end chips only)
79 -------------------------------------------------------
81 Single-ended chips of this family (ad7386/7/8(-4)) have a 2:1 multiplexer in
82 front of each ADC. They also include additional configuration registers that
83 allow for either manual selection or automatic switching (sequencer mode), of
84 the multiplexer inputs.
86 From an IIO point of view, all inputs are exported, i.e ad7386/7/8
87 export 4 channels and ad7386-4/7-4/8-4 export 8 channels.
89 Inputs ``AinX0`` of multiplexers correspond to the first half of IIO channels (i.e
90 0-1 or 0-3) and inputs ``AinX1`` correspond to second half (i.e 2-3 or 4-7).
91 Example for AD7386/7/8 (2 channels parts):
93 .. code-block::
95            IIO   | AD7386/7/8
96                  |         +----------------------------
97                  |         |     _____        ______
98                  |         |    |     |      |      |
99         voltage0 | AinA0 --|--->|     |      |      |
100                  |         |    | mux |----->| ADCA |---
101         voltage2 | AinA1 --|--->|     |      |      |
102                  |         |    |_____|      |_____ |
103                  |         |     _____        ______
104                  |         |    |     |      |      |
105         voltage1 | AinB0 --|--->|     |      |      |
106                  |         |    | mux |----->| ADCB |---
107         voltage3 | AinB1 --|--->|     |      |      |
108                  |         |    |_____|      |______|
109                  |         |
110                  |         +----------------------------
113 When enabling sequencer mode, the effective sampling rate is divided by two.
115 Unimplemented features
116 ----------------------
118 - 2/4 SDO lines
119 - Rolling average oversampling
120 - Power down mode
121 - CRC indication
122 - Alert
125 Device buffers
126 ==============
128 This driver supports IIO triggered buffers.
130 See :doc:`iio_devbuf` for more information.