Merge tag 'drivers-5.10-2020-10-12' of git://git.kernel.dk/linux-block
[linux-2.6-block.git] / Documentation / hwmon / pmbus.rst
CommitLineData
44f5a408 1Kernel driver pmbus
1f234ff1 2===================
44f5a408
GR
3
4Supported chips:
1f234ff1 5
443830f6 6 * Ericsson BMR453, BMR454
1f234ff1 7
443830f6 8 Prefixes: 'bmr453', 'bmr454'
1f234ff1 9
44f5a408 10 Addresses scanned: -
1f234ff1 11
44f5a408 12 Datasheet:
1f234ff1 13
44f5a408 14 http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146395
1f234ff1 15
e0455e38 16 * ON Semiconductor ADP4000, NCP4200, NCP4208
1f234ff1 17
e0455e38 18 Prefixes: 'adp4000', 'ncp4200', 'ncp4208'
1f234ff1 19
e0455e38 20 Addresses scanned: -
1f234ff1 21
e0455e38 22 Datasheets:
1f234ff1 23
f12d634f 24 https://www.onsemi.com/pub_link/Collateral/ADP4000-D.PDF
1f234ff1 25
f12d634f 26 https://www.onsemi.com/pub_link/Collateral/NCP4200-D.PDF
1f234ff1 27
f12d634f 28 https://www.onsemi.com/pub_link/Collateral/JUNE%202009-%20REV.%200.PDF
1f234ff1 29
bc365a7f 30 * Lineage Power
1f234ff1 31
21633409 32 Prefixes: 'mdt040', 'pdt003', 'pdt006', 'pdt012', 'udt020'
1f234ff1 33
bc365a7f 34 Addresses scanned: -
1f234ff1 35
bc365a7f 36 Datasheets:
1f234ff1 37
bc365a7f 38 http://www.lineagepower.com/oem/pdf/PDT003A0X.pdf
1f234ff1 39
bc365a7f 40 http://www.lineagepower.com/oem/pdf/PDT006A0X.pdf
1f234ff1 41
bc365a7f 42 http://www.lineagepower.com/oem/pdf/PDT012A0X.pdf
1f234ff1 43
bc365a7f 44 http://www.lineagepower.com/oem/pdf/UDT020A0X.pdf
1f234ff1 45
21633409 46 http://www.lineagepower.com/oem/pdf/MDT040A0X.pdf
1f234ff1 47
cfca3789 48 * Texas Instruments TPS40400, TPS544B20, TPS544B25, TPS544C20, TPS544C25
1f234ff1 49
cfca3789 50 Prefixes: 'tps40400', 'tps544b20', 'tps544b25', 'tps544c20', 'tps544c25'
1f234ff1 51
c5f35c9d 52 Addresses scanned: -
1f234ff1 53
c5f35c9d 54 Datasheets:
1f234ff1 55
f12d634f 56 https://www.ti.com/lit/gpn/tps40400
1f234ff1 57
f12d634f 58 https://www.ti.com/lit/gpn/tps544b20
1f234ff1 59
f12d634f 60 https://www.ti.com/lit/gpn/tps544b25
1f234ff1 61
f12d634f 62 https://www.ti.com/lit/gpn/tps544c20
1f234ff1 63
f12d634f 64 https://www.ti.com/lit/gpn/tps544c25
1f234ff1 65
1a1ea120
GR
66 * Maxim MAX20796
67
68 Prefix: 'max20796'
69
70 Addresses scanned: -
71
72 Datasheet:
73
74 Not published
75
44f5a408 76 * Generic PMBus devices
1f234ff1 77
44f5a408 78 Prefix: 'pmbus'
1f234ff1 79
44f5a408 80 Addresses scanned: -
1f234ff1 81
44f5a408
GR
82 Datasheet: n.a.
83
1f234ff1 84
e3333e57 85Author: Guenter Roeck <linux@roeck-us.net>
44f5a408
GR
86
87
88Description
89-----------
90
92417dad 91This driver supports hardware monitoring for various PMBus compliant devices.
44f5a408
GR
92It supports voltage, current, power, and temperature sensors as supported
93by the device.
94
95Each monitored channel has its own high and low limits, plus a critical
96limit.
97
98Fan support will be added in a later version of this driver.
99
100
101Usage Notes
102-----------
103
104This driver does not probe for PMBus devices, since there is no register
105which can be safely used to identify the chip (The MFG_ID register is not
106supported by all chips), and since there is no well defined address range for
107PMBus devices. You will have to instantiate the devices explicitly.
108
109Example: the following will load the driver for an LTC2978 at address 0x60
1f234ff1
MCC
110on I2C bus #1::
111
112 $ modprobe pmbus
113 $ echo ltc2978 0x60 > /sys/bus/i2c/devices/i2c-1/new_device
44f5a408
GR
114
115
116Platform data support
117---------------------
118
119Support for additional PMBus chips can be added by defining chip parameters in
120a new chip specific driver file. For example, (untested) code to add support for
1f234ff1 121Emerson DS1200 power modules might look as follows::
44f5a408 122
1f234ff1 123 static struct pmbus_driver_info ds1200_info = {
44f5a408
GR
124 .pages = 1,
125 /* Note: All other sensors are in linear mode */
126 .direct[PSC_VOLTAGE_OUT] = true,
127 .direct[PSC_TEMPERATURE] = true,
128 .direct[PSC_CURRENT_OUT] = true,
129 .m[PSC_VOLTAGE_IN] = 1,
130 .b[PSC_VOLTAGE_IN] = 0,
131 .R[PSC_VOLTAGE_IN] = 3,
132 .m[PSC_VOLTAGE_OUT] = 1,
133 .b[PSC_VOLTAGE_OUT] = 0,
134 .R[PSC_VOLTAGE_OUT] = 3,
135 .m[PSC_TEMPERATURE] = 1,
136 .b[PSC_TEMPERATURE] = 0,
137 .R[PSC_TEMPERATURE] = 3,
138 .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | PMBUS_HAVE_STATUS_INPUT
139 | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
140 | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
141 | PMBUS_HAVE_PIN | PMBUS_HAVE_POUT
142 | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP
143 | PMBUS_HAVE_FAN12 | PMBUS_HAVE_STATUS_FAN12,
1f234ff1 144 };
44f5a408 145
dd431939 146 static int ds1200_probe(struct i2c_client *client)
1f234ff1 147 {
dd431939 148 return pmbus_do_probe(client, &ds1200_info);
1f234ff1 149 }
44f5a408 150
1f234ff1
MCC
151 static int ds1200_remove(struct i2c_client *client)
152 {
44f5a408 153 return pmbus_do_remove(client);
1f234ff1 154 }
44f5a408 155
1f234ff1 156 static const struct i2c_device_id ds1200_id[] = {
44f5a408
GR
157 {"ds1200", 0},
158 {}
1f234ff1 159 };
44f5a408 160
1f234ff1 161 MODULE_DEVICE_TABLE(i2c, ds1200_id);
44f5a408 162
1f234ff1
MCC
163 /* This is the driver that will be inserted */
164 static struct i2c_driver ds1200_driver = {
44f5a408
GR
165 .driver = {
166 .name = "ds1200",
167 },
dd431939 168 .probe_new = ds1200_probe,
44f5a408
GR
169 .remove = ds1200_remove,
170 .id_table = ds1200_id,
1f234ff1 171 };
44f5a408 172
1f234ff1
MCC
173 static int __init ds1200_init(void)
174 {
44f5a408 175 return i2c_add_driver(&ds1200_driver);
1f234ff1 176 }
44f5a408 177
1f234ff1
MCC
178 static void __exit ds1200_exit(void)
179 {
44f5a408 180 i2c_del_driver(&ds1200_driver);
1f234ff1 181 }
44f5a408
GR
182
183
184Sysfs entries
185-------------
186
187When probing the chip, the driver identifies which PMBus registers are
188supported, and determines available sensors from this information.
02582e9b 189Attribute files only exist if respective sensors are supported by the chip.
44f5a408
GR
190Labels are provided to inform the user about the sensor associated with
191a given sysfs entry.
192
193The following attributes are supported. Limits are read-write; all other
194attributes are read-only.
195
1f234ff1 196======================= ========================================================
44f5a408 197inX_input Measured voltage. From READ_VIN or READ_VOUT register.
25985edc 198inX_min Minimum Voltage.
44f5a408
GR
199 From VIN_UV_WARN_LIMIT or VOUT_UV_WARN_LIMIT register.
200inX_max Maximum voltage.
201 From VIN_OV_WARN_LIMIT or VOUT_OV_WARN_LIMIT register.
25985edc 202inX_lcrit Critical minimum Voltage.
44f5a408
GR
203 From VIN_UV_FAULT_LIMIT or VOUT_UV_FAULT_LIMIT register.
204inX_crit Critical maximum voltage.
205 From VIN_OV_FAULT_LIMIT or VOUT_OV_FAULT_LIMIT register.
206inX_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status.
207inX_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status.
208inX_lcrit_alarm Voltage critical low alarm.
209 From VOLTAGE_UV_FAULT status.
210inX_crit_alarm Voltage critical high alarm.
211 From VOLTAGE_OV_FAULT status.
212inX_label "vin", "vcap", or "voutY"
787c095e
ZL
213inX_rated_min Minimum rated voltage.
214 From MFR_VIN_MIN or MFR_VOUT_MIN register.
215inX_rated_max Maximum rated voltage.
216 From MFR_VIN_MAX or MFR_VOUT_MAX register.
44f5a408
GR
217
218currX_input Measured current. From READ_IIN or READ_IOUT register.
219currX_max Maximum current.
220 From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT register.
25985edc 221currX_lcrit Critical minimum output current.
44f5a408
GR
222 From IOUT_UC_FAULT_LIMIT register.
223currX_crit Critical maximum current.
224 From IIN_OC_FAULT_LIMIT or IOUT_OC_FAULT_LIMIT register.
225currX_alarm Current high alarm.
226 From IIN_OC_WARNING or IOUT_OC_WARNING status.
180b3d88
GR
227currX_max_alarm Current high alarm.
228 From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT status.
44f5a408
GR
229currX_lcrit_alarm Output current critical low alarm.
230 From IOUT_UC_FAULT status.
231currX_crit_alarm Current critical high alarm.
232 From IIN_OC_FAULT or IOUT_OC_FAULT status.
16358542
GR
233currX_label "iin", "iinY", "iinY.Z", "ioutY", or "ioutY.Z",
234 where Y reflects the page number and Z reflects the
235 phase.
787c095e
ZL
236currX_rated_max Maximum rated current.
237 From MFR_IIN_MAX or MFR_IOUT_MAX register.
44f5a408
GR
238
239powerX_input Measured power. From READ_PIN or READ_POUT register.
240powerX_cap Output power cap. From POUT_MAX register.
241powerX_max Power limit. From PIN_OP_WARN_LIMIT or
242 POUT_OP_WARN_LIMIT register.
243powerX_crit Critical output power limit.
244 From POUT_OP_FAULT_LIMIT register.
245powerX_alarm Power high alarm.
246 From PIN_OP_WARNING or POUT_OP_WARNING status.
247powerX_crit_alarm Output power critical high alarm.
248 From POUT_OP_FAULT status.
16358542
GR
249powerX_label "pin", "pinY", "pinY.Z", "poutY", or "poutY.Z",
250 where Y reflects the page number and Z reflects the
251 phase.
787c095e
ZL
252powerX_rated_max Maximum rated power.
253 From MFR_PIN_MAX or MFR_POUT_MAX register.
44f5a408 254
180b3d88 255tempX_input Measured temperature.
44f5a408 256 From READ_TEMPERATURE_X register.
787c095e 257tempX_min Minimum temperature. From UT_WARN_LIMIT register.
180b3d88
GR
258tempX_max Maximum temperature. From OT_WARN_LIMIT register.
259tempX_lcrit Critical low temperature.
44f5a408 260 From UT_FAULT_LIMIT register.
180b3d88 261tempX_crit Critical high temperature.
44f5a408
GR
262 From OT_FAULT_LIMIT register.
263tempX_min_alarm Chip temperature low alarm. Set by comparing
264 READ_TEMPERATURE_X with UT_WARN_LIMIT if
265 TEMP_UT_WARNING status is set.
266tempX_max_alarm Chip temperature high alarm. Set by comparing
267 READ_TEMPERATURE_X with OT_WARN_LIMIT if
268 TEMP_OT_WARNING status is set.
269tempX_lcrit_alarm Chip temperature critical low alarm. Set by comparing
270 READ_TEMPERATURE_X with UT_FAULT_LIMIT if
271 TEMP_UT_FAULT status is set.
272tempX_crit_alarm Chip temperature critical high alarm. Set by comparing
273 READ_TEMPERATURE_X with OT_FAULT_LIMIT if
274 TEMP_OT_FAULT status is set.
787c095e
ZL
275tempX_rated_min Minimum rated temperature.
276 From MFR_TAMBIENT_MIN register.
277tempX_rated_max Maximum rated temperature.
278 From MFR_TAMBIENT_MAX, MFR_MAX_TEMP_1, MFR_MAX_TEMP_2 or
279 MFR_MAX_TEMP_3 register.
1f234ff1 280======================= ========================================================