blob: 7ecfec6ca2dbcb2e0028a6c445dc506169bf66c0 [file] [log] [blame]
Guenter Roeck44f5a402010-06-28 14:29:03 -07001Kernel driver pmbus
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -03002===================
Guenter Roeck44f5a402010-06-28 14:29:03 -07003
4Supported chips:
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -03005
Erik Rosenea541c12021-05-07 21:40:23 +02006 * Flex BMR310, BMR453, BMR454, BMR456, BMR457, BMR458, BMR480,
7 BMR490, BMR491, BMR492
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -03008
Erik Rosenea541c12021-05-07 21:40:23 +02009 Prefixes: 'bmr310', 'bmr453', 'bmr454', 'bmr456', 'bmr457', 'bmr458', 'bmr480',
10 'bmr490', 'bmr491', 'bmr492'
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030011
Guenter Roeck44f5a402010-06-28 14:29:03 -070012 Addresses scanned: -
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030013
Erik Rosenea541c12021-05-07 21:40:23 +020014 Datasheets:
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030015
Erik Rosenea541c12021-05-07 21:40:23 +020016 https://flexpowermodules.com/products
17
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030018
Guenter Roecke0455e32011-06-25 15:13:44 -070019 * ON Semiconductor ADP4000, NCP4200, NCP4208
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030020
Guenter Roecke0455e32011-06-25 15:13:44 -070021 Prefixes: 'adp4000', 'ncp4200', 'ncp4208'
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030022
Guenter Roecke0455e32011-06-25 15:13:44 -070023 Addresses scanned: -
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030024
Guenter Roecke0455e32011-06-25 15:13:44 -070025 Datasheets:
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030026
Alexander A. Klimovf12d6342020-07-19 19:04:20 +020027 https://www.onsemi.com/pub_link/Collateral/ADP4000-D.PDF
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030028
Alexander A. Klimovf12d6342020-07-19 19:04:20 +020029 https://www.onsemi.com/pub_link/Collateral/NCP4200-D.PDF
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030030
Alexander A. Klimovf12d6342020-07-19 19:04:20 +020031 https://www.onsemi.com/pub_link/Collateral/JUNE%202009-%20REV.%200.PDF
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030032
Guenter Roeckbc365a72011-09-15 10:43:40 -070033 * Lineage Power
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030034
Guenter Roeck21633402012-02-28 11:00:54 -080035 Prefixes: 'mdt040', 'pdt003', 'pdt006', 'pdt012', 'udt020'
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030036
Guenter Roeckbc365a72011-09-15 10:43:40 -070037 Addresses scanned: -
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030038
Guenter Roeckbc365a72011-09-15 10:43:40 -070039 Datasheets:
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030040
Guenter Roeckbc365a72011-09-15 10:43:40 -070041 http://www.lineagepower.com/oem/pdf/PDT003A0X.pdf
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030042
Guenter Roeckbc365a72011-09-15 10:43:40 -070043 http://www.lineagepower.com/oem/pdf/PDT006A0X.pdf
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030044
Guenter Roeckbc365a72011-09-15 10:43:40 -070045 http://www.lineagepower.com/oem/pdf/PDT012A0X.pdf
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030046
Guenter Roeckbc365a72011-09-15 10:43:40 -070047 http://www.lineagepower.com/oem/pdf/UDT020A0X.pdf
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030048
Guenter Roeck21633402012-02-28 11:00:54 -080049 http://www.lineagepower.com/oem/pdf/MDT040A0X.pdf
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030050
Guenter Roeckcfca3782015-08-07 20:55:59 -070051 * Texas Instruments TPS40400, TPS544B20, TPS544B25, TPS544C20, TPS544C25
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030052
Guenter Roeckcfca3782015-08-07 20:55:59 -070053 Prefixes: 'tps40400', 'tps544b20', 'tps544b25', 'tps544c20', 'tps544c25'
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030054
Guenter Roeckc5f35c92012-02-28 10:24:54 -080055 Addresses scanned: -
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030056
Guenter Roeckc5f35c92012-02-28 10:24:54 -080057 Datasheets:
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030058
Alexander A. Klimovf12d6342020-07-19 19:04:20 +020059 https://www.ti.com/lit/gpn/tps40400
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030060
Alexander A. Klimovf12d6342020-07-19 19:04:20 +020061 https://www.ti.com/lit/gpn/tps544b20
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030062
Alexander A. Klimovf12d6342020-07-19 19:04:20 +020063 https://www.ti.com/lit/gpn/tps544b25
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030064
Alexander A. Klimovf12d6342020-07-19 19:04:20 +020065 https://www.ti.com/lit/gpn/tps544c20
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030066
Alexander A. Klimovf12d6342020-07-19 19:04:20 +020067 https://www.ti.com/lit/gpn/tps544c25
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030068
Guenter Roeck1a1ea122019-12-13 13:36:36 -080069 * Maxim MAX20796
70
71 Prefix: 'max20796'
72
73 Addresses scanned: -
74
75 Datasheet:
76
77 Not published
78
Guenter Roeck44f5a402010-06-28 14:29:03 -070079 * Generic PMBus devices
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030080
Guenter Roeck44f5a402010-06-28 14:29:03 -070081 Prefix: 'pmbus'
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030082
Guenter Roeck44f5a402010-06-28 14:29:03 -070083 Addresses scanned: -
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030084
Guenter Roeck44f5a402010-06-28 14:29:03 -070085 Datasheet: n.a.
86
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -030087
Guenter Roecke3333e52013-02-20 20:58:42 -080088Author: Guenter Roeck <linux@roeck-us.net>
Guenter Roeck44f5a402010-06-28 14:29:03 -070089
90
91Description
92-----------
93
Masanari Iida92417da2016-02-28 12:57:57 +090094This driver supports hardware monitoring for various PMBus compliant devices.
Guenter Roeck44f5a402010-06-28 14:29:03 -070095It supports voltage, current, power, and temperature sensors as supported
96by the device.
97
98Each monitored channel has its own high and low limits, plus a critical
99limit.
100
101Fan support will be added in a later version of this driver.
102
103
104Usage Notes
105-----------
106
107This driver does not probe for PMBus devices, since there is no register
108which can be safely used to identify the chip (The MFG_ID register is not
109supported by all chips), and since there is no well defined address range for
110PMBus devices. You will have to instantiate the devices explicitly.
111
112Example: the following will load the driver for an LTC2978 at address 0x60
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300113on I2C bus #1::
114
115 $ modprobe pmbus
116 $ echo ltc2978 0x60 > /sys/bus/i2c/devices/i2c-1/new_device
Guenter Roeck44f5a402010-06-28 14:29:03 -0700117
118
119Platform data support
120---------------------
121
122Support for additional PMBus chips can be added by defining chip parameters in
123a new chip specific driver file. For example, (untested) code to add support for
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300124Emerson DS1200 power modules might look as follows::
Guenter Roeck44f5a402010-06-28 14:29:03 -0700125
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300126 static struct pmbus_driver_info ds1200_info = {
Guenter Roeck44f5a402010-06-28 14:29:03 -0700127 .pages = 1,
128 /* Note: All other sensors are in linear mode */
129 .direct[PSC_VOLTAGE_OUT] = true,
130 .direct[PSC_TEMPERATURE] = true,
131 .direct[PSC_CURRENT_OUT] = true,
132 .m[PSC_VOLTAGE_IN] = 1,
133 .b[PSC_VOLTAGE_IN] = 0,
134 .R[PSC_VOLTAGE_IN] = 3,
135 .m[PSC_VOLTAGE_OUT] = 1,
136 .b[PSC_VOLTAGE_OUT] = 0,
137 .R[PSC_VOLTAGE_OUT] = 3,
138 .m[PSC_TEMPERATURE] = 1,
139 .b[PSC_TEMPERATURE] = 0,
140 .R[PSC_TEMPERATURE] = 3,
141 .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | PMBUS_HAVE_STATUS_INPUT
142 | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
143 | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
144 | PMBUS_HAVE_PIN | PMBUS_HAVE_POUT
145 | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP
146 | PMBUS_HAVE_FAN12 | PMBUS_HAVE_STATUS_FAN12,
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300147 };
Guenter Roeck44f5a402010-06-28 14:29:03 -0700148
Stephen Kittdd431932020-08-08 23:00:04 +0200149 static int ds1200_probe(struct i2c_client *client)
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300150 {
Stephen Kittdd431932020-08-08 23:00:04 +0200151 return pmbus_do_probe(client, &ds1200_info);
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300152 }
Guenter Roeck44f5a402010-06-28 14:29:03 -0700153
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300154 static const struct i2c_device_id ds1200_id[] = {
Guenter Roeck44f5a402010-06-28 14:29:03 -0700155 {"ds1200", 0},
156 {}
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300157 };
Guenter Roeck44f5a402010-06-28 14:29:03 -0700158
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300159 MODULE_DEVICE_TABLE(i2c, ds1200_id);
Guenter Roeck44f5a402010-06-28 14:29:03 -0700160
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300161 /* This is the driver that will be inserted */
162 static struct i2c_driver ds1200_driver = {
Guenter Roeck44f5a402010-06-28 14:29:03 -0700163 .driver = {
164 .name = "ds1200",
165 },
Stephen Kittdd431932020-08-08 23:00:04 +0200166 .probe_new = ds1200_probe,
Guenter Roeck44f5a402010-06-28 14:29:03 -0700167 .id_table = ds1200_id,
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300168 };
Guenter Roeck44f5a402010-06-28 14:29:03 -0700169
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300170 static int __init ds1200_init(void)
171 {
Guenter Roeck44f5a402010-06-28 14:29:03 -0700172 return i2c_add_driver(&ds1200_driver);
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300173 }
Guenter Roeck44f5a402010-06-28 14:29:03 -0700174
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300175 static void __exit ds1200_exit(void)
176 {
Guenter Roeck44f5a402010-06-28 14:29:03 -0700177 i2c_del_driver(&ds1200_driver);
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300178 }
Guenter Roeck44f5a402010-06-28 14:29:03 -0700179
180
181Sysfs entries
182-------------
183
184When probing the chip, the driver identifies which PMBus registers are
185supported, and determines available sensors from this information.
Masanari Iida02582e92012-08-22 19:11:26 +0900186Attribute files only exist if respective sensors are supported by the chip.
Guenter Roeck44f5a402010-06-28 14:29:03 -0700187Labels are provided to inform the user about the sensor associated with
188a given sysfs entry.
189
190The following attributes are supported. Limits are read-write; all other
191attributes are read-only.
192
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300193======================= ========================================================
Guenter Roeck44f5a402010-06-28 14:29:03 -0700194inX_input Measured voltage. From READ_VIN or READ_VOUT register.
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300195inX_min Minimum Voltage.
Guenter Roeck44f5a402010-06-28 14:29:03 -0700196 From VIN_UV_WARN_LIMIT or VOUT_UV_WARN_LIMIT register.
197inX_max Maximum voltage.
198 From VIN_OV_WARN_LIMIT or VOUT_OV_WARN_LIMIT register.
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300199inX_lcrit Critical minimum Voltage.
Guenter Roeck44f5a402010-06-28 14:29:03 -0700200 From VIN_UV_FAULT_LIMIT or VOUT_UV_FAULT_LIMIT register.
201inX_crit Critical maximum voltage.
202 From VIN_OV_FAULT_LIMIT or VOUT_OV_FAULT_LIMIT register.
203inX_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status.
204inX_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status.
205inX_lcrit_alarm Voltage critical low alarm.
206 From VOLTAGE_UV_FAULT status.
207inX_crit_alarm Voltage critical high alarm.
208 From VOLTAGE_OV_FAULT status.
209inX_label "vin", "vcap", or "voutY"
Zbigniew Lukwinski787c0952020-07-31 21:37:17 +0200210inX_rated_min Minimum rated voltage.
211 From MFR_VIN_MIN or MFR_VOUT_MIN register.
212inX_rated_max Maximum rated voltage.
213 From MFR_VIN_MAX or MFR_VOUT_MAX register.
Guenter Roeck44f5a402010-06-28 14:29:03 -0700214
215currX_input Measured current. From READ_IIN or READ_IOUT register.
216currX_max Maximum current.
217 From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT register.
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300218currX_lcrit Critical minimum output current.
Guenter Roeck44f5a402010-06-28 14:29:03 -0700219 From IOUT_UC_FAULT_LIMIT register.
220currX_crit Critical maximum current.
221 From IIN_OC_FAULT_LIMIT or IOUT_OC_FAULT_LIMIT register.
222currX_alarm Current high alarm.
223 From IIN_OC_WARNING or IOUT_OC_WARNING status.
Guenter Roeck180b3d82011-04-18 09:48:58 -0700224currX_max_alarm Current high alarm.
225 From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT status.
Guenter Roeck44f5a402010-06-28 14:29:03 -0700226currX_lcrit_alarm Output current critical low alarm.
227 From IOUT_UC_FAULT status.
228currX_crit_alarm Current critical high alarm.
229 From IIN_OC_FAULT or IOUT_OC_FAULT status.
Guenter Roeck16358542020-01-13 15:30:14 -0800230currX_label "iin", "iinY", "iinY.Z", "ioutY", or "ioutY.Z",
231 where Y reflects the page number and Z reflects the
232 phase.
Zbigniew Lukwinski787c0952020-07-31 21:37:17 +0200233currX_rated_max Maximum rated current.
234 From MFR_IIN_MAX or MFR_IOUT_MAX register.
Guenter Roeck44f5a402010-06-28 14:29:03 -0700235
236powerX_input Measured power. From READ_PIN or READ_POUT register.
237powerX_cap Output power cap. From POUT_MAX register.
238powerX_max Power limit. From PIN_OP_WARN_LIMIT or
239 POUT_OP_WARN_LIMIT register.
240powerX_crit Critical output power limit.
241 From POUT_OP_FAULT_LIMIT register.
242powerX_alarm Power high alarm.
243 From PIN_OP_WARNING or POUT_OP_WARNING status.
244powerX_crit_alarm Output power critical high alarm.
245 From POUT_OP_FAULT status.
Guenter Roeck16358542020-01-13 15:30:14 -0800246powerX_label "pin", "pinY", "pinY.Z", "poutY", or "poutY.Z",
247 where Y reflects the page number and Z reflects the
248 phase.
Zbigniew Lukwinski787c0952020-07-31 21:37:17 +0200249powerX_rated_max Maximum rated power.
250 From MFR_PIN_MAX or MFR_POUT_MAX register.
Guenter Roeck44f5a402010-06-28 14:29:03 -0700251
Guenter Roeck180b3d82011-04-18 09:48:58 -0700252tempX_input Measured temperature.
Guenter Roeck44f5a402010-06-28 14:29:03 -0700253 From READ_TEMPERATURE_X register.
Zbigniew Lukwinski787c0952020-07-31 21:37:17 +0200254tempX_min Minimum temperature. From UT_WARN_LIMIT register.
Guenter Roeck180b3d82011-04-18 09:48:58 -0700255tempX_max Maximum temperature. From OT_WARN_LIMIT register.
256tempX_lcrit Critical low temperature.
Guenter Roeck44f5a402010-06-28 14:29:03 -0700257 From UT_FAULT_LIMIT register.
Guenter Roeck180b3d82011-04-18 09:48:58 -0700258tempX_crit Critical high temperature.
Guenter Roeck44f5a402010-06-28 14:29:03 -0700259 From OT_FAULT_LIMIT register.
260tempX_min_alarm Chip temperature low alarm. Set by comparing
261 READ_TEMPERATURE_X with UT_WARN_LIMIT if
262 TEMP_UT_WARNING status is set.
263tempX_max_alarm Chip temperature high alarm. Set by comparing
264 READ_TEMPERATURE_X with OT_WARN_LIMIT if
265 TEMP_OT_WARNING status is set.
266tempX_lcrit_alarm Chip temperature critical low alarm. Set by comparing
267 READ_TEMPERATURE_X with UT_FAULT_LIMIT if
268 TEMP_UT_FAULT status is set.
269tempX_crit_alarm Chip temperature critical high alarm. Set by comparing
270 READ_TEMPERATURE_X with OT_FAULT_LIMIT if
271 TEMP_OT_FAULT status is set.
Zbigniew Lukwinski787c0952020-07-31 21:37:17 +0200272tempX_rated_min Minimum rated temperature.
273 From MFR_TAMBIENT_MIN register.
274tempX_rated_max Maximum rated temperature.
275 From MFR_TAMBIENT_MAX, MFR_MAX_TEMP_1, MFR_MAX_TEMP_2 or
276 MFR_MAX_TEMP_3 register.
Mauro Carvalho Chehab1f234ff2019-04-17 06:46:26 -0300277======================= ========================================================