← Documents Documentation/hwmon/ina2xx.rst GitHub 원문 ↗

Linux 6.18.37 · Hardware Monitoring

Kernel driver ina2xx

INA219·220·226·230·231·260과 SY24655의 공통 shunt 전압·전류·전력 드라이버입니다.

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

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

1. 요약·해설

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

요약·해설

ina2xx.rst:1-163

공통 측정값과 변형별 임계 경보를 제공하며 SY24655의 임계 설정은 한 번에 하나만 활성화됩니다.

문서 개요
항목
SourceDocumentation/hwmon/ina2xx.rst
분량163 source lines
지원 칩7 models
주소I2C 0x40-0x4f

원문 분량과 핵심 기능입니다.

측정 흐름
칩 식별Shunt 값 설정전압·전류·전력 측정임계 경보 평가

설정에서 hwmon 게시까지의 핵심 순서입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 Kernel driver ina2xx
2 ====================
3
4 Supported chips:
5
6 * Texas Instruments INA219
7
8
9 Prefix: 'ina219'
10 Addresses: I2C 0x40 - 0x4f
11
12 Datasheet: Publicly available at the Texas Instruments website
13
14 https://www.ti.com/
15
16 * Texas Instruments INA220
17
18 Prefix: 'ina220'
19
20 Addresses: I2C 0x40 - 0x4f
21
22 Datasheet: Publicly available at the Texas Instruments website
23
24 https://www.ti.com/
25
26 * Texas Instruments INA226
27
28 Prefix: 'ina226'
29
30 Addresses: I2C 0x40 - 0x4f
31
32 Datasheet: Publicly available at the Texas Instruments website
33
34 https://www.ti.com/
35
36 * Texas Instruments INA230
37
38 Prefix: 'ina230'
39
40 Addresses: I2C 0x40 - 0x4f
41
42 Datasheet: Publicly available at the Texas Instruments website
43
44 https://www.ti.com/
45
46 * Texas Instruments INA231
47
48 Prefix: 'ina231'
49
50 Addresses: I2C 0x40 - 0x4f
51
52 Datasheet: Publicly available at the Texas Instruments website
53
54 https://www.ti.com/
55
56 * Texas Instruments INA260
57
58 Prefix: 'ina260'
59
60 Addresses: I2C 0x40 - 0x4f
61
62 Datasheet: Publicly available at the Texas Instruments website
63
64 https://www.ti.com/
65
66 * Silergy SY24655
67
68 Prefix: 'sy24655'
69
70 Addresses: I2C 0x40 - 0x4f
71
72 Datasheet: Publicly available at the Silergy website
73
74 https://us1.silergy.com/
75
76
77 Author: Lothar Felten <lothar.felten@gmail.com>
78
79 Description
80 -----------
81
82 The INA219 is a high-side current shunt and power monitor with an I2C
83 interface. The INA219 monitors both shunt drop and supply voltage, with
84 programmable conversion times and filtering.
85
86 The INA220 is a high or low side current shunt and power monitor with an I2C
87 interface. The INA220 monitors both shunt drop and supply voltage.
88
89 The INA226 is a current shunt and power monitor with an I2C interface.
90 The INA226 monitors both a shunt voltage drop and bus supply voltage.
91
92 INA230 and INA231 are high or low side current shunt and power monitors
93 with an I2C interface. The chips monitor both a shunt voltage drop and
94 bus supply voltage.
95
96 INA260 is a high or low side current and power monitor with integrated shunt
97 resistor.
98
99 The SY24655 is a high- and low-side current shunt and power monitor with an I2C
100 interface. The SY24655 supports both shunt drop and supply voltage, with
101 programmable calibration value and conversion times. The SY24655 can also
102 calculate average power for use in energy conversion.
103
104 The shunt value in micro-ohms can be set via platform data or device tree at
105 compile-time or via the shunt_resistor attribute in sysfs at run-time. Please
106 refer to the Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings
107 if the device tree is used.
108
109 Additionally ina226 supports update_interval attribute as described in
110 Documentation/hwmon/sysfs-interface.rst. Internally the interval is the sum of
111 bus and shunt voltage conversion times multiplied by the averaging rate. We
112 don't touch the conversion times and only modify the number of averages. The
113 lower limit of the update_interval is 2 ms, the upper limit is 2253 ms.
114 The actual programmed interval may vary from the desired value.
115
116 General sysfs entries
117 ---------------------
118
119 ======================= ===============================================
120 in0_input Shunt voltage(mV) channel
121 in1_input Bus voltage(mV) channel
122 curr1_input Current(mA) measurement channel
123 power1_input Power(uW) measurement channel
124 shunt_resistor Shunt resistance(uOhm) channel (not for ina260)
125 ======================= ===============================================
126
127 Additional sysfs entries for ina226, ina230, ina231, ina260, and sy24655
128 ------------------------------------------------------------------------
129
130 ======================= ====================================================
131 curr1_lcrit Critical low current
132 curr1_crit Critical high current
133 curr1_lcrit_alarm Current critical low alarm
134 curr1_crit_alarm Current critical high alarm
135 in0_lcrit Critical low shunt voltage
136 in0_crit Critical high shunt voltage
137 in0_lcrit_alarm Shunt voltage critical low alarm
138 in0_crit_alarm Shunt voltage critical high alarm
139 in1_lcrit Critical low bus voltage
140 in1_crit Critical high bus voltage
141 in1_lcrit_alarm Bus voltage critical low alarm
142 in1_crit_alarm Bus voltage critical high alarm
143 power1_crit Critical high power
144 power1_crit_alarm Power critical high alarm
145 update_interval data conversion time; affects number of samples used
146 to average results for shunt and bus voltages.
147 ======================= ====================================================
148
149 Sysfs entries for sy24655 only
150 ------------------------------
151
152 ======================= ====================================================
153 power1_average average power from last reading to the present.
154 ======================= ====================================================
155
156 .. note::
157
158 - Configure `shunt_resistor` before configure `power1_crit`, because power
159 value is calculated based on `shunt_resistor` set.
160 - Because of the underlying register implementation, only one `*crit` setting
161 and its `alarm` can be active. Writing to one `*crit` setting clears other
162 `*crit` settings and alarms. Writing 0 to any `*crit` setting clears all
163 `*crit` settings and alarms.
164

3. 한국어 전문 번역

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

INA2xx 계열 지원 칩

1-78

`ina2xx` 드라이버는 Texas Instruments INA219, INA220, INA226, INA230, INA231, INA260과 Silergy SY24655를 지원합니다. 모든 칩은 I2C 주소 `0x40`부터 `0x4f`를 사용합니다. 접두사는 각각 `ina219`, `ina220`, `ina226`, `ina230`, `ina231`, `ina260`, `sy24655`입니다.

TI 칩의 데이터시트는 `https://www.ti.com/`, SY24655 데이터시트는 `https://us1.silergy.com/`에서 공개됩니다. 문서에 기재된 작성자는 Lothar Felten입니다.

INA2xx 지원 목록
접두사I2C 주소
Texas Instruments INA219ina2190x40-0x4f
Texas Instruments INA220ina2200x40-0x4f
Texas Instruments INA226ina2260x40-0x4f
Texas Instruments INA230ina2300x40-0x4f
Texas Instruments INA231ina2310x40-0x4f
Texas Instruments INA260ina2600x40-0x4f
Silergy SY24655sy246550x40-0x4f

원문의 칩, 접두사, 공통 주소 범위를 구조화했습니다.

INA2xx 장치 선택
칩 모델 확인I2C 0x40-0x4f 주소 확인모델별 접두사 선택ina2xx 공통 드라이버 probe칩별 추가 기능 활성화

버스 주소와 호환 모델로 공통 드라이버 변형을 결정합니다.

Kernel driver ina2xx
====================

Supported chips:

  * Texas Instruments INA219


    Prefix: 'ina219'
    Addresses: I2C 0x40 - 0x4f

    Datasheet: Publicly available at the Texas Instruments website

               https://www.ti.com/

  * Texas Instruments INA220

    Prefix: 'ina220'

    Addresses: I2C 0x40 - 0x4f

    Datasheet: Publicly available at the Texas Instruments website

               https://www.ti.com/

  * Texas Instruments INA226

    Prefix: 'ina226'

    Addresses: I2C 0x40 - 0x4f

    Datasheet: Publicly available at the Texas Instruments website

               https://www.ti.com/

  * Texas Instruments INA230

    Prefix: 'ina230'

    Addresses: I2C 0x40 - 0x4f

    Datasheet: Publicly available at the Texas Instruments website

               https://www.ti.com/

  * Texas Instruments INA231

    Prefix: 'ina231'

    Addresses: I2C 0x40 - 0x4f

    Datasheet: Publicly available at the Texas Instruments website

               https://www.ti.com/

  * Texas Instruments INA260

    Prefix: 'ina260'

    Addresses: I2C 0x40 - 0x4f

    Datasheet: Publicly available at the Texas Instruments website

               https://www.ti.com/

  * Silergy SY24655

    Prefix: 'sy24655'

    Addresses: I2C 0x40 - 0x4f

    Datasheet: Publicly available at the Silergy website

               https://us1.silergy.com/


Author: Lothar Felten <lothar.felten@gmail.com>

계열별 측정 기능과 shunt 설정

79-115

INA219는 I2C 기반 high-side 전류 shunt·전력 모니터이며 shunt 전압 강하와 전원 전압을 감시하고 변환 시간과 필터링을 프로그래밍할 수 있습니다. INA220은 high-side 또는 low-side에서 shunt 강하와 전원 전압을 감시합니다.

INA226은 I2C 전류 shunt·전력 모니터로 shunt 전압 강하와 bus 전원 전압을 감시합니다. INA230과 INA231도 high-side 또는 low-side에서 같은 두 전압을 감시합니다. INA260은 shunt 저항을 내장한 high-side 또는 low-side 전류·전력 모니터입니다.

SY24655는 I2C 기반 high-side·low-side 전류 shunt·전력 모니터입니다. Shunt 강하와 전원 전압을 지원하고 보정값과 변환 시간을 프로그래밍할 수 있으며, 에너지 변환에 사용할 평균 전력도 계산합니다.

Micro-ohms 단위 shunt 값은 컴파일 시 플랫폼 데이터나 장치 트리로 설정하거나, 실행 중 sysfs의 `shunt_resistor` 속성으로 설정할 수 있습니다. 장치 트리 binding은 `Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml`에 있습니다.

INA226은 `Documentation/hwmon/sysfs-interface.rst`의 `update_interval`도 지원합니다. 내부 interval은 bus 전압 변환 시간과 shunt 전압 변환 시간의 합에 평균 횟수를 곱한 값입니다. 드라이버는 변환 시간은 건드리지 않고 평균 횟수만 바꿉니다. 범위는 2ms부터 2253ms이며 실제 설정값은 요청값과 다를 수 있습니다.

계열별 특징
특징
INA219High-side, 변환 시간·필터링 설정
INA220High/low-side shunt·전원 전압
INA226Shunt·bus 전압, update_interval
INA230 / INA231High/low-side shunt·bus 전압
INA260Shunt 저항 내장
SY24655보정·변환 시간 설정, 평균 전력 계산

측정 위치, 내장 shunt, 추가 기능을 비교했습니다.

Shunt와 갱신 간격 설정
플랫폼·DT 또는 sysfs에서 shunt 값 설정Bus·shunt 변환 시간 유지평균 횟수 선택2-2253ms update_interval 근사전류·전력 계산

저항값과 평균 횟수가 전류·전력 및 갱신 주기를 결정합니다.

Description
-----------

The INA219 is a high-side current shunt and power monitor with an I2C
interface. The INA219 monitors both shunt drop and supply voltage, with
programmable conversion times and filtering.

The INA220 is a high or low side current shunt and power monitor with an I2C
interface. The INA220 monitors both shunt drop and supply voltage.

The INA226 is a current shunt and power monitor with an I2C interface.
The INA226 monitors both a shunt voltage drop and bus supply voltage.

INA230 and INA231 are high or low side current shunt and power monitors
with an I2C interface. The chips monitor both a shunt voltage drop and
bus supply voltage.

INA260 is a high or low side current and power monitor with integrated shunt
resistor.

The SY24655 is a high- and low-side current shunt and power monitor with an I2C
interface. The SY24655 supports both shunt drop and supply voltage, with
programmable calibration value and conversion times. The SY24655 can also
calculate average power for use in energy conversion.

The shunt value in micro-ohms can be set via platform data or device tree at
compile-time or via the shunt_resistor attribute in sysfs at run-time. Please
refer to the Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings
if the device tree is used.

Additionally ina226 supports update_interval attribute as described in
Documentation/hwmon/sysfs-interface.rst. Internally the interval is the sum of
bus and shunt voltage conversion times multiplied by the averaging rate. We
don't touch the conversion times and only modify the number of averages. The
lower limit of the update_interval is 2 ms, the upper limit is 2253 ms.
The actual programmed interval may vary from the desired value.

공통·추가 sysfs 속성

116-147

모든 지원 칩의 공통 속성은 mV 단위 shunt 전압 `in0_input`, mV 단위 bus 전압 `in1_input`, mA 단위 전류 `curr1_input`, uW 단위 전력 `power1_input`입니다. `shunt_resistor`는 uOhm 단위 shunt 저항이며 shunt가 내장된 INA260에서는 제공하지 않습니다.

INA226, INA230, INA231, INA260, SY24655에는 임계 하한·상한 전류와 경보, 임계 하한·상한 shunt 전압과 경보, 임계 하한·상한 bus 전압과 경보, 임계 상한 전력과 경보가 추가됩니다. `update_interval`은 shunt와 bus 전압 결과를 평균하는 샘플 수에 영향을 주는 데이터 변환 시간입니다.

INA2xx sysfs
범위속성의미
공통in0_input / in1_inputShunt·bus 전압, mV
공통curr1_input / power1_input전류 mA·전력 uW
공통shunt_resistorShunt 저항 uOhm, INA260 제외
추가curr1_lcrit / curr1_crit / *_alarm전류 임계 하한·상한과 경보
추가in0_lcrit / in0_crit / *_alarmShunt 전압 임계 하한·상한과 경보
추가in1_lcrit / in1_crit / *_alarmBus 전압 임계 하한·상한과 경보
추가power1_crit / power1_crit_alarm전력 임계 상한과 경보
추가update_interval변환 시간과 평균 샘플 수

공통 속성과 일부 변형의 임계 경보 속성을 분리했습니다.

공통 측정과 임계 경보
Shunt·bus 전압 읽기Shunt 저항으로 전류 계산전력 계산지원 변형에서 임계값 비교경보와 update_interval 게시

기본 네 측정값 위에 지원 칩의 임계 기능을 추가합니다.

General sysfs entries
---------------------

======================= ===============================================
in0_input                Shunt voltage(mV) channel
in1_input                Bus voltage(mV) channel
curr1_input                Current(mA) measurement channel
power1_input                Power(uW) measurement channel
shunt_resistor                Shunt resistance(uOhm) channel (not for ina260)
======================= ===============================================

Additional sysfs entries for ina226, ina230, ina231, ina260, and sy24655
------------------------------------------------------------------------

======================= ====================================================
curr1_lcrit                Critical low current
curr1_crit                Critical high current
curr1_lcrit_alarm        Current critical low alarm
curr1_crit_alarm        Current critical high alarm
in0_lcrit                Critical low shunt voltage
in0_crit                Critical high shunt voltage
in0_lcrit_alarm                Shunt voltage critical low alarm
in0_crit_alarm                Shunt voltage critical high alarm
in1_lcrit                Critical low bus voltage
in1_crit                Critical high bus voltage
in1_lcrit_alarm                Bus voltage critical low alarm
in1_crit_alarm                Bus voltage critical high alarm
power1_crit                Critical high power
power1_crit_alarm        Power critical high alarm
update_interval                data conversion time; affects number of samples used
                        to average results for shunt and bus voltages.
======================= ====================================================

SY24655 평균 전력과 임계 설정 제약

148-163

SY24655 전용 `power1_average`는 직전 읽기 시점부터 현재까지의 평균 전력을 제공합니다.

`power1_crit`는 설정된 `shunt_resistor`를 바탕으로 계산되므로 `power1_crit`보다 먼저 `shunt_resistor`를 구성해야 합니다.

하위 레지스터 구현 제약 때문에 한 번에 하나의 `*crit` 설정과 그 경보만 활성화할 수 있습니다. 하나의 `*crit`에 값을 쓰면 다른 모든 `*crit` 설정과 경보가 지워지고, 어느 `*crit`에든 0을 쓰면 모든 임계 설정과 경보가 지워집니다.

SY24655 제약
항목동작
power1_average직전 읽기부터 현재까지 평균 전력
설정 순서shunt_resistor 후 power1_crit
활성 임계값한 번에 하나의 *crit만 가능
다른 *crit 쓰기기존 임계 설정과 경보 삭제
*crit에 0 쓰기모든 임계 설정과 경보 삭제

평균 전력과 상호 배타적 임계 레지스터 동작입니다.

SY24655 임계값 갱신
shunt_resistor 설정사용할 *crit 선택임계값 기록다른 임계 설정 자동 삭제0 기록 시 전체 임계·경보 초기화

저항값을 먼저 확정하고 하나의 임계 경보만 활성화합니다.


Sysfs entries for sy24655 only
------------------------------

======================= ====================================================
power1_average                average power from last reading to the present.
======================= ====================================================

.. note::

   - Configure `shunt_resistor` before configure `power1_crit`, because power
     value is calculated based on `shunt_resistor` set.
   - Because of the underlying register implementation, only one `*crit` setting
     and its `alarm` can be active. Writing to one `*crit` setting clears other
     `*crit` settings and alarms. Writing 0 to any `*crit` setting clears all
     `*crit` settings and alarms.