157 lines · plain
1.. SPDX-License-Identifier: GPL-2.0-only2 3=============4AD7944 driver5=============6 7ADC driver for Analog Devices Inc. AD7944 and similar devices. The module name8is ``ad7944``.9 10 11Supported devices12=================13 14The 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 21Supported features22==================23 24SPI wiring modes25----------------26 27The driver currently supports three of the many possible SPI wiring configurations.28 29CS mode, 3-wire, without busy indicator30^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^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 46To select this mode in the device tree, set the ``adi,spi-mode`` property to47``"single"`` and omit the ``cnv-gpios`` property.48 49CS mode, 4-wire, without busy indicator50^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^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 68To select this mode in the device tree, omit the ``adi,spi-mode`` property and69provide the ``cnv-gpios`` property.70 71Chain mode, without busy indicator72^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^73 74.. code-block::75 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 +-------------+87 88To select this mode in the device tree, set the ``adi,spi-mode`` property to89``"chain"``, add the ``spi-cs-high`` flag, add the ``#daisy-chained-devices``90property, and omit the ``cnv-gpios`` property.91 92Reference voltage93-----------------94 95All 3 possible reference voltage sources are supported:96 97- Internal reference98- External 1.2V reference and internal buffer99- External reference100 101The source is determined by the device tree. If ``ref-supply`` is present, then102the external reference is used. If ``refin-supply`` is present, then the internal103buffer is used. If neither is present, then the internal reference is used.104 105Unimplemented features106----------------------107 108- ``BUSY`` indication109- ``TURBO`` mode110 111 112Device attributes113=================114 115There are two types of ADCs in this family, pseudo-differential and fully116differential. The channel name is different depending on the type of ADC.117 118Pseudo-differential ADCs119------------------------120 121AD7944 and AD7985 are pseudo-differential ADCs and have the following attributes:122 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+---------------------------------------+--------------------------------------------------------------+130 131In "chain" mode, additional chips will appear as additional voltage input132channels, e.g. ``in_voltage1_raw``.133 134Fully-differential ADCs135-----------------------136 137AD7986 is a fully-differential ADC and has the following attributes:138 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+---------------------------------------+--------------------------------------------------------------+146 147In "chain" mode, additional chips will appear as additional voltage input148channels, e.g. ``in_voltage2-voltage3_raw``.149 150 151Device buffers152==============153 154This driver supports IIO triggered buffers.155 156See :doc:`iio_devbuf` for more information.157