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

Linux 6.18.37 · IIO

AD4030 driver

AD4030·AD4630 계열 ADC의 IIO 채널 분해, SPI 출력 모드, digital gain·offset과 기준 전압·reset 설정을 설명합니다.

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

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

1. 요약·해설

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

요약·해설

ad4030.rst:1-180

AD4030 드라이버는 하드웨어 채널 하나를 differential과 common-mode IIO 채널로 나눕니다. Buffered 채널 선택과 oversampling이 출력 형식을 결정하고, calibscale·calibbias가 gain 뒤 offset 순서의 digital 보정을 제어합니다.

문서 개요
항목
SourceDocumentation/iio/ad4030.rst
분량180 source lines
지원 장치6
출력 모드3

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

핵심 흐름
하드웨어 채널을 IIO 채널에 매핑SPI lane과 출력 모드 선택Gain·offset 보정기준 전압 경로 선택GPIO 또는 software reset

장치 설정과 데이터 경로를 압축합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0-only
2
3 =============
4 AD4030 driver
5 =============
6
7 ADC driver for Analog Devices Inc. AD4030 and similar devices. The module name
8 is ``ad4030``.
9
10
11 Supported devices
12 =================
13
14 The following chips are supported by this driver:
15
16 * `AD4030-24 <https://www.analog.com/AD4030-24>`_
17 * `AD4032-24 <https://www.analog.com/AD4032-24>`_
18 * `AD4630-16 <https://www.analog.com/AD4630-16>`_
19 * `AD4630-24 <https://www.analog.com/AD4630-24>`_
20 * `AD4632-16 <https://www.analog.com/AD4632-16>`_
21 * `AD4632-24 <https://www.analog.com/AD4632-24>`_
22
23 IIO channels
24 ============
25
26 Each "hardware" channel as described in the datasheet is split in 2 IIO
27 channels:
28
29 - One channel for the differential data
30 - One channel for the common byte.
31
32 The possible IIO channels depending on the numbers of "hardware" channel are:
33
34 +------------------------------------+------------------------------------+
35 | 1 channel ADC | 2 channels ADC |
36 +====================================+====================================+
37 | - voltage0-voltage1 (differential) | - voltage0-voltage1 (differential) |
38 | - voltage2 (common-mode) | - voltage2-voltage3 (differential) |
39 | | - voltage4 (common-mode) |
40 | | - voltage5 (common-mode) |
41 +------------------------------------+------------------------------------+
42
43 Labels
44 ------
45
46 For ease of use, the IIO channels provide a label. For a differential channel,
47 the label is ``differentialN`` where ``N`` is the "hardware" channel id. For a
48 common-mode channel, the label is ``common-modeN`` where ``N`` is the
49 "hardware" channel id.
50
51 The possible labels are:
52
53 +-----------------+-----------------+
54 | 1 channel ADC | 2 channels ADC |
55 +=================+=================+
56 | - differential0 | - differential0 |
57 | - common-mode0 | - differential1 |
58 | | - common-mode0 |
59 | | - common-mode1 |
60 +-----------------+-----------------+
61
62 Supported features
63 ==================
64
65 SPI wiring modes
66 ----------------
67
68 The driver currently supports the following SPI wiring configurations:
69
70 One lane mode
71 ^^^^^^^^^^^^^
72
73 In this mode, each channel has its own SDO line to send the conversion results.
74 At the moment this mode can only be used on AD4030 which has one channel so only
75 one SDO line is used.
76
77 .. code-block::
78
79 +-------------+ +-------------+
80 | ADC | | HOST |
81 | | | |
82 | CNV |<--------| CNV |
83 | CS |<--------| CS |
84 | SDI |<--------| SDO |
85 | SDO0 |-------->| SDI |
86 | SCLK |<--------| SCLK |
87 +-------------+ +-------------+
88
89 Interleaved mode
90 ^^^^^^^^^^^^^^^^
91
92 In this mode, both channels conversion results are bit interleaved one SDO line.
93 As such the wiring is the same as `One lane mode`_.
94
95 SPI Clock mode
96 --------------
97
98 Only the SPI clocking mode is supported.
99
100 Output modes
101 ------------
102
103 There are more exposed IIO channels than channels as describe in the devices
104 datasheet. This is due to the `Differential data + common-mode`_ encoding
105 2 types of information in one conversion result. As such a "device" channel
106 provides 2 IIO channels, one for the differential data and one for the common
107 byte.
108
109 Differential data
110 ^^^^^^^^^^^^^^^^^
111
112 This mode is selected when:
113
114 - Only differential channels are enabled in a buffered read
115 - Oversampling attribute is set to 1
116
117 Differential data + common-mode
118 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
119
120 This mode is selected when:
121
122 - Differential and common-mode channels are enabled in a buffered read
123 - Oversampling attribute is set to 1
124
125 For the 24-bits chips, this mode is also available with 16-bits differential
126 data but is not selectable yet.
127
128 Averaged differential data
129 ^^^^^^^^^^^^^^^^^^^^^^^^^^
130
131 This mode is selected when:
132
133 - Only differential channels are selected enabled in a buffered read
134 - Oversampling attribute is greater than 1
135
136 Digital Gain and Offset
137 -----------------------
138
139 Each differential data channel has a 16-bits unsigned configurable hardware
140 gain applied to it. By default it's equal to 1. Note that applying gain can
141 cause numerical saturation.
142
143 Each differential data channel has a signed configurable hardware offset.
144 For the ADCs ending in ``-24``, the gain is encoded on 24-bits.
145 Likewise, the ADCs ending in ``-16`` have a gain encoded on 16-bits. Note that
146 applying an offset can cause numerical saturation.
147
148 The final differential data returned by the ADC is computed by first applying
149 the gain, then the offset.
150
151 The gain is controlled by the ``calibscale`` IIO attribute while the offset is
152 controlled by the ``calibbias`` attribute.
153
154 Reference voltage
155 -----------------
156
157 The chip supports an external reference voltage via the ``REF`` input or an
158 internal buffered reference voltage via the ``REFIN`` input. The driver looks
159 at the device tree to determine which is being used. If ``ref-supply`` is
160 present, then the external reference voltage is used and the internal buffer is
161 disabled. If ``refin-supply`` is present, then the internal buffered reference
162 voltage is used.
163
164 Reset
165 -----
166
167 Both hardware and software reset are supported. The driver looks first at the
168 device tree to see if the ``reset-gpio`` is populated.
169 If not present, the driver will fallback to a software reset by wiring to the
170 device's registers.
171
172 Unimplemented features
173 ----------------------
174
175 - ``BUSY`` indication
176 - Additional wiring modes
177 - Additional clock modes
178 - Differential data 16-bits + common-mode for 24-bits chips
179 - Overrange events
180 - Test patterns
181

3. 한국어 전문 번역

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

지원 장치와 IIO 채널 매핑

1-61

이 문서는 Analog Devices Inc. AD4030과 유사 ADC의 드라이버를 설명합니다. 모듈 이름은 `ad4030`입니다.

지원 칩은 AD4030-24, AD4032-24, AD4630-16, AD4630-24, AD4632-16, AD4632-24입니다.

데이터시트가 말하는 각 하드웨어 채널은 IIO 채널 두 개로 나뉩니다. 하나는 differential 데이터, 다른 하나는 common 바이트입니다.

AD4030 지원 장치
계열16-bit24-bit
AD403x-AD4030-24, AD4032-24
AD4630AD4630-16AD4630-24
AD4632AD4632-16AD4632-24

해상도 접미사를 포함한 지원 ADC입니다.

하드웨어 채널의 IIO 분해
하드웨어 채널 수Differential IIO 채널Common-mode IIO 채널
1`voltage0-voltage1``voltage2`
2`voltage0-voltage1`, `voltage2-voltage3``voltage4`, `voltage5`

한 하드웨어 변환 결과를 differential과 common-mode로 나눕니다.

사용 편의를 위해 IIO 채널은 label을 제공합니다. Differential 채널은 하드웨어 채널 ID `N`에 대해 `differentialN`, common-mode 채널은 `common-modeN`입니다.

AD4030 IIO label
하드웨어 채널 수Labels
1`differential0`, `common-mode0`
2`differential0`, `differential1`, `common-mode0`, `common-mode1`

하드웨어 채널 수에 따른 label 목록입니다.

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

=============
AD4030 driver
=============

ADC driver for Analog Devices Inc. AD4030 and similar devices. The module name
is ``ad4030``.


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

The following chips are supported by this driver:

* `AD4030-24 <https://www.analog.com/AD4030-24>`_
* `AD4032-24 <https://www.analog.com/AD4032-24>`_
* `AD4630-16 <https://www.analog.com/AD4630-16>`_
* `AD4630-24 <https://www.analog.com/AD4630-24>`_
* `AD4632-16 <https://www.analog.com/AD4632-16>`_
* `AD4632-24 <https://www.analog.com/AD4632-24>`_

IIO channels
============

Each "hardware" channel as described in the datasheet is split in 2 IIO
channels:

- One channel for the differential data
- One channel for the common byte.

The possible IIO channels depending on the numbers of "hardware" channel are:

+------------------------------------+------------------------------------+
| 1 channel ADC                      | 2 channels ADC                     |
+====================================+====================================+
| - voltage0-voltage1 (differential) | - voltage0-voltage1 (differential) |
| - voltage2 (common-mode)           | - voltage2-voltage3 (differential) |
|                                    | - voltage4 (common-mode)           |
|                                    | - voltage5 (common-mode)           |
+------------------------------------+------------------------------------+

Labels
------

For ease of use, the IIO channels provide a label. For a differential channel,
the label is ``differentialN`` where ``N`` is the "hardware" channel id. For a
common-mode channel, the label is ``common-modeN`` where ``N`` is the
"hardware" channel id.

The possible labels are:

+-----------------+-----------------+
| 1 channel ADC   | 2 channels ADC  |
+=================+=================+
| - differential0 | - differential0 |
| - common-mode0  | - differential1 |
|                 | - common-mode0  |
|                 | - common-mode1  |
+-----------------+-----------------+

SPI 배선과 출력 모드

62-135

현재 드라이버는 one lane과 interleaved 배선 구성을 설명하며 SPI clocking mode만 지원합니다.

One lane 모드에서는 각 채널이 변환 결과를 보내는 자체 SDO 선을 가집니다. 현재 이 모드는 채널 하나인 AD4030에서만 사용할 수 있으므로 SDO 선 하나만 사용합니다.

AD4030 one-lane 배선
ADC 핀방향HOST 핀역할
CNVHOST → ADCCNV변환 시작
CSHOST → ADCCS장치 선택
SDIHOST → ADCSDOADC 제어 데이터
SDO0ADC → HOSTSDI변환 결과
SCLKHOST → ADCSCLK직렬 클록

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

Interleaved 모드에서는 두 채널의 변환 결과 비트가 SDO 선 하나에 교차 배치됩니다. 물리 배선은 one lane 모드와 같습니다.

SPI 데이터 레인 모드
모드SDO 사용현재 제약
One lane채널마다 자체 SDO현재 1채널 AD4030만 지원
Interleaved두 채널 비트를 SDO 하나에 interleave배선은 one lane과 동일

채널 데이터가 SDO에 배치되는 방식을 비교합니다.

장치 데이터시트의 채널 수보다 노출되는 IIO 채널 수가 많은 이유는 `Differential data + common-mode` 인코딩이 한 변환 결과에 두 종류의 정보를 담기 때문입니다. 장치 채널 하나가 differential 데이터와 common 바이트의 IIO 채널 두 개를 제공합니다.

Differential data 출력 모드는 buffered read에서 differential 채널만 활성화하고 oversampling 속성을 1로 설정할 때 선택됩니다.

Differential data + common-mode 출력 모드는 buffered read에서 differential과 common-mode 채널을 함께 활성화하고 oversampling을 1로 설정할 때 선택됩니다. 24비트 칩에서는 16비트 differential 데이터로도 사용할 수 있지만 아직 선택할 수 없습니다.

Averaged differential data 모드는 buffered read에서 differential 채널만 활성화하고 oversampling 속성을 1보다 크게 설정할 때 선택됩니다.

AD4030 출력 모드 선택
출력 모드Buffered 채널Oversampling비고
Differential dataDifferential만`1`기본 differential 결과
Differential + common-modeDifferential + common-mode`1`24-bit에서 16-bit differential 변형은 아직 선택 불가
Averaged differentialDifferential만`> 1`평균화 결과

채널 선택과 oversampling 값으로 결정되는 형식입니다.

Buffered 출력 형식 결정
Buffered read 채널 선택Common-mode 포함 여부 확인Oversampling 값 확인Differential, combined 또는 averaged 모드 선택선택된 인코딩으로 변환 데이터 수집

활성 채널과 oversampling으로 하드웨어 출력 모드를 선택합니다.

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

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

The driver currently supports the following SPI wiring configurations:

One lane mode
^^^^^^^^^^^^^

In this mode, each channel has its own SDO line to send the conversion results.
At the moment this mode can only be used on AD4030 which has one channel so only
one SDO line is used.

.. code-block::

    +-------------+         +-------------+
    |     ADC     |         |     HOST    |
    |             |         |             |
    |         CNV |<--------| CNV         |
    |          CS |<--------| CS          |
    |         SDI |<--------| SDO         |
    |        SDO0 |-------->| SDI         |
    |        SCLK |<--------| SCLK        |
    +-------------+         +-------------+

Interleaved mode
^^^^^^^^^^^^^^^^

In this mode, both channels conversion results are bit interleaved one SDO line.
As such the wiring is the same as `One lane mode`_.

SPI Clock mode
--------------

Only the SPI clocking mode is supported.

Output modes
------------

There are more exposed IIO channels than channels as describe in the devices
datasheet. This is due to the `Differential data + common-mode`_ encoding
2 types of information in one conversion result. As such a "device" channel
provides 2 IIO channels, one for the differential data and one for the common
byte.

Differential data
^^^^^^^^^^^^^^^^^

This mode is selected when:

- Only differential channels are enabled in a buffered read
- Oversampling attribute is set to 1

Differential data + common-mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This mode is selected when:

- Differential and common-mode channels are enabled in a buffered read
- Oversampling attribute is set to 1

For the 24-bits chips, this mode is also available with 16-bits differential
data but is not selectable yet.

Averaged differential data
^^^^^^^^^^^^^^^^^^^^^^^^^^

This mode is selected when:

- Only differential channels are selected enabled in a buffered read
- Oversampling attribute is greater than 1

Digital gain·offset, 기준 전압과 reset

136-180

각 differential 데이터 채널에는 16비트 unsigned 하드웨어 gain을 설정할 수 있으며 기본값은 1입니다. Gain 적용은 수치 포화를 일으킬 수 있습니다.

각 differential 데이터 채널에는 signed 하드웨어 offset도 설정할 수 있습니다. 원문은 `-24`로 끝나는 ADC의 gain이 24비트, `-16`으로 끝나는 ADC의 gain이 16비트로 인코딩된다고 설명하며, offset 적용 역시 수치 포화를 일으킬 수 있다고 경고합니다.

ADC가 반환하는 최종 differential 데이터는 gain을 먼저 적용하고 offset을 나중에 적용해 계산합니다. Gain은 IIO `calibscale`, offset은 `calibbias` 속성으로 제어합니다.

Digital 보정 순서
단계IIO 속성표현주의
1. Gain`calibscale`기본 1, unsigned configurable수치 포화 가능
2. Offset`calibbias`signed configurable수치 포화 가능
3. Result-`raw * gain + offset` 순서ADC differential 출력

사용자 속성과 하드웨어 연산의 관계입니다.

칩은 `REF` 입력의 외부 기준 전압과 `REFIN` 입력의 내부 buffered 기준 전압을 지원합니다. 드라이버는 Device Tree를 보고 사용할 방식을 결정합니다.

`ref-supply`가 있으면 외부 기준 전압을 사용하고 내부 버퍼를 비활성화합니다. `refin-supply`가 있으면 내부 buffered 기준 전압을 사용합니다.

AD4030 기준 전압 선택
Device Tree 속성입력내부 버퍼
`ref-supply``REF` 외부 기준비활성화
`refin-supply``REFIN` 내부 buffered 기준사용

Device Tree supply 속성과 입력 경로입니다.

하드웨어 reset과 소프트웨어 reset을 모두 지원합니다. 드라이버는 먼저 Device Tree에 `reset-gpio`가 있는지 확인하고, 없으면 장치 레지스터를 통한 소프트웨어 reset으로 대체합니다.

Reset 경로 선택
Device Tree에서 `reset-gpio` 확인있으면 GPIO로 hardware reset없으면 장치 register에 software reset 기록초기화 계속

GPIO 존재 여부에 따라 reset 방법을 정합니다.

아직 구현하지 않은 기능은 `BUSY` 표시, 추가 배선 모드, 추가 clock 모드, 24비트 칩의 16비트 differential data + common-mode, overrange 이벤트와 테스트 패턴입니다.

AD4030 미구현 기능
분류미구현 항목
상태`BUSY` indication, overrange events
배선·클록추가 wiring modes, 추가 clock modes
데이터 형식24-bit 칩의 16-bit differential + common-mode
진단Test patterns

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

Digital Gain and Offset
-----------------------

Each differential data channel has a 16-bits unsigned configurable hardware
gain applied to it. By default it's equal to 1. Note that applying gain can
cause numerical saturation.

Each differential data channel has a signed configurable hardware offset.
For the ADCs ending in ``-24``, the gain is encoded on 24-bits.
Likewise, the ADCs ending in ``-16`` have a gain encoded on 16-bits. Note that
applying an offset can cause numerical saturation.

The final differential data returned by the ADC is computed by first applying
the gain, then the offset.

The gain is controlled by the ``calibscale`` IIO attribute while the offset is
controlled by the ``calibbias`` attribute.

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

The chip supports an external reference voltage via the ``REF`` input or an
internal buffered reference voltage via the ``REFIN`` input. The driver looks
at the device tree to determine which is being used. If ``ref-supply`` is
present, then the external reference voltage is used and the internal buffer is
disabled. If ``refin-supply`` is present, then the internal buffered reference
voltage is used.

Reset
-----

Both hardware and software reset are supported. The driver looks first at the
device tree to see if the ``reset-gpio`` is populated.
If not present, the driver will fallback to a software reset by wiring to the
device's registers.

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

- ``BUSY`` indication
- Additional wiring modes
- Additional clock modes
- Differential data 16-bits + common-mode for 24-bits chips
- Overrange events
- Test patterns