xref: /linux/Documentation/hwmon/ina2xx.rst (revision fbf5df34a4dbcd09d433dd4f0916bf9b2ddb16de)
1Kernel driver ina2xx
2====================
3
4Supported 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  * Texas Instruments INA234
78
79    Prefix: 'ina234'
80
81    Addresses: I2C 0x40 - 0x43
82
83    Datasheet: Publicly available at the Texas Instruments website
84
85	       https://www.ti.com/
86
87Author: Lothar Felten <lothar.felten@gmail.com>
88
89Description
90-----------
91
92The INA219 is a high-side current shunt and power monitor with an I2C
93interface. The INA219 monitors both shunt drop and supply voltage, with
94programmable conversion times and filtering.
95
96The INA220 is a high or low side current shunt and power monitor with an I2C
97interface. The INA220 monitors both shunt drop and supply voltage.
98
99The INA226 is a current shunt and power monitor with an I2C interface.
100The INA226 monitors both a shunt voltage drop and bus supply voltage.
101
102INA230, INA231, and INA234 are high or low side current shunt and power monitors
103with an I2C interface. The chips monitor both a shunt voltage drop and
104bus supply voltage.
105
106INA260 is a high or low side current and power monitor with integrated shunt
107resistor.
108
109The SY24655 is a high- and low-side current shunt and power monitor with an I2C
110interface. The SY24655 supports both shunt drop and supply voltage, with
111programmable calibration value and conversion times. The SY24655 can also
112calculate average power for use in energy conversion.
113
114The shunt value in micro-ohms can be set via platform data or device tree at
115compile-time or via the shunt_resistor attribute in sysfs at run-time. Please
116refer to the Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings
117if the device tree is used.
118
119Additionally ina226 supports update_interval attribute as described in
120Documentation/hwmon/sysfs-interface.rst. Internally the interval is the sum of
121bus and shunt voltage conversion times multiplied by the averaging rate. We
122don't touch the conversion times and only modify the number of averages. The
123lower limit of the update_interval is 2 ms, the upper limit is 2253 ms.
124The actual programmed interval may vary from the desired value.
125
126General sysfs entries
127---------------------
128
129======================= ===============================================
130in0_input		Shunt voltage(mV) channel
131in1_input		Bus voltage(mV) channel
132curr1_input		Current(mA) measurement channel
133power1_input		Power(uW) measurement channel
134shunt_resistor		Shunt resistance(uOhm) channel (not for ina260)
135======================= ===============================================
136
137Additional sysfs entries
138------------------------
139
140Additional entries are available for the following chips:
141
142  * ina226
143  * ina230
144  * ina231
145  * ina234
146  * ina260
147  * sy24655
148
149======================= ====================================================
150curr1_lcrit		Critical low current
151curr1_crit		Critical high current
152curr1_lcrit_alarm	Current critical low alarm
153curr1_crit_alarm	Current critical high alarm
154in0_lcrit		Critical low shunt voltage
155in0_crit		Critical high shunt voltage
156in0_lcrit_alarm		Shunt voltage critical low alarm
157in0_crit_alarm		Shunt voltage critical high alarm
158in1_lcrit		Critical low bus voltage
159in1_crit		Critical high bus voltage
160in1_lcrit_alarm		Bus voltage critical low alarm
161in1_crit_alarm		Bus voltage critical high alarm
162power1_crit		Critical high power
163power1_crit_alarm	Power critical high alarm
164update_interval		data conversion time; affects number of samples used
165			to average results for shunt and bus voltages.
166======================= ====================================================
167
168Sysfs entries for sy24655 only
169------------------------------
170
171======================= ====================================================
172power1_average		average power from last reading to the present.
173======================= ====================================================
174
175.. note::
176
177   - Configure `shunt_resistor` before configure `power1_crit`, because power
178     value is calculated based on `shunt_resistor` set.
179   - Because of the underlying register implementation, only one `*crit` setting
180     and its `alarm` can be active. Writing to one `*crit` setting clears other
181     `*crit` settings and alarms. Writing 0 to any `*crit` setting clears all
182     `*crit` settings and alarms.
183