blob: 27d2e39bc8ac71d585cd0c73898a1b61f34cb3ba [file] [log] [blame]
Felten, Lotharf7c2fe32012-05-12 04:36:38 -04001Kernel driver ina2xx
2====================
3
4Supported chips:
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -03005
Felten, Lotharf7c2fe32012-05-12 04:36:38 -04006 * Texas Instruments INA219
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -03007
8
Felten, Lotharf7c2fe32012-05-12 04:36:38 -04009 Prefix: 'ina219'
10 Addresses: I2C 0x40 - 0x4f
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030011
Felten, Lotharf7c2fe32012-05-12 04:36:38 -040012 Datasheet: Publicly available at the Texas Instruments website
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030013
Alexander A. Klimov49dc2fb2020-07-19 20:15:30 +020014 https://www.ti.com/
Felten, Lotharf7c2fe32012-05-12 04:36:38 -040015
Guenter Roeckdc92cd02012-05-12 11:33:11 -070016 * Texas Instruments INA220
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030017
Guenter Roeckdc92cd02012-05-12 11:33:11 -070018 Prefix: 'ina220'
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030019
Guenter Roeckdc92cd02012-05-12 11:33:11 -070020 Addresses: I2C 0x40 - 0x4f
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030021
Guenter Roeckdc92cd02012-05-12 11:33:11 -070022 Datasheet: Publicly available at the Texas Instruments website
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030023
Alexander A. Klimov49dc2fb2020-07-19 20:15:30 +020024 https://www.ti.com/
Guenter Roeckdc92cd02012-05-12 11:33:11 -070025
Felten, Lotharf7c2fe32012-05-12 04:36:38 -040026 * Texas Instruments INA226
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030027
Felten, Lotharf7c2fe32012-05-12 04:36:38 -040028 Prefix: 'ina226'
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030029
Felten, Lotharf7c2fe32012-05-12 04:36:38 -040030 Addresses: I2C 0x40 - 0x4f
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030031
Felten, Lotharf7c2fe32012-05-12 04:36:38 -040032 Datasheet: Publicly available at the Texas Instruments website
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030033
Alexander A. Klimov49dc2fb2020-07-19 20:15:30 +020034 https://www.ti.com/
Felten, Lotharf7c2fe32012-05-12 04:36:38 -040035
Guenter Roeckdc92cd02012-05-12 11:33:11 -070036 * Texas Instruments INA230
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030037
Guenter Roeckdc92cd02012-05-12 11:33:11 -070038 Prefix: 'ina230'
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030039
Guenter Roeckdc92cd02012-05-12 11:33:11 -070040 Addresses: I2C 0x40 - 0x4f
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030041
Guenter Roeckdc92cd02012-05-12 11:33:11 -070042 Datasheet: Publicly available at the Texas Instruments website
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030043
Alexander A. Klimov49dc2fb2020-07-19 20:15:30 +020044 https://www.ti.com/
Guenter Roeckdc92cd02012-05-12 11:33:11 -070045
Kevin Hilmanadd513b2015-01-14 17:34:58 -080046 * Texas Instruments INA231
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030047
Kevin Hilmanadd513b2015-01-14 17:34:58 -080048 Prefix: 'ina231'
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030049
Kevin Hilmanadd513b2015-01-14 17:34:58 -080050 Addresses: I2C 0x40 - 0x4f
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030051
Kevin Hilmanadd513b2015-01-14 17:34:58 -080052 Datasheet: Publicly available at the Texas Instruments website
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030053
Alexander A. Klimov49dc2fb2020-07-19 20:15:30 +020054 https://www.ti.com/
Kevin Hilmanadd513b2015-01-14 17:34:58 -080055
Lothar Felten3ad86702018-08-14 09:09:37 +020056Author: Lothar Felten <lothar.felten@gmail.com>
Felten, Lotharf7c2fe32012-05-12 04:36:38 -040057
58Description
59-----------
60
61The INA219 is a high-side current shunt and power monitor with an I2C
62interface. The INA219 monitors both shunt drop and supply voltage, with
63programmable conversion times and filtering.
64
Guenter Roeckdc92cd02012-05-12 11:33:11 -070065The INA220 is a high or low side current shunt and power monitor with an I2C
66interface. The INA220 monitors both shunt drop and supply voltage.
67
Felten, Lotharf7c2fe32012-05-12 04:36:38 -040068The INA226 is a current shunt and power monitor with an I2C interface.
69The INA226 monitors both a shunt voltage drop and bus supply voltage.
70
Kevin Hilmanadd513b2015-01-14 17:34:58 -080071INA230 and INA231 are high or low side current shunt and power monitors
72with an I2C interface. The chips monitor both a shunt voltage drop and
73bus supply voltage.
Guenter Roeckdc92cd02012-05-12 11:33:11 -070074
Bartosz Golaszewski8a5fc792015-01-05 15:20:55 +010075The shunt value in micro-ohms can be set via platform data or device tree at
76compile-time or via the shunt_resistor attribute in sysfs at run-time. Please
Mauro Carvalho Chehabf6aed682021-01-13 11:59:17 +010077refer to the Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings
Tang Yuantian31e7ad72013-06-19 14:50:20 +080078if the device tree is used.
Bartosz Golaszewski72a87a42015-01-09 17:03:42 +010079
80Additionally ina226 supports update_interval attribute as described in
Mauro Carvalho Chehab7ebd8b662019-04-17 06:46:29 -030081Documentation/hwmon/sysfs-interface.rst. Internally the interval is the sum of
Bartosz Golaszewski72a87a42015-01-09 17:03:42 +010082bus and shunt voltage conversion times multiplied by the averaging rate. We
83don't touch the conversion times and only modify the number of averages. The
84lower limit of the update_interval is 2 ms, the upper limit is 2253 ms.
85The actual programmed interval may vary from the desired value.
Nicolin Chen9a629d72018-11-19 12:31:16 -080086
87General sysfs entries
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030088---------------------
Nicolin Chen9a629d72018-11-19 12:31:16 -080089
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030090======================= ===============================
Nicolin Chen9a629d72018-11-19 12:31:16 -080091in0_input Shunt voltage(mV) channel
92in1_input Bus voltage(mV) channel
93curr1_input Current(mA) measurement channel
94power1_input Power(uW) measurement channel
95shunt_resistor Shunt resistance(uOhm) channel
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030096======================= ===============================
Nicolin Chen9a629d72018-11-19 12:31:16 -080097
98Sysfs entries for ina226, ina230 and ina231 only
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -030099------------------------------------------------
Nicolin Chen9a629d72018-11-19 12:31:16 -0800100
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -0300101======================= ====================================================
Alex Qiu5a56a392020-05-04 17:59:45 -0700102in0_lcrit Critical low shunt voltage
103in0_crit Critical high shunt voltage
104in0_lcrit_alarm Shunt voltage critical low alarm
105in0_crit_alarm Shunt voltage critical high alarm
106in1_lcrit Critical low bus voltage
107in1_crit Critical high bus voltage
108in1_lcrit_alarm Bus voltage critical low alarm
109in1_crit_alarm Bus voltage critical high alarm
110power1_crit Critical high power
111power1_crit_alarm Power critical high alarm
Nicolin Chen9a629d72018-11-19 12:31:16 -0800112update_interval data conversion time; affects number of samples used
113 to average results for shunt and bus voltages.
Mauro Carvalho Chehabb32570a2019-04-17 06:46:27 -0300114======================= ====================================================
Alex Qiu5a56a392020-05-04 17:59:45 -0700115
116.. note::
117
118 - Configure `shunt_resistor` before configure `power1_crit`, because power
119 value is calculated based on `shunt_resistor` set.
120 - Because of the underlying register implementation, only one `*crit` setting
121 and its `alarm` can be active. Writing to one `*crit` setting clears other
122 `*crit` settings and alarms. Writing 0 to any `*crit` setting clears all
123 `*crit` settings and alarms.