pmbus 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. Kernel driver pmbus
  2. ====================
  3. Supported chips:
  4. * Ericsson BMR45X series
  5. DC/DC Converter
  6. Prefixes: 'bmr450', 'bmr451', 'bmr453', 'bmr454'
  7. Addresses scanned: -
  8. Datasheet:
  9. http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146395
  10. * Linear Technology LTC2978
  11. Octal PMBus Power Supply Monitor and Controller
  12. Prefix: 'ltc2978'
  13. Addresses scanned: -
  14. Datasheet: http://cds.linear.com/docs/Datasheet/2978fa.pdf
  15. * Maxim MAX16064
  16. Quad Power-Supply Controller
  17. Prefix: 'max16064'
  18. Addresses scanned: -
  19. Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX16064.pdf
  20. * Maxim MAX34440
  21. PMBus 6-Channel Power-Supply Manager
  22. Prefixes: 'max34440'
  23. Addresses scanned: -
  24. Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX34440.pdf
  25. * Maxim MAX34441
  26. PMBus 5-Channel Power-Supply Manager and Intelligent Fan Controller
  27. Prefixes: 'max34441'
  28. Addresses scanned: -
  29. Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX34441.pdf
  30. * Maxim MAX8688
  31. Digital Power-Supply Controller/Monitor
  32. Prefix: 'max8688'
  33. Addresses scanned: -
  34. Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX8688.pdf
  35. * Generic PMBus devices
  36. Prefix: 'pmbus'
  37. Addresses scanned: -
  38. Datasheet: n.a.
  39. Author: Guenter Roeck <guenter.roeck@ericsson.com>
  40. Description
  41. -----------
  42. This driver supports hardware montoring for various PMBus compliant devices.
  43. It supports voltage, current, power, and temperature sensors as supported
  44. by the device.
  45. Each monitored channel has its own high and low limits, plus a critical
  46. limit.
  47. Fan support will be added in a later version of this driver.
  48. Usage Notes
  49. -----------
  50. This driver does not probe for PMBus devices, since there is no register
  51. which can be safely used to identify the chip (The MFG_ID register is not
  52. supported by all chips), and since there is no well defined address range for
  53. PMBus devices. You will have to instantiate the devices explicitly.
  54. Example: the following will load the driver for an LTC2978 at address 0x60
  55. on I2C bus #1:
  56. $ modprobe pmbus
  57. $ echo ltc2978 0x60 > /sys/bus/i2c/devices/i2c-1/new_device
  58. Platform data support
  59. ---------------------
  60. Support for additional PMBus chips can be added by defining chip parameters in
  61. a new chip specific driver file. For example, (untested) code to add support for
  62. Emerson DS1200 power modules might look as follows.
  63. static struct pmbus_driver_info ds1200_info = {
  64. .pages = 1,
  65. /* Note: All other sensors are in linear mode */
  66. .direct[PSC_VOLTAGE_OUT] = true,
  67. .direct[PSC_TEMPERATURE] = true,
  68. .direct[PSC_CURRENT_OUT] = true,
  69. .m[PSC_VOLTAGE_IN] = 1,
  70. .b[PSC_VOLTAGE_IN] = 0,
  71. .R[PSC_VOLTAGE_IN] = 3,
  72. .m[PSC_VOLTAGE_OUT] = 1,
  73. .b[PSC_VOLTAGE_OUT] = 0,
  74. .R[PSC_VOLTAGE_OUT] = 3,
  75. .m[PSC_TEMPERATURE] = 1,
  76. .b[PSC_TEMPERATURE] = 0,
  77. .R[PSC_TEMPERATURE] = 3,
  78. .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | PMBUS_HAVE_STATUS_INPUT
  79. | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
  80. | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
  81. | PMBUS_HAVE_PIN | PMBUS_HAVE_POUT
  82. | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP
  83. | PMBUS_HAVE_FAN12 | PMBUS_HAVE_STATUS_FAN12,
  84. };
  85. static int ds1200_probe(struct i2c_client *client,
  86. const struct i2c_device_id *id)
  87. {
  88. return pmbus_do_probe(client, id, &ds1200_info);
  89. }
  90. static int ds1200_remove(struct i2c_client *client)
  91. {
  92. return pmbus_do_remove(client);
  93. }
  94. static const struct i2c_device_id ds1200_id[] = {
  95. {"ds1200", 0},
  96. {}
  97. };
  98. MODULE_DEVICE_TABLE(i2c, ds1200_id);
  99. /* This is the driver that will be inserted */
  100. static struct i2c_driver ds1200_driver = {
  101. .driver = {
  102. .name = "ds1200",
  103. },
  104. .probe = ds1200_probe,
  105. .remove = ds1200_remove,
  106. .id_table = ds1200_id,
  107. };
  108. static int __init ds1200_init(void)
  109. {
  110. return i2c_add_driver(&ds1200_driver);
  111. }
  112. static void __exit ds1200_exit(void)
  113. {
  114. i2c_del_driver(&ds1200_driver);
  115. }
  116. Sysfs entries
  117. -------------
  118. When probing the chip, the driver identifies which PMBus registers are
  119. supported, and determines available sensors from this information.
  120. Attribute files only exist if respective sensors are suported by the chip.
  121. Labels are provided to inform the user about the sensor associated with
  122. a given sysfs entry.
  123. The following attributes are supported. Limits are read-write; all other
  124. attributes are read-only.
  125. inX_input Measured voltage. From READ_VIN or READ_VOUT register.
  126. inX_min Minumum Voltage.
  127. From VIN_UV_WARN_LIMIT or VOUT_UV_WARN_LIMIT register.
  128. inX_max Maximum voltage.
  129. From VIN_OV_WARN_LIMIT or VOUT_OV_WARN_LIMIT register.
  130. inX_lcrit Critical minumum Voltage.
  131. From VIN_UV_FAULT_LIMIT or VOUT_UV_FAULT_LIMIT register.
  132. inX_crit Critical maximum voltage.
  133. From VIN_OV_FAULT_LIMIT or VOUT_OV_FAULT_LIMIT register.
  134. inX_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status.
  135. inX_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status.
  136. inX_lcrit_alarm Voltage critical low alarm.
  137. From VOLTAGE_UV_FAULT status.
  138. inX_crit_alarm Voltage critical high alarm.
  139. From VOLTAGE_OV_FAULT status.
  140. inX_label "vin", "vcap", or "voutY"
  141. currX_input Measured current. From READ_IIN or READ_IOUT register.
  142. currX_max Maximum current.
  143. From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT register.
  144. currX_lcrit Critical minumum output current.
  145. From IOUT_UC_FAULT_LIMIT register.
  146. currX_crit Critical maximum current.
  147. From IIN_OC_FAULT_LIMIT or IOUT_OC_FAULT_LIMIT register.
  148. currX_alarm Current high alarm.
  149. From IIN_OC_WARNING or IOUT_OC_WARNING status.
  150. currX_lcrit_alarm Output current critical low alarm.
  151. From IOUT_UC_FAULT status.
  152. currX_crit_alarm Current critical high alarm.
  153. From IIN_OC_FAULT or IOUT_OC_FAULT status.
  154. currX_label "iin" or "vinY"
  155. powerX_input Measured power. From READ_PIN or READ_POUT register.
  156. powerX_cap Output power cap. From POUT_MAX register.
  157. powerX_max Power limit. From PIN_OP_WARN_LIMIT or
  158. POUT_OP_WARN_LIMIT register.
  159. powerX_crit Critical output power limit.
  160. From POUT_OP_FAULT_LIMIT register.
  161. powerX_alarm Power high alarm.
  162. From PIN_OP_WARNING or POUT_OP_WARNING status.
  163. powerX_crit_alarm Output power critical high alarm.
  164. From POUT_OP_FAULT status.
  165. powerX_label "pin" or "poutY"
  166. tempX_input Measured tempererature.
  167. From READ_TEMPERATURE_X register.
  168. tempX_min Mimimum tempererature. From UT_WARN_LIMIT register.
  169. tempX_max Maximum tempererature. From OT_WARN_LIMIT register.
  170. tempX_lcrit Critical low tempererature.
  171. From UT_FAULT_LIMIT register.
  172. tempX_crit Critical high tempererature.
  173. From OT_FAULT_LIMIT register.
  174. tempX_min_alarm Chip temperature low alarm. Set by comparing
  175. READ_TEMPERATURE_X with UT_WARN_LIMIT if
  176. TEMP_UT_WARNING status is set.
  177. tempX_max_alarm Chip temperature high alarm. Set by comparing
  178. READ_TEMPERATURE_X with OT_WARN_LIMIT if
  179. TEMP_OT_WARNING status is set.
  180. tempX_lcrit_alarm Chip temperature critical low alarm. Set by comparing
  181. READ_TEMPERATURE_X with UT_FAULT_LIMIT if
  182. TEMP_UT_FAULT status is set.
  183. tempX_crit_alarm Chip temperature critical high alarm. Set by comparing
  184. READ_TEMPERATURE_X with OT_FAULT_LIMIT if
  185. TEMP_OT_FAULT status is set.