Back to home page

OSCL-LXR

 
 

    


0001 Kernel driver ina2xx
0002 ====================
0003 
0004 Supported chips:
0005 
0006   * Texas Instruments INA219
0007 
0008 
0009     Prefix: 'ina219'
0010     Addresses: I2C 0x40 - 0x4f
0011 
0012     Datasheet: Publicly available at the Texas Instruments website
0013 
0014                https://www.ti.com/
0015 
0016   * Texas Instruments INA220
0017 
0018     Prefix: 'ina220'
0019 
0020     Addresses: I2C 0x40 - 0x4f
0021 
0022     Datasheet: Publicly available at the Texas Instruments website
0023 
0024                https://www.ti.com/
0025 
0026   * Texas Instruments INA226
0027 
0028     Prefix: 'ina226'
0029 
0030     Addresses: I2C 0x40 - 0x4f
0031 
0032     Datasheet: Publicly available at the Texas Instruments website
0033 
0034                https://www.ti.com/
0035 
0036   * Texas Instruments INA230
0037 
0038     Prefix: 'ina230'
0039 
0040     Addresses: I2C 0x40 - 0x4f
0041 
0042     Datasheet: Publicly available at the Texas Instruments website
0043 
0044                https://www.ti.com/
0045 
0046   * Texas Instruments INA231
0047 
0048     Prefix: 'ina231'
0049 
0050     Addresses: I2C 0x40 - 0x4f
0051 
0052     Datasheet: Publicly available at the Texas Instruments website
0053 
0054                https://www.ti.com/
0055 
0056 Author: Lothar Felten <lothar.felten@gmail.com>
0057 
0058 Description
0059 -----------
0060 
0061 The INA219 is a high-side current shunt and power monitor with an I2C
0062 interface. The INA219 monitors both shunt drop and supply voltage, with
0063 programmable conversion times and filtering.
0064 
0065 The INA220 is a high or low side current shunt and power monitor with an I2C
0066 interface. The INA220 monitors both shunt drop and supply voltage.
0067 
0068 The INA226 is a current shunt and power monitor with an I2C interface.
0069 The INA226 monitors both a shunt voltage drop and bus supply voltage.
0070 
0071 INA230 and INA231 are high or low side current shunt and power monitors
0072 with an I2C interface. The chips monitor both a shunt voltage drop and
0073 bus supply voltage.
0074 
0075 The shunt value in micro-ohms can be set via platform data or device tree at
0076 compile-time or via the shunt_resistor attribute in sysfs at run-time. Please
0077 refer to the Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings
0078 if the device tree is used.
0079 
0080 Additionally ina226 supports update_interval attribute as described in
0081 Documentation/hwmon/sysfs-interface.rst. Internally the interval is the sum of
0082 bus and shunt voltage conversion times multiplied by the averaging rate. We
0083 don't touch the conversion times and only modify the number of averages. The
0084 lower limit of the update_interval is 2 ms, the upper limit is 2253 ms.
0085 The actual programmed interval may vary from the desired value.
0086 
0087 General sysfs entries
0088 ---------------------
0089 
0090 ======================= ===============================
0091 in0_input               Shunt voltage(mV) channel
0092 in1_input               Bus voltage(mV) channel
0093 curr1_input             Current(mA) measurement channel
0094 power1_input            Power(uW) measurement channel
0095 shunt_resistor          Shunt resistance(uOhm) channel
0096 ======================= ===============================
0097 
0098 Sysfs entries for ina226, ina230 and ina231 only
0099 ------------------------------------------------
0100 
0101 ======================= ====================================================
0102 in0_lcrit               Critical low shunt voltage
0103 in0_crit                Critical high shunt voltage
0104 in0_lcrit_alarm         Shunt voltage critical low alarm
0105 in0_crit_alarm          Shunt voltage critical high alarm
0106 in1_lcrit               Critical low bus voltage
0107 in1_crit                Critical high bus voltage
0108 in1_lcrit_alarm         Bus voltage critical low alarm
0109 in1_crit_alarm          Bus voltage critical high alarm
0110 power1_crit             Critical high power
0111 power1_crit_alarm       Power critical high alarm
0112 update_interval         data conversion time; affects number of samples used
0113                         to average results for shunt and bus voltages.
0114 ======================= ====================================================
0115 
0116 .. note::
0117 
0118    - Configure `shunt_resistor` before configure `power1_crit`, because power
0119      value is calculated based on `shunt_resistor` set.
0120    - Because of the underlying register implementation, only one `*crit` setting
0121      and its `alarm` can be active. Writing to one `*crit` setting clears other
0122      `*crit` settings and alarms. Writing 0 to any `*crit` setting clears all
0123      `*crit` settings and alarms.