Skip to content

Commit 1df47ef

Browse files
dlechnunojsa
authored andcommitted
docs: iio: new docs for ad7944 driver
This adds a new page to document how to use the ad7944 ADC driver. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://lore.kernel.org/r/20240322-mainline-ad7944-doc-v2-2-0923d35d5596@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent c9186a2 commit 1df47ef

File tree

3 files changed

+132
-0
lines changed

3 files changed

+132
-0
lines changed

Documentation/iio/ad7944.rst

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
.. SPDX-License-Identifier: GPL-2.0-only
2+
3+
=============
4+
AD7944 driver
5+
=============
6+
7+
ADC driver for Analog Devices Inc. AD7944 and similar devices. The module name
8+
is ``ad7944``.
9+
10+
11+
Supported devices
12+
=================
13+
14+
The following chips are supported by this driver:
15+
16+
* `AD7944 <https://www.analog.com/AD7944>`_
17+
* `AD7985 <https://www.analog.com/AD7985>`_
18+
* `AD7986 <https://www.analog.com/AD7986>`_
19+
20+
21+
Supported features
22+
==================
23+
24+
SPI wiring modes
25+
----------------
26+
27+
The driver currently supports two of the many possible SPI wiring configurations.
28+
29+
CS mode, 3-wire, without busy indicator
30+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31+
32+
.. code-block::
33+
34+
+-------------+
35+
+--------------------| CS |
36+
v | |
37+
VIO +--------------------+ | HOST |
38+
| | CNV | | |
39+
+--->| SDI AD7944 SDO |-------->| SDI |
40+
| SCK | | |
41+
+--------------------+ | |
42+
^ | |
43+
+--------------------| SCLK |
44+
+-------------+
45+
46+
To select this mode in the device tree, set the ``adi,spi-mode`` property to
47+
``"single"`` and omit the ``cnv-gpios`` property.
48+
49+
CS mode, 4-wire, without busy indicator
50+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
51+
52+
.. code-block::
53+
54+
+-------------+
55+
+-----------------------------------| CS |
56+
| | |
57+
| +--------------------| GPIO |
58+
| v | |
59+
| +--------------------+ | HOST |
60+
| | CNV | | |
61+
+--->| SDI AD7944 SDO |-------->| SDI |
62+
| SCK | | |
63+
+--------------------+ | |
64+
^ | |
65+
+--------------------| SCLK |
66+
+-------------+
67+
68+
To select this mode in the device tree, omit the ``adi,spi-mode`` property and
69+
provide the ``cnv-gpios`` property.
70+
71+
Reference voltage
72+
-----------------
73+
74+
All 3 possible reference voltage sources are supported:
75+
76+
- Internal reference
77+
- External 1.2V reference and internal buffer
78+
- External reference
79+
80+
The source is determined by the device tree. If ``ref-supply`` is present, then
81+
the external reference is used. If ``refin-supply`` is present, then the internal
82+
buffer is used. If neither is present, then the internal reference is used.
83+
84+
Unimplemented features
85+
----------------------
86+
87+
- ``BUSY`` indication
88+
- ``TURBO`` mode
89+
- Daisy chain mode
90+
91+
92+
Device attributes
93+
=================
94+
95+
There are two types of ADCs in this family, pseudo-differential and fully
96+
differential. The channel name is different depending on the type of ADC.
97+
98+
Pseudo-differential ADCs
99+
------------------------
100+
101+
AD7944 and AD7985 are pseudo-differential ADCs and have the following attributes:
102+
103+
+---------------------------------------+--------------------------------------------------------------+
104+
| Attribute | Description |
105+
+=======================================+==============================================================+
106+
| ``in_voltage0_raw`` | Raw ADC voltage value (*IN+* referenced to ground sense). |
107+
+---------------------------------------+--------------------------------------------------------------+
108+
| ``in_voltage0_scale`` | Scale factor to convert raw value to mV. |
109+
+---------------------------------------+--------------------------------------------------------------+
110+
111+
Fully-differential ADCs
112+
-----------------------
113+
114+
AD7986 is a fully-differential ADC and has the following attributes:
115+
116+
+---------------------------------------+--------------------------------------------------------------+
117+
| Attribute | Description |
118+
+=======================================+==============================================================+
119+
| ``in_voltage0-voltage1_raw`` | Raw ADC voltage value (*IN+* - *IN-*). |
120+
+---------------------------------------+--------------------------------------------------------------+
121+
| ``in_voltage0-voltage1_scale`` | Scale factor to convert raw value to mV. |
122+
+---------------------------------------+--------------------------------------------------------------+
123+
124+
125+
Device buffers
126+
==============
127+
128+
This driver supports IIO triggered buffers.
129+
130+
See :doc:`iio_devbuf` for more information.

Documentation/iio/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Industrial I/O Kernel Drivers
2121
ad4000
2222
ad4695
2323
ad7625
24+
ad7944
2425
adis16475
2526
adis16480
2627
adxl380

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ R: David Lechner <dlechner@baylibre.com>
459459
S: Supported
460460
W: https://ez.analog.com/linux-software-drivers
461461
F: Documentation/devicetree/bindings/iio/adc/adi,ad7944.yaml
462+
F: Documentation/iio/ad7944.rst
462463
F: drivers/iio/adc/ad7944.c
463464

464465
ADDRESS SPACE LAYOUT RANDOMIZATION (ASLR)

0 commit comments

Comments
 (0)