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