drm/tests: hdmi: Fix memory leaks in drm_display_mode_from_cea_vic()
[drm/drm-misc.git] / Documentation / iio / ad7944.rst
blob0d26e56aba8862a8d2ff541012bb4681d05c7bb5
1 .. SPDX-License-Identifier: GPL-2.0-only
3 =============
4 AD7944 driver
5 =============
7 ADC driver for Analog Devices Inc. AD7944 and similar devices. The module name
8 is ``ad7944``.
11 Supported devices
12 =================
14 The following chips are supported by this driver:
16 * `AD7944 <https://www.analog.com/AD7944>`_
17 * `AD7985 <https://www.analog.com/AD7985>`_
18 * `AD7986 <https://www.analog.com/AD7986>`_
21 Supported features
22 ==================
24 SPI wiring modes
25 ----------------
27 The driver currently supports three of the many possible SPI wiring configurations.
29 CS mode, 3-wire, without busy indicator
30 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32 .. code-block::
34                                          +-------------+
35                     +--------------------| CS          |
36                     v                    |             |
37     VIO   +--------------------+         |     HOST    |
38      |    |        CNV         |         |             |
39      +--->| SDI   AD7944   SDO |-------->| SDI         |
40           |        SCK         |         |             |
41           +--------------------+         |             |
42                     ^                    |             |
43                     +--------------------| SCLK        |
44                                          +-------------+
46 To select this mode in the device tree, set the ``adi,spi-mode`` property to
47 ``"single"`` and omit the ``cnv-gpios`` property.
49 CS mode, 4-wire, without busy indicator
50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52 .. code-block::
54                                          +-------------+
55      +-----------------------------------| CS          |
56      |                                   |             |
57      |              +--------------------| GPIO        |
58      |              v                    |             |
59      |    +--------------------+         |     HOST    |
60      |    |        CNV         |         |             |
61      +--->| SDI   AD7944   SDO |-------->| SDI         |
62           |        SCK         |         |             |
63           +--------------------+         |             |
64                     ^                    |             |
65                     +--------------------| SCLK        |
66                                          +-------------+
68 To select this mode in the device tree, omit the ``adi,spi-mode`` property and
69 provide the ``cnv-gpios`` property.
71 Chain mode, without busy indicator
72 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74 .. code-block::
76                                                                  +-------------+
77                   +-------------------------+--------------------| CS          |
78                   v                         v                    |             |
79         +--------------------+    +--------------------+         |     HOST    |
80         |        CNV         |    |        CNV         |         |             |
81    +--->| SDI   AD7944   SDO |--->| SDI   AD7944   SDO |-------->| SDI         |
82    |    |        SCK         |    |        SCK         |         |             |
83   GND   +--------------------+    +--------------------+         |             |
84                   ^                         ^                    |             |
85                   +-------------------------+--------------------| SCLK        |
86                                                                  +-------------+
88 To select this mode in the device tree, set the ``adi,spi-mode`` property to
89 ``"chain"``, add the ``spi-cs-high`` flag, add the ``#daisy-chained-devices``
90 property, and omit the ``cnv-gpios`` property.
92 Reference voltage
93 -----------------
95 All 3 possible reference voltage sources are supported:
97 - Internal reference
98 - External 1.2V reference and internal buffer
99 - External reference
101 The source is determined by the device tree. If ``ref-supply`` is present, then
102 the external reference is used. If ``refin-supply`` is present, then the internal
103 buffer is used. If neither is present, then the internal reference is used.
105 Unimplemented features
106 ----------------------
108 - ``BUSY`` indication
109 - ``TURBO`` mode
112 Device attributes
113 =================
115 There are two types of ADCs in this family, pseudo-differential and fully
116 differential. The channel name is different depending on the type of ADC.
118 Pseudo-differential ADCs
119 ------------------------
121 AD7944 and AD7985 are pseudo-differential ADCs and have the following attributes:
123 +---------------------------------------+--------------------------------------------------------------+
124 | Attribute                             | Description                                                  |
125 +=======================================+==============================================================+
126 | ``in_voltage0_raw``                   | Raw ADC voltage value (*IN+* referenced to ground sense).    |
127 +---------------------------------------+--------------------------------------------------------------+
128 | ``in_voltage0_scale``                 | Scale factor to convert raw value to mV.                     |
129 +---------------------------------------+--------------------------------------------------------------+
131 In "chain" mode, additional chips will appear as additional voltage input
132 channels, e.g. ``in_voltage1_raw``.
134 Fully-differential ADCs
135 -----------------------
137 AD7986 is a fully-differential ADC and has the following attributes:
139 +---------------------------------------+--------------------------------------------------------------+
140 | Attribute                             | Description                                                  |
141 +=======================================+==============================================================+
142 | ``in_voltage0-voltage1_raw``          | Raw ADC voltage value (*IN+* - *IN-*).                       |
143 +---------------------------------------+--------------------------------------------------------------+
144 | ``in_voltage0-voltage1_scale``        | Scale factor to convert raw value to mV.                     |
145 +---------------------------------------+--------------------------------------------------------------+
147 In "chain" mode, additional chips will appear as additional voltage input
148 channels, e.g. ``in_voltage2-voltage3_raw``.
151 Device buffers
152 ==============
154 This driver supports IIO triggered buffers.
156 See :doc:`iio_devbuf` for more information.