Linux Audio

Check our new training course

Linux kernel drivers training

Mar 31-Apr 9, 2025, special US time zones
Register
Loading...
v6.13.7
  1Kernel driver pmbus
  2===================
  3
  4Supported chips:
  5
  6  * Flex BMR310, BMR453, BMR454, BMR456, BMR457, BMR458, BMR480,
  7    BMR490, BMR491, BMR492
  8
  9    Prefixes: 'bmr310', 'bmr453', 'bmr454', 'bmr456', 'bmr457', 'bmr458', 'bmr480',
 10    'bmr490', 'bmr491', 'bmr492'
 11
 12    Addresses scanned: -
 13
 14    Datasheets:
 15
 16	https://flexpowermodules.com/products
 17
 
 18
 19  * ON Semiconductor ADP4000, NCP4200, NCP4208
 20
 21    Prefixes: 'adp4000', 'ncp4200', 'ncp4208'
 22
 23    Addresses scanned: -
 24
 25    Datasheets:
 26
 27	https://www.onsemi.com/pub_link/Collateral/ADP4000-D.PDF
 28
 29	https://www.onsemi.com/pub_link/Collateral/NCP4200-D.PDF
 30
 31	https://www.onsemi.com/pub_link/Collateral/JUNE%202009-%20REV.%200.PDF
 32
 33  * Lineage Power
 34
 35    Prefixes: 'mdt040', 'pdt003', 'pdt006', 'pdt012', 'udt020'
 36
 37    Addresses scanned: -
 38
 39    Datasheets:
 40
 41	http://www.lineagepower.com/oem/pdf/PDT003A0X.pdf
 42
 43	http://www.lineagepower.com/oem/pdf/PDT006A0X.pdf
 44
 45	http://www.lineagepower.com/oem/pdf/PDT012A0X.pdf
 46
 47	http://www.lineagepower.com/oem/pdf/UDT020A0X.pdf
 48
 49	http://www.lineagepower.com/oem/pdf/MDT040A0X.pdf
 50
 51  * Texas Instruments TPS40400, TPS544B20, TPS544B25, TPS544C20, TPS544C25
 52
 53    Prefixes: 'tps40400', 'tps544b20', 'tps544b25', 'tps544c20', 'tps544c25'
 54
 55    Addresses scanned: -
 56
 57    Datasheets:
 58
 59	https://www.ti.com/lit/gpn/tps40400
 60
 61	https://www.ti.com/lit/gpn/tps544b20
 62
 63	https://www.ti.com/lit/gpn/tps544b25
 64
 65	https://www.ti.com/lit/gpn/tps544c20
 66
 67	https://www.ti.com/lit/gpn/tps544c25
 68
 69  * Maxim MAX20796
 70
 71    Prefix: 'max20796'
 72
 73    Addresses scanned: -
 74
 75    Datasheet:
 76
 77	Not published
 78
 79  * Generic PMBus devices
 80
 81    Prefix: 'pmbus'
 82
 83    Addresses scanned: -
 84
 85    Datasheet: n.a.
 86
 87
 88Author: Guenter Roeck <linux@roeck-us.net>
 89
 90
 91Description
 92-----------
 93
 94This driver supports hardware monitoring for various PMBus compliant devices.
 95It 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
113on I2C bus #1::
114
115	$ modprobe pmbus
116	$ echo ltc2978 0x60 > /sys/bus/i2c/devices/i2c-1/new_device
117
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
124Emerson DS1200 power modules might look as follows::
125
126  static struct pmbus_driver_info ds1200_info = {
127	.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,
147  };
148
149  static int ds1200_probe(struct i2c_client *client)
 
 
 
 
 
 
150  {
151	return pmbus_do_probe(client, &ds1200_info);
152  }
153
154  static const struct i2c_device_id ds1200_id[] = {
155	{"ds1200"},
156	{}
157  };
158
159  MODULE_DEVICE_TABLE(i2c, ds1200_id);
160
161  /* This is the driver that will be inserted */
162  static struct i2c_driver ds1200_driver = {
163	.driver = {
164		   .name = "ds1200",
165		   },
166	.probe = ds1200_probe,
 
167	.id_table = ds1200_id,
168  };
169
170  static int __init ds1200_init(void)
171  {
172	return i2c_add_driver(&ds1200_driver);
173  }
174
175  static void __exit ds1200_exit(void)
176  {
177	i2c_del_driver(&ds1200_driver);
178  }
179
180
181Sysfs entries
182-------------
183
184When probing the chip, the driver identifies which PMBus registers are
185supported, and determines available sensors from this information.
186Attribute files only exist if respective sensors are supported by the chip.
187Labels 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
193======================= ========================================================
194inX_input		Measured voltage. From READ_VIN or READ_VOUT register.
195inX_min			Minimum Voltage.
196			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.
199inX_lcrit		Critical minimum Voltage.
200			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"
210inX_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.
214
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.
218currX_lcrit		Critical minimum output current.
219			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.
224currX_max_alarm		Current high alarm.
225			From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT status.
226currX_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.
230currX_label		"iin", "iinY", "iinY.Z", "ioutY", or "ioutY.Z",
231			where Y reflects the page number and Z reflects the
232			phase.
233currX_rated_max		Maximum rated current.
234			From MFR_IIN_MAX or MFR_IOUT_MAX register.
235
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.
246powerX_label		"pin", "pinY", "pinY.Z", "poutY", or "poutY.Z",
247			where Y reflects the page number and Z reflects the
248			phase.
249powerX_rated_max	Maximum rated power.
250			From MFR_PIN_MAX or MFR_POUT_MAX register.
251
252tempX_input		Measured temperature.
253			From READ_TEMPERATURE_X register.
254tempX_min		Minimum temperature. From UT_WARN_LIMIT register.
255tempX_max		Maximum temperature. From OT_WARN_LIMIT register.
256tempX_lcrit		Critical low temperature.
257			From UT_FAULT_LIMIT register.
258tempX_crit		Critical high temperature.
259			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.
272tempX_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.
277======================= ========================================================
v5.9
  1Kernel driver pmbus
  2===================
  3
  4Supported chips:
  5
  6  * Ericsson BMR453, BMR454
 
  7
  8    Prefixes: 'bmr453', 'bmr454'
 
  9
 10    Addresses scanned: -
 11
 12    Datasheet:
 
 
 13
 14 http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146395
 15
 16  * ON Semiconductor ADP4000, NCP4200, NCP4208
 17
 18    Prefixes: 'adp4000', 'ncp4200', 'ncp4208'
 19
 20    Addresses scanned: -
 21
 22    Datasheets:
 23
 24	https://www.onsemi.com/pub_link/Collateral/ADP4000-D.PDF
 25
 26	https://www.onsemi.com/pub_link/Collateral/NCP4200-D.PDF
 27
 28	https://www.onsemi.com/pub_link/Collateral/JUNE%202009-%20REV.%200.PDF
 29
 30  * Lineage Power
 31
 32    Prefixes: 'mdt040', 'pdt003', 'pdt006', 'pdt012', 'udt020'
 33
 34    Addresses scanned: -
 35
 36    Datasheets:
 37
 38	http://www.lineagepower.com/oem/pdf/PDT003A0X.pdf
 39
 40	http://www.lineagepower.com/oem/pdf/PDT006A0X.pdf
 41
 42	http://www.lineagepower.com/oem/pdf/PDT012A0X.pdf
 43
 44	http://www.lineagepower.com/oem/pdf/UDT020A0X.pdf
 45
 46	http://www.lineagepower.com/oem/pdf/MDT040A0X.pdf
 47
 48  * Texas Instruments TPS40400, TPS544B20, TPS544B25, TPS544C20, TPS544C25
 49
 50    Prefixes: 'tps40400', 'tps544b20', 'tps544b25', 'tps544c20', 'tps544c25'
 51
 52    Addresses scanned: -
 53
 54    Datasheets:
 55
 56	https://www.ti.com/lit/gpn/tps40400
 57
 58	https://www.ti.com/lit/gpn/tps544b20
 59
 60	https://www.ti.com/lit/gpn/tps544b25
 61
 62	https://www.ti.com/lit/gpn/tps544c20
 63
 64	https://www.ti.com/lit/gpn/tps544c25
 65
 66  * Maxim MAX20796
 67
 68    Prefix: 'max20796'
 69
 70    Addresses scanned: -
 71
 72    Datasheet:
 73
 74	Not published
 75
 76  * Generic PMBus devices
 77
 78    Prefix: 'pmbus'
 79
 80    Addresses scanned: -
 81
 82    Datasheet: n.a.
 83
 84
 85Author: Guenter Roeck <linux@roeck-us.net>
 86
 87
 88Description
 89-----------
 90
 91This driver supports hardware monitoring for various PMBus compliant devices.
 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
110on I2C bus #1::
111
112	$ modprobe pmbus
113	$ echo ltc2978 0x60 > /sys/bus/i2c/devices/i2c-1/new_device
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
121Emerson DS1200 power modules might look as follows::
122
123  static struct pmbus_driver_info ds1200_info = {
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,
144  };
145
146  static int ds1200_probe(struct i2c_client *client,
147			  const struct i2c_device_id *id)
148  {
149	return pmbus_do_probe(client, id, &ds1200_info);
150  }
151
152  static int ds1200_remove(struct i2c_client *client)
153  {
154	return pmbus_do_remove(client);
155  }
156
157  static const struct i2c_device_id ds1200_id[] = {
158	{"ds1200", 0},
159	{}
160  };
161
162  MODULE_DEVICE_TABLE(i2c, ds1200_id);
163
164  /* This is the driver that will be inserted */
165  static struct i2c_driver ds1200_driver = {
166	.driver = {
167		   .name = "ds1200",
168		   },
169	.probe = ds1200_probe,
170	.remove = ds1200_remove,
171	.id_table = ds1200_id,
172  };
173
174  static int __init ds1200_init(void)
175  {
176	return i2c_add_driver(&ds1200_driver);
177  }
178
179  static void __exit ds1200_exit(void)
180  {
181	i2c_del_driver(&ds1200_driver);
182  }
183
184
185Sysfs entries
186-------------
187
188When probing the chip, the driver identifies which PMBus registers are
189supported, and determines available sensors from this information.
190Attribute files only exist if respective sensors are supported by the chip.
191Labels are provided to inform the user about the sensor associated with
192a given sysfs entry.
193
194The following attributes are supported. Limits are read-write; all other
195attributes are read-only.
196
197======================= ========================================================
198inX_input		Measured voltage. From READ_VIN or READ_VOUT register.
199inX_min			Minimum Voltage.
200			From VIN_UV_WARN_LIMIT or VOUT_UV_WARN_LIMIT register.
201inX_max			Maximum voltage.
202			From VIN_OV_WARN_LIMIT or VOUT_OV_WARN_LIMIT register.
203inX_lcrit		Critical minimum Voltage.
204			From VIN_UV_FAULT_LIMIT or VOUT_UV_FAULT_LIMIT register.
205inX_crit		Critical maximum voltage.
206			From VIN_OV_FAULT_LIMIT or VOUT_OV_FAULT_LIMIT register.
207inX_min_alarm		Voltage low alarm. From VOLTAGE_UV_WARNING status.
208inX_max_alarm		Voltage high alarm. From VOLTAGE_OV_WARNING status.
209inX_lcrit_alarm		Voltage critical low alarm.
210			From VOLTAGE_UV_FAULT status.
211inX_crit_alarm		Voltage critical high alarm.
212			From VOLTAGE_OV_FAULT status.
213inX_label		"vin", "vcap", or "voutY"
 
 
 
 
214
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.
218currX_lcrit		Critical minimum output current.
219			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.
224currX_max_alarm		Current high alarm.
225			From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT status.
226currX_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.
230currX_label		"iin", "iinY", "iinY.Z", "ioutY", or "ioutY.Z",
231			where Y reflects the page number and Z reflects the
232			phase.
 
 
233
234powerX_input		Measured power. From READ_PIN or READ_POUT register.
235powerX_cap		Output power cap. From POUT_MAX register.
236powerX_max		Power limit. From PIN_OP_WARN_LIMIT or
237			POUT_OP_WARN_LIMIT register.
238powerX_crit		Critical output power limit.
239			From POUT_OP_FAULT_LIMIT register.
240powerX_alarm		Power high alarm.
241			From PIN_OP_WARNING or POUT_OP_WARNING status.
242powerX_crit_alarm	Output power critical high alarm.
243			From POUT_OP_FAULT status.
244powerX_label		"pin", "pinY", "pinY.Z", "poutY", or "poutY.Z",
245			where Y reflects the page number and Z reflects the
246			phase.
 
 
247
248tempX_input		Measured temperature.
249			From READ_TEMPERATURE_X register.
250tempX_min		Mimimum temperature. From UT_WARN_LIMIT register.
251tempX_max		Maximum temperature. From OT_WARN_LIMIT register.
252tempX_lcrit		Critical low temperature.
253			From UT_FAULT_LIMIT register.
254tempX_crit		Critical high temperature.
255			From OT_FAULT_LIMIT register.
256tempX_min_alarm		Chip temperature low alarm. Set by comparing
257			READ_TEMPERATURE_X with UT_WARN_LIMIT if
258			TEMP_UT_WARNING status is set.
259tempX_max_alarm		Chip temperature high alarm. Set by comparing
260			READ_TEMPERATURE_X with OT_WARN_LIMIT if
261			TEMP_OT_WARNING status is set.
262tempX_lcrit_alarm	Chip temperature critical low alarm. Set by comparing
263			READ_TEMPERATURE_X with UT_FAULT_LIMIT if
264			TEMP_UT_FAULT status is set.
265tempX_crit_alarm	Chip temperature critical high alarm. Set by comparing
266			READ_TEMPERATURE_X with OT_FAULT_LIMIT if
267			TEMP_OT_FAULT status is set.
 
 
 
 
 
268======================= ========================================================