← Documents Documentation/iio/ad7606.rst GitHub 원문 ↗

Linux 6.18.37 · IIO

AD7606 driver

AD7605·AD7606·AD7616의 SPI·parallel·IIO-backend 경로, conversion trigger와 두 버퍼 모델을 설명합니다.

Source pathDocumentation/iio/ad7606.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

ad7606.rst:1-189

AD7606 드라이버는 직접 SPI, parallel, SPI offload와 IIO-backend 경로를 지원합니다. 일반 경로는 드라이버 built-in trigger와 timestamp를 쓰고, backend 경로는 외부 PWM·IP·DMA가 안정된 rate로 버퍼를 소유합니다.

문서 개요
항목
SourceDocumentation/iio/ad7606.rst
분량189 source lines
지원 장치4
Software-mode OSR1~256

원문 분량과 핵심 검토 대상을 요약합니다.

핵심 흐름
인터페이스와 데이터 경로 선택GPIO 또는 PWM trigger 구성Reference·OSR 설정직접 trigger 또는 backend 시작선택한 버퍼 모델로 수집

설정과 데이터 수집 순서를 압축합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0-only
2
3 =============
4 AD7606 driver
5 =============
6
7 ADC driver for Analog Devices Inc. AD7606 and similar devices. The module name
8 is ``ad7606``.
9
10 Supported devices
11 =================
12
13 The following chips are supported by this driver:
14
15 * `AD7605 <https://www.analog.com/en/products/ad7605.html>`_
16 * `AD7606 <https://www.analog.com/en/products/ad7606.html>`_
17 * `AD7606B <https://www.analog.com/en/products/ad7606b.html>`_
18 * `AD7616 <https://www.analog.com/en/products/ad7616.html>`_
19
20 Supported features
21 ==================
22
23 SPI wiring modes
24 ----------------
25
26 These ADCs can output data on several SDO lines (1/2/4/8). The driver
27 currently supports only 1 SDO line.
28
29 SPI offload wiring
30 ------------------
31 When used with a SPI offload, the supported wiring configuration is:
32
33 .. code-block::
34
35 +-------------+ +-------------+
36 | BUSY |-------->| TRIGGER |
37 | CS |<--------| CS |
38 | | | |
39 | ADC | | SPI |
40 | | | |
41 | SDI |<--------| SDO |
42 | DOUTA |-------->| SDI |
43 | SCLK |<--------| SCLK |
44 | | | |
45 | | +-------------+
46 | CONVST |<--------| PWM |
47 +-------------+ +-------------+
48
49 In this case, the ``pwms`` property is required.
50 The ``#trigger-source-cells = <1>`` property is also required to connect back
51 to the SPI offload. The SPI offload will have ``trigger-sources`` property
52 with a cell to indicate the busy signal:
53 ``<&ad7606 AD4695_TRIGGER_EVENT_BUSY>``.
54
55 .. seealso:: `SPI offload support`_
56
57
58 Parallel wiring mode
59 --------------------
60
61 There is also a parallel interface, with 16 lines (that can be reduced to 8 in
62 byte mode). The parallel interface is selected by declaring the device as
63 platform in the device tree (with no io-backends node defined, see below).
64
65 IIO-backend mode
66 ----------------
67
68 This mode allows to reach the best sample rates, but it requires an external
69 hardware (eg HDL or APU) to handle the low level communication.
70 The backend mode is enabled when through the definition of the "io-backends"
71 property in the device tree.
72
73 The reference configuration for the current implementation of IIO-backend mode
74 is the HDL reference provided by ADI:
75 https://wiki.analog.com/resources/eval/user-guides/ad7606x-fmc/hdl
76
77 This implementation embeds an IIO-backend compatible IP (adi-axi-adc) and a PWM
78 connected to the conversion trigger pin.
79
80 .. code-block::
81
82 +---+ +----------------------------
83 | | +-------+ |AD76xx
84 | A | controls | | |
85 | D |-------------->| PWM |-------------->| cnvst
86 | 7 | | | |
87 | 6 | +-------+ |
88 | 0 | controls +-----------+-----------+ |
89 | 6 |---------->| | |<--| frstdata
90 | | | Backend | Backend |<--| busy
91 | D | | Driver | | |
92 | R | | | |-->| clk
93 | I | requests |+---------+| DMA | |
94 | V |----------->| Buffer ||<---- |<=>| DATA
95 | E | |+---------+| | |
96 | R | +-----------+-----------+ |
97 | |-------------------------------------->| reset/configuration gpios
98 +---+ +-----------------------------
99
100
101 Software and hardware modes
102 ---------------------------
103
104 While all the AD7606/AD7616 series parts can be configured using GPIOs, some of
105 them can be configured using register.
106
107 The chips that support software mode have more values available for configuring
108 the device, as well as more settings, and allow to control the range and
109 calibration per channel.
110
111 The following settings are available per channel in software mode:
112 - Scale
113
114 Also, there is a broader choice of oversampling ratios in software mode.
115
116 Conversion triggering
117 ---------------------
118
119 The conversion can be triggered by two distinct ways:
120
121 - A GPIO is connected to the conversion trigger pin, and this GPIO is controlled
122 by the driver directly. In this configuration, the driver sets back the
123 conversion trigger pin to high as soon as it has read all the conversions.
124
125 - An external source is connected to the conversion trigger pin. In the
126 current implementation, it must be a PWM. In this configuration, the driver
127 does not control directly the conversion trigger pin. Instead, it can
128 control the PWM's frequency. This trigger is enabled only for iio-backend.
129
130 Reference voltage
131 -----------------
132
133 2 possible reference voltage sources are supported:
134
135 - Internal reference (2.5V)
136 - External reference (2.5V)
137
138 The source is determined by the device tree. If ``refin-supply`` is present,
139 then the external reference is used, otherwise the internal reference is used.
140
141 Oversampling
142 ------------
143
144 This family supports oversampling to improve SNR.
145 In software mode, the following ratios are available:
146 1 (oversampling disabled)/2/4/8/16/32/64/128/256.
147
148 Unimplemented features
149 ----------------------
150
151 - 2/4/8 SDO lines
152 - CRC indication
153 - Calibration
154
155 SPI offload support
156 ===================
157
158 To be able to achieve the maximum sample rate, the driver can be used with the
159 `AXI SPI Engine`_ to provide SPI offload support.
160
161 .. _AXI SPI Engine: https://analogdevicesinc.github.io/hdl/library/spi_engine/index.html
162
163 When SPI offload is being used, some attributes will be different.
164
165 * ``trigger`` directory is removed.
166 * ``sampling_frequency`` attribute is added for setting the sample rate.
167 * ``timestamp`` channel is removed.
168 * Buffer data format may be different compared to when offload is not used,
169 e.g. the ``in_voltage0_type`` attribute.
170
171 Device buffers
172 ==============
173
174 IIO triggered buffer
175 --------------------
176
177 This driver supports IIO triggered buffers, with a "built in" trigger, i.e the
178 trigger is allocated and linked by the driver, and a new conversion is triggered
179 as soon as the samples are transferred, and a timestamp channel is added to make
180 up for the potential jitter induced by the delays in the interrupt handling.
181
182 IIO backend buffer
183 ------------------
184
185 When IIO backend is used, the trigger is not needed, and the sample rate is
186 considered as stable. There is no timestamp channel. The communication is
187 delegated to an external logic, called a backend, and the backend's driver
188 handles the buffer. When this mode is enabled, the driver cannot control the
189 conversion pin, because the busy pin is bound to the backend.
190

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

지원 장치와 SPI·parallel 배선

1-64

이 문서는 Analog Devices Inc. AD7606과 유사 장치의 ADC 드라이버를 설명합니다. 모듈 이름은 `ad7606`이고 지원 칩은 AD7605, AD7606, AD7606B, AD7616입니다.

이 ADC들은 1·2·4·8개의 SDO 선으로 데이터를 출력할 수 있지만 현재 드라이버는 한 선만 지원합니다.

SPI offload 배선에서는 ADC BUSY를 SPI TRIGGER에, CS를 CS에 연결합니다. ADC SDI는 SPI SDO, DOUTA는 SPI SDI, SCLK는 SCLK에 연결하며 CONVST는 PWM이 구동합니다.

AD7606 SPI offload 배선
ADC 핀방향SPI/Host 핀역할
BUSYADC → SPITRIGGER변환 완료
CSSPI → ADCCS직렬 인터페이스 선택
SDISPI → ADCSDO구성 데이터
DOUTAADC → SPISDI변환 결과
SCLKSPI → ADCSCLK직렬 클록
CONVSTPWM → ADCPWM변환 시작

원문의 ADC·SPI ASCII 그림을 동일한 신호 방향으로 재구성합니다.

이 구성에는 `pwms` 속성이 필수입니다. SPI offload로 되돌아갈 trigger 연결에는 `#trigger-source-cells = <1>`이 필요하고, offload의 `trigger-sources`는 busy event 셀을 지정합니다. 원문 예시는 `<&ad7606 AD4695_TRIGGER_EVENT_BUSY>`입니다.

Parallel 인터페이스는 16개 선을 사용하며 byte 모드에서는 8개로 줄일 수 있습니다. Device Tree에서 장치를 platform 장치로 선언하고 `io-backends` 노드를 정의하지 않으면 parallel 인터페이스를 선택합니다.

AD7606 직접 인터페이스
모드데이터 선Device Tree 선택
SPI현재 SDO 1개SPI 장치
SPI offloadSDO 1개 + BUSY trigger + PWM CONVST`pwms`, trigger source
Parallel16 lines 또는 byte mode 8 linesPlatform 장치, `io-backends` 없음

직렬 offload와 parallel 모드의 선택 조건입니다.

.. SPDX-License-Identifier: GPL-2.0-only

=============
AD7606 driver
=============

ADC driver for Analog Devices Inc. AD7606 and similar devices. The module name
is ``ad7606``.

Supported devices
=================

The following chips are supported by this driver:

* `AD7605 <https://www.analog.com/en/products/ad7605.html>`_
* `AD7606 <https://www.analog.com/en/products/ad7606.html>`_
* `AD7606B <https://www.analog.com/en/products/ad7606b.html>`_
* `AD7616 <https://www.analog.com/en/products/ad7616.html>`_

Supported features
==================

SPI wiring modes
----------------

These ADCs can output data on several SDO lines (1/2/4/8). The driver
currently supports only 1 SDO line.

SPI offload wiring
------------------
When used with a SPI offload, the supported wiring configuration is:

.. code-block::

    +-------------+         +-------------+
    |        BUSY |-------->| TRIGGER     |
    |          CS |<--------| CS          |
    |             |         |             |
    |     ADC     |         |     SPI     |
    |             |         |             |
    |         SDI |<--------| SDO         |
    |       DOUTA |-------->| SDI         |
    |        SCLK |<--------| SCLK        |
    |             |         |             |
    |             |         +-------------+
    |      CONVST |<--------| PWM         |
    +-------------+         +-------------+

In this case, the ``pwms`` property is required.
The ``#trigger-source-cells = <1>`` property is also required to connect back
to the SPI offload. The SPI offload will have ``trigger-sources`` property
with a cell to indicate the busy signal:
``<&ad7606 AD4695_TRIGGER_EVENT_BUSY>``.

.. seealso:: `SPI offload support`_


Parallel wiring mode
--------------------

There is also a parallel interface, with 16 lines (that can be reduced to 8 in
byte mode). The parallel interface is selected by declaring the device as
platform in the device tree (with no io-backends node defined, see below).

IIO-backend 고속 데이터 경로

65-100

IIO-backend 모드는 최상의 샘플률에 도달할 수 있지만 HDL 또는 APU 같은 외부 하드웨어가 저수준 통신을 처리해야 합니다. Device Tree에 `io-backends` 속성을 정의하면 활성화됩니다.

현재 구현의 기준 구성은 ADI가 제공하는 HDL reference입니다. 이 구현은 IIO-backend 호환 `adi-axi-adc` IP와 conversion trigger 핀에 연결된 PWM을 포함합니다.

AD7606 IIO-backend 구성
구성 요소연결 대상역할
AD7606 driverPWMConversion trigger 주기 제어
PWMAD76xx CNVST변환 시작
AD7606 driverBackend driverBackend 설정·제어
AD76xx FRSTDATA/BUSYBackend IP프레임 시작과 변환 상태
Backend IP clockAD76xx CLK병렬 데이터 clock
AD76xx DATABackend IP병렬 변환 결과
Backend DMAIIO buffer고속 데이터 이동
AD7606 driverAD76xx GPIOsReset·configuration

원문의 큰 ASCII 블록을 같은 제어·데이터 관계로 재구성합니다.

IIO-backend 수집
Driver가 PWM·장치 설정PWM이 CNVST trigger 생성AD76xx가 BUSY·FRSTDATA와 DATA 출력adi-axi-adc backend가 데이터 수신DMA가 IIO buffer로 전송

드라이버 제어와 외부 IP 데이터 경로를 분리합니다.

IIO-backend mode
----------------

This mode allows to reach the best sample rates, but it requires an external
hardware (eg HDL or APU) to handle the low level communication.
The backend mode is enabled when through the definition of the "io-backends"
property in the device tree.

The reference configuration for the current implementation of IIO-backend mode
is the HDL reference provided by ADI:
https://wiki.analog.com/resources/eval/user-guides/ad7606x-fmc/hdl

This implementation embeds an IIO-backend compatible IP (adi-axi-adc) and a PWM
connected to the conversion trigger pin.

.. code-block::

    +---+                                       +----------------------------
    |   |               +-------+               |AD76xx
    | A |  controls     |       |               |
    | D |-------------->|  PWM  |-------------->| cnvst
    | 7 |               |       |               |
    | 6 |               +-------+               |
    | 0 | controls  +-----------+-----------+   |
    | 6 |---------->|           |           |<--| frstdata
    |   |           | Backend   |  Backend  |<--| busy
    | D |           | Driver    |           |   |
    | R |           |           |           |-->| clk
    | I |  requests |+---------+| DMA       |   |
    | V |----------->|  Buffer ||<----      |<=>| DATA
    | E |           |+---------+|           |   |
    | R |           +-----------+-----------+   |
    |   |-------------------------------------->| reset/configuration gpios
    +---+                                       +-----------------------------

Software mode, conversion trigger와 reference

101-154

AD7606·AD7616 계열은 모두 GPIO로 설정할 수 있고 일부는 레지스터를 사용하는 software mode도 지원합니다.

Software mode 지원 칩은 더 많은 설정값과 기능을 제공하며 채널별 range와 calibration을 제어할 수 있습니다. 현재 문서가 나열하는 채널별 설정은 scale이며, oversampling ratio 선택 폭도 더 넓습니다.

변환은 두 방식으로 시작할 수 있습니다. 첫째, conversion trigger 핀에 GPIO를 연결해 드라이버가 직접 제어합니다. 드라이버는 모든 변환 결과를 읽은 즉시 trigger 핀을 다시 high로 설정합니다.

둘째, 외부 source를 conversion trigger 핀에 연결합니다. 현재 구현에서는 PWM이어야 하며 드라이버는 핀을 직접 제어하지 않고 PWM frequency를 조절합니다. 이 방식은 IIO-backend에서만 활성화됩니다.

AD7606 conversion trigger
방식핀 구동드라이버 동작사용 범위
GPIODriver-controlled GPIO모든 conversion read 후 high 복귀일반 경로
External PWMPWMFrequency 제어, 핀 직접 제어 안 함IIO-backend 전용

직접 GPIO와 외부 PWM의 책임을 비교합니다.

Reference는 내부 2.5V와 외부 2.5V를 지원합니다. Device Tree에 `refin-supply`가 있으면 외부 reference를 쓰고, 없으면 내부 reference를 사용합니다.

AD7606 reference 선택
`refin-supply`Reference
있음외부 2.5V
없음내부 2.5V

Device Tree 속성 유무가 전압원을 정합니다.

이 계열은 SNR 향상을 위해 oversampling을 지원합니다. Software mode에서는 1(비활성), 2, 4, 8, 16, 32, 64, 128, 256을 사용할 수 있습니다.

AD7606 software-mode oversampling
OSR상태
1Oversampling disabled
2, 4, 8, 16, 32, 64, 128, 256Oversampling enabled

지원 OSR 범위입니다.

아직 구현되지 않은 기능은 2·4·8 SDO 선, CRC indication과 calibration입니다.

AD7606 미구현 기능
분류항목
데이터 레인2/4/8 SDO lines
무결성CRC indication
보정Calibration

현재 드라이버가 제공하지 않는 항목입니다.

Software and hardware modes
---------------------------

While all the AD7606/AD7616 series parts can be configured using GPIOs, some of
them can be configured using register.

The chips that support software mode have more values available for configuring
the device, as well as more settings, and allow to control the range and
calibration per channel.

The following settings are available per channel in software mode:
 - Scale

Also, there is a broader choice of oversampling ratios in software mode.

Conversion triggering
---------------------

The conversion can be triggered by two distinct ways:

 - A GPIO is connected to the conversion trigger pin, and this GPIO is controlled
   by the driver directly.  In this configuration, the driver sets back the
   conversion trigger pin to high as soon as it has read all the conversions.

 - An external source is connected to the conversion trigger pin. In the
   current implementation, it must be a PWM. In this configuration, the driver
   does not control directly the conversion trigger pin. Instead, it can
   control the PWM's frequency. This trigger is enabled only for iio-backend.

Reference voltage
-----------------

2 possible reference voltage sources are supported:

 - Internal reference (2.5V)
 - External reference (2.5V)

The source is determined by the device tree. If ``refin-supply`` is present,
then the external reference is used, otherwise the internal reference is used.

Oversampling
------------

This family supports oversampling to improve SNR.
In software mode, the following ratios are available:
1 (oversampling disabled)/2/4/8/16/32/64/128/256.

Unimplemented features
----------------------

- 2/4/8 SDO lines
- CRC indication
- Calibration

SPI offload와 두 버퍼 모델

155-189

최대 샘플 속도를 위해 드라이버는 `AXI SPI Engine`과 함께 SPI offload를 제공할 수 있습니다.

Offload에서는 `trigger` 디렉터리와 `timestamp` 채널을 제거하고 샘플률 설정용 `sampling_frequency`를 추가합니다. 버퍼 형식도 달라질 수 있으며 예로 `in_voltage0_type`이 있습니다.

AD7606 SPI offload 속성
항목Offload 동작
`trigger`디렉터리 제거
`sampling_frequency`추가, sample rate 설정
`timestamp`채널 제거
`in_voltage0_type`Buffer format이 달라질 수 있음

일반 trigger 경로와 달라지는 항목입니다.

일반 IIO triggered buffer에서는 드라이버가 built-in trigger를 할당하고 연결합니다. 샘플 전송이 끝나는 즉시 새 변환을 시작하며 interrupt 처리 지연의 jitter를 보완하기 위해 timestamp 채널을 추가합니다.

IIO-backend buffer에서는 trigger가 필요 없고 sample rate를 안정적이라고 간주하므로 timestamp 채널도 없습니다. 외부 backend 로직에 통신을 위임하고 backend 드라이버가 버퍼를 처리합니다.

IIO-backend를 활성화하면 BUSY 핀이 backend에 묶여 있으므로 AD7606 드라이버가 conversion 핀을 제어할 수 없습니다.

AD7606 버퍼 모델
모델TriggerTimestamp통신·버퍼 소유
IIO triggered bufferDriver built-in있음, IRQ jitter 보완AD7606 driver
IIO backend buffer불필요, 안정 rate없음외부 backend + backend driver

Trigger·timestamp·통신 소유권을 비교합니다.

버퍼 모델 선택
직접 SPI·GPIO면 built-in trigger 선택외부 backend면 PWM·backend path 선택Triggered path는 timestamp 포함Backend path는 DMA buffer와 안정 sample rate 사용

하드웨어 경로에 따라 변환과 버퍼 책임을 나눕니다.

SPI offload support
===================

To be able to achieve the maximum sample rate, the driver can be used with the
`AXI SPI Engine`_ to provide SPI offload support.

.. _AXI SPI Engine: https://analogdevicesinc.github.io/hdl/library/spi_engine/index.html

When SPI offload is being used, some attributes will be different.

* ``trigger`` directory is removed.
* ``sampling_frequency`` attribute is added for setting the sample rate.
* ``timestamp`` channel is removed.
* Buffer data format may be different compared to when offload is not used,
  e.g. the ``in_voltage0_type`` attribute.

Device buffers
==============

IIO triggered buffer
--------------------

This driver supports IIO triggered buffers, with a "built in" trigger, i.e the
trigger is allocated and linked by the driver, and a new conversion is triggered
as soon as the samples are transferred, and a timestamp channel is added to make
up for the potential jitter induced by the delays in the interrupt handling.

IIO backend buffer
------------------

When IIO backend is used, the trigger is not needed, and the sample rate is
considered as stable. There is no timestamp channel. The communication is
delegated to an external logic, called a backend, and the backend's driver
handles the buffer. When this mode is enabled, the driver cannot control the
conversion pin, because the busy pin is bound to the backend.