<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>AD7380 driver — The Linux Kernel documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=3918102e" />
<script src="../_static/documentation_options.js?v=5929fcd5"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="AD7606 driver" href="ad7606.html" />
<link rel="prev" title="AD7191 driver" href="ad7191.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/logo.svg" alt="Logo of The Linux Kernel"/>
</a></p>
<h1 class="logo"><a href="../index.html">The Linux Kernel</a></h1>
<p class="blurb">6.18.50</p>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
<p>
<h3 class="kernel-toc-contents">Contents</h3>
<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
<label class="kernel-toc-title" for="kernel-toc-toggle"></label>
<div class="kerneltoc" id="kerneltoc">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../process/development-process.html">Development process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/submitting-patches.html">Submitting patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/code-of-conduct.html">Code of conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="../maintainer/index.html">Maintainer handbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/index.html">All development-process docs</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../core-api/index.html">Core API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../driver-api/index.html">Driver APIs</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../subsystem-apis.html">Subsystems</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#core-subsystems">Core subsystems</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#human-interfaces">Human interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#networking-interfaces">Networking interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#storage-interfaces">Storage interfaces</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../subsystem-apis.html#other-subsystems">Other subsystems</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../accounting/index.html">Accounting</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cpu-freq/index.html">CPUFreq - CPU frequency and voltage scaling code in the Linux(TM) kernel</a></li>
<li class="toctree-l3"><a class="reference internal" href="../edac/index.html">EDAC Subsystem</a></li>
<li class="toctree-l3"><a class="reference internal" href="../fpga/index.html">FPGA</a></li>
<li class="toctree-l3"><a class="reference internal" href="../i2c/index.html">I2C/SMBus Subsystem</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="index.html">Industrial I/O</a></li>
<li class="toctree-l3"><a class="reference internal" href="../pcmcia/index.html">PCMCIA</a></li>
<li class="toctree-l3"><a class="reference internal" href="../spi/index.html">Serial Peripheral Interface (SPI)</a></li>
<li class="toctree-l3"><a class="reference internal" href="../w1/index.html">1-Wire Subsystem</a></li>
<li class="toctree-l3"><a class="reference internal" href="../watchdog/index.html">Watchdog Support</a></li>
<li class="toctree-l3"><a class="reference internal" href="../virt/index.html">Virtualization Support</a></li>
<li class="toctree-l3"><a class="reference internal" href="../hwmon/index.html">Hardware Monitoring</a></li>
<li class="toctree-l3"><a class="reference internal" href="../accel/index.html">Compute Accelerators</a></li>
<li class="toctree-l3"><a class="reference internal" href="../security/index.html">Security Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../crypto/index.html">Crypto API</a></li>
<li class="toctree-l3"><a class="reference internal" href="../bpf/index.html">BPF Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../usb/index.html">USB support</a></li>
<li class="toctree-l3"><a class="reference internal" href="../PCI/index.html">PCI Bus Subsystem</a></li>
<li class="toctree-l3"><a class="reference internal" href="../misc-devices/index.html">Assorted Miscellaneous Devices Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../peci/index.html">PECI Subsystem</a></li>
<li class="toctree-l3"><a class="reference internal" href="../wmi/index.html">WMI Subsystem</a></li>
<li class="toctree-l3"><a class="reference internal" href="../tee/index.html">TEE Subsystem</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../locking/index.html">Locking</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../process/license-rules.html">Licensing rules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../doc-guide/index.html">Writing documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/index.html">Development tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/testing-overview.html">Testing guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kernel-hacking/index.html">Hacking guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../trace/index.html">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fault-injection/index.html">Fault injection</a></li>
<li class="toctree-l1"><a class="reference internal" href="../livepatch/index.html">Livepatching</a></li>
<li class="toctree-l1"><a class="reference internal" href="../rust/index.html">Rust</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/index.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kbuild/index.html">Build system</a></li>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/reporting-issues.html">Reporting issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Userspace tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../userspace-api/index.html">Userspace API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../firmware-guide/index.html">Firmware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../devicetree/index.html">Firmware and Devicetree</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../arch/index.html">CPU architectures</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../staging/index.html">Unsorted documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../translations/index.html">Translations</a></li>
</ul>
</div>
<script type="text/javascript"> <!--
var sbar = document.getElementsByClassName("sphinxsidebar")[0];
let currents = document.getElementsByClassName("current")
if (currents.length) {
sbar.scrollTop = currents[currents.length - 1].offsetTop;
}
--> </script>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/iio/ad7380.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="ad7380-driver">
<h1>AD7380 driver<a class="headerlink" href="#ad7380-driver" title="Link to this heading">¶</a></h1>
<p>ADC driver for Analog Devices Inc. AD7380 and similar devices. The module name
is <code class="docutils literal notranslate"><span class="pre">ad7380</span></code>.</p>
<section id="supported-devices">
<h2>Supported devices<a class="headerlink" href="#supported-devices" title="Link to this heading">¶</a></h2>
<p>The following chips are supported by this driver:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7380.html">AD7380</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7381.html">AD7381</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7383.html">AD7383</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7384.html">AD7384</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7386.html">AD7386</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7387.html">AD7387</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7388.html">AD7388</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7380-4.html">AD7380-4</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7381-4.html">AD7381-4</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7383-4.html">AD7383-4</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7384-4.html">AD7384-4</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7386-4.html">AD7386-4</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7387-4.html">AD7387-4</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7388-4.html">AD7388-4</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/ad7389-4.html">AD7389-4</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/adaq4370-4.html">ADAQ4370-4</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/adaq4380-4.html">ADAQ4380-4</a></p></li>
<li><p><a class="reference external" href="https://www.analog.com/en/products/adaq4381-4.html">ADAQ4381-4</a></p></li>
</ul>
</section>
<section id="supported-features">
<h2>Supported features<a class="headerlink" href="#supported-features" title="Link to this heading">¶</a></h2>
<section id="spi-wiring-modes">
<h3>SPI wiring modes<a class="headerlink" href="#spi-wiring-modes" title="Link to this heading">¶</a></h3>
<p>ad738x ADCs can output data on several SDO lines (1/2/4). The driver currently
supports only 1 SDO line.</p>
</section>
<section id="reference-voltage">
<h3>Reference voltage<a class="headerlink" href="#reference-voltage" title="Link to this heading">¶</a></h3>
<section id="id1">
<h4>ad7380-4<a class="headerlink" href="#id1" title="Link to this heading">¶</a></h4>
<p>ad7380-4 supports only an external reference voltage (2.5V to 3.3V). It must be
declared in the device tree as <code class="docutils literal notranslate"><span class="pre">refin-supply</span></code>.</p>
</section>
<section id="id2">
<h4>ad7389-4<a class="headerlink" href="#id2" title="Link to this heading">¶</a></h4>
<p>ad7389-4 supports only an internal reference voltage. <code class="docutils literal notranslate"><span class="pre">refin-supply</span></code> and
<code class="docutils literal notranslate"><span class="pre">refio-supply</span></code> properties are both omitted in this case.</p>
</section>
<section id="adaq-devices">
<h4>ADAQ devices<a class="headerlink" href="#adaq-devices" title="Link to this heading">¶</a></h4>
<p>ADAQ devices don’t have an external reference, but use a 3.3V internal reference
derived from one of its supplies (<code class="docutils literal notranslate"><span class="pre">refin-supply</span></code>)</p>
</section>
<section id="all-other-devices-from-ad738x-family">
<h4>All other devices from ad738x family<a class="headerlink" href="#all-other-devices-from-ad738x-family" title="Link to this heading">¶</a></h4>
<p>All other devices from ad738x support 2 possible reference voltage sources:</p>
<ul class="simple">
<li><p>Internal reference (2.5V)</p></li>
<li><p>External reference (2.5V to 3.3V)</p></li>
</ul>
<p>The source is determined by the device tree. If <code class="docutils literal notranslate"><span class="pre">refio-supply</span></code> is present,
then it is used as external reference, else the internal reference is used.</p>
</section>
</section>
<section id="oversampling-and-resolution-boost">
<h3>Oversampling and resolution boost<a class="headerlink" href="#oversampling-and-resolution-boost" title="Link to this heading">¶</a></h3>
<p>This family supports 2 types of oversampling: normal average and rolling
average. Only normal average is supported by the driver, as rolling average can
be achieved by processing a captured data buffer. The following ratios are
available: 1 (oversampling disabled)/2/4/8/16/32.</p>
<p>When the on-chip oversampling function is enabled the performance of the ADC can
exceed the default resolution. To accommodate the performance boost achievable,
it is possible to enable an additional two bits of resolution. Because the
resolution boost feature can only be enabled when oversampling is enabled and
oversampling is not as useful without the resolution boost, the driver
automatically enables the resolution boost if and only if oversampling is
enabled.</p>
<p>Since the resolution boost feature causes 16-bit chips to now have 18-bit data
which means the storagebits has to change from 16 to 32 bits, we use the new
ext_scan_type feature to allow changing the scan_type at runtime. Unfortunately
libiio does not support it. So when enabling or disabling oversampling, user
must restart iiod using the following command:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>root:~#<span class="w"> </span>systemctl<span class="w"> </span>restart<span class="w"> </span>iiod
</pre></div>
</div>
</section>
<section id="alert">
<h3>Alert<a class="headerlink" href="#alert" title="Link to this heading">¶</a></h3>
<p>2 channels variants of the ad738x family, can use the SDOB line as an alert pin
when configured in 1 SDO line mode. 4 channels variants, can use SDOD as an
alert pin when configured in 1 or 2 SDO line(s) mode, although only 1 SDO line
mode is currently supported by the driver (see <a class="reference internal" href="#spi-wiring-modes">SPI wiring modes</a>).</p>
<p>At the end of a conversion the active-low alert pin gets asserted if the
conversion result exceeds the alert high limit or falls below the alert low
limit. It is cleared, on a falling edge of CS. The alert pin is common to all
channels.</p>
<p>User can enable alert using the regular iio events attribute:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>events/thresh_either_en
</pre></div>
</div>
<p>The high and low thresholds are common to all channels and can also be set using
regular iio events attributes:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>events/in_thresh_falling_value
events/in_thresh_rising_value
</pre></div>
</div>
<p>If debugfs is available, user can read the ALERT register to determine the
faulty channel and direction.</p>
<p>In most use cases, user will hardwire the alert pin to trigger a shutdown.</p>
</section>
<section id="channel-selection-and-sequencer-single-end-chips-only">
<h3>Channel selection and sequencer (single-end chips only)<a class="headerlink" href="#channel-selection-and-sequencer-single-end-chips-only" title="Link to this heading">¶</a></h3>
<p>Single-ended chips of this family (ad7386/7/8(-4)) have a 2:1 multiplexer in
front of each ADC. They also include additional configuration registers that
allow for either manual selection or automatic switching (sequencer mode), of
the multiplexer inputs.</p>
<p>From an IIO point of view, all inputs are exported, i.e ad7386/7/8
export 4 channels and ad7386-4/7-4/8-4 export 8 channels.</p>
<p>Inputs <code class="docutils literal notranslate"><span class="pre">AinX0</span></code> of multiplexers correspond to the first half of IIO channels (i.e
0-1 or 0-3) and inputs <code class="docutils literal notranslate"><span class="pre">AinX1</span></code> correspond to second half (i.e 2-3 or 4-7).
Example for AD7386/7/8 (2 channels parts):</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span> IIO | AD7386/7/8
| +----------------------------
| | _____ ______
| | | | | |
voltage0 | AinA0 --|--->| | | |
| | | mux |----->| ADCA |---
voltage2 | AinA1 --|--->| | | |
| | |_____| |_____ |
| | _____ ______
| | | | | |
voltage1 | AinB0 --|--->| | | |
| | | mux |----->| ADCB |---
voltage3 | AinB1 --|--->| | | |
| | |_____| |______|
| |
| +----------------------------
</pre></div>
</div>
<p>When enabling sequencer mode, the effective sampling rate is divided by two.</p>
<section id="gain-adaq-devices-only">
<h4>Gain (ADAQ devices only)<a class="headerlink" href="#gain-adaq-devices-only" title="Link to this heading">¶</a></h4>
<p>ADAQ devices have a pin selectable gain in front of each ADC. The appropriate
gain is selectable from device tree using the <code class="docutils literal notranslate"><span class="pre">adi,gain-milli</span></code> property.
Refer to the typical connection diagrams section of the datasheet for pin
wiring.</p>
</section>
</section>
<section id="unimplemented-features">
<h3>Unimplemented features<a class="headerlink" href="#unimplemented-features" title="Link to this heading">¶</a></h3>
<ul class="simple">
<li><p>2/4 SDO lines</p></li>
<li><p>Rolling average oversampling</p></li>
<li><p>Power down mode</p></li>
<li><p>CRC indication</p></li>
</ul>
</section>
</section>
<section id="spi-offload-support">
<h2>SPI offload support<a class="headerlink" href="#spi-offload-support" title="Link to this heading">¶</a></h2>
<p>To be able to achieve the maximum sample rate, the driver can be used with the
<a class="reference external" href="http://analogdevicesinc.github.io/hdl/projects/pulsar_adc/index.html">AXI SPI Engine</a> to provide SPI offload support.</p>
<p>When SPI offload is being used, some attributes will be different.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">trigger</span></code> directory is removed.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">in_voltage0_sampling_frequency</span></code> attribute is added for setting the sample
rate.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">in_voltage0_sampling_frequency_available</span></code> attribute is added for querying
the max sample rate.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">timestamp</span></code> channel is removed.</p></li>
<li><p>Buffer data format may be different compared to when offload is not used,
e.g. the <code class="docutils literal notranslate"><span class="pre">in_voltage0_type</span></code> attribute.</p></li>
</ul>
</section>
<section id="device-buffers">
<h2>Device buffers<a class="headerlink" href="#device-buffers" title="Link to this heading">¶</a></h2>
<p>This driver supports IIO triggered buffers.</p>
<p>See <a class="reference internal" href="iio_devbuf.html"><span class="doc">Industrial IIO device buffers</span></a> for more information.</p>
</section>
</section>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©The kernel development community.
|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
& <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
|
<a href="../_sources/iio/ad7380.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>