ina2xx.rst 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. Kernel driver ina2xx
  2. ====================
  3. Supported chips:
  4. * Texas Instruments INA219
  5. Prefix: 'ina219'
  6. Addresses: I2C 0x40 - 0x4f
  7. Datasheet: Publicly available at the Texas Instruments website
  8. https://www.ti.com/
  9. * Texas Instruments INA220
  10. Prefix: 'ina220'
  11. Addresses: I2C 0x40 - 0x4f
  12. Datasheet: Publicly available at the Texas Instruments website
  13. https://www.ti.com/
  14. * Texas Instruments INA226
  15. Prefix: 'ina226'
  16. Addresses: I2C 0x40 - 0x4f
  17. Datasheet: Publicly available at the Texas Instruments website
  18. https://www.ti.com/
  19. * Texas Instruments INA230
  20. Prefix: 'ina230'
  21. Addresses: I2C 0x40 - 0x4f
  22. Datasheet: Publicly available at the Texas Instruments website
  23. https://www.ti.com/
  24. * Texas Instruments INA231
  25. Prefix: 'ina231'
  26. Addresses: I2C 0x40 - 0x4f
  27. Datasheet: Publicly available at the Texas Instruments website
  28. https://www.ti.com/
  29. Author: Lothar Felten <[email protected]>
  30. Description
  31. -----------
  32. The INA219 is a high-side current shunt and power monitor with an I2C
  33. interface. The INA219 monitors both shunt drop and supply voltage, with
  34. programmable conversion times and filtering.
  35. The INA220 is a high or low side current shunt and power monitor with an I2C
  36. interface. The INA220 monitors both shunt drop and supply voltage.
  37. The INA226 is a current shunt and power monitor with an I2C interface.
  38. The INA226 monitors both a shunt voltage drop and bus supply voltage.
  39. INA230 and INA231 are high or low side current shunt and power monitors
  40. with an I2C interface. The chips monitor both a shunt voltage drop and
  41. bus supply voltage.
  42. The shunt value in micro-ohms can be set via platform data or device tree at
  43. compile-time or via the shunt_resistor attribute in sysfs at run-time. Please
  44. refer to the Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings
  45. if the device tree is used.
  46. Additionally ina226 supports update_interval attribute as described in
  47. Documentation/hwmon/sysfs-interface.rst. Internally the interval is the sum of
  48. bus and shunt voltage conversion times multiplied by the averaging rate. We
  49. don't touch the conversion times and only modify the number of averages. The
  50. lower limit of the update_interval is 2 ms, the upper limit is 2253 ms.
  51. The actual programmed interval may vary from the desired value.
  52. General sysfs entries
  53. ---------------------
  54. ======================= ===============================
  55. in0_input Shunt voltage(mV) channel
  56. in1_input Bus voltage(mV) channel
  57. curr1_input Current(mA) measurement channel
  58. power1_input Power(uW) measurement channel
  59. shunt_resistor Shunt resistance(uOhm) channel
  60. ======================= ===============================
  61. Sysfs entries for ina226, ina230 and ina231 only
  62. ------------------------------------------------
  63. ======================= ====================================================
  64. in0_lcrit Critical low shunt voltage
  65. in0_crit Critical high shunt voltage
  66. in0_lcrit_alarm Shunt voltage critical low alarm
  67. in0_crit_alarm Shunt voltage critical high alarm
  68. in1_lcrit Critical low bus voltage
  69. in1_crit Critical high bus voltage
  70. in1_lcrit_alarm Bus voltage critical low alarm
  71. in1_crit_alarm Bus voltage critical high alarm
  72. power1_crit Critical high power
  73. power1_crit_alarm Power critical high alarm
  74. update_interval data conversion time; affects number of samples used
  75. to average results for shunt and bus voltages.
  76. ======================= ====================================================
  77. .. note::
  78. - Configure `shunt_resistor` before configure `power1_crit`, because power
  79. value is calculated based on `shunt_resistor` set.
  80. - Because of the underlying register implementation, only one `*crit` setting
  81. and its `alarm` can be active. Writing to one `*crit` setting clears other
  82. `*crit` settings and alarms. Writing 0 to any `*crit` setting clears all
  83. `*crit` settings and alarms.