Back to home page

OSCL-LXR

 
 

    


0001 Kernel driver pmbus
0002 ===================
0003 
0004 Supported chips:
0005 
0006   * Flex BMR310, BMR453, BMR454, BMR456, BMR457, BMR458, BMR480,
0007     BMR490, BMR491, BMR492
0008 
0009     Prefixes: 'bmr310', 'bmr453', 'bmr454', 'bmr456', 'bmr457', 'bmr458', 'bmr480',
0010     'bmr490', 'bmr491', 'bmr492'
0011 
0012     Addresses scanned: -
0013 
0014     Datasheets:
0015 
0016         https://flexpowermodules.com/products
0017 
0018 
0019   * ON Semiconductor ADP4000, NCP4200, NCP4208
0020 
0021     Prefixes: 'adp4000', 'ncp4200', 'ncp4208'
0022 
0023     Addresses scanned: -
0024 
0025     Datasheets:
0026 
0027         https://www.onsemi.com/pub_link/Collateral/ADP4000-D.PDF
0028 
0029         https://www.onsemi.com/pub_link/Collateral/NCP4200-D.PDF
0030 
0031         https://www.onsemi.com/pub_link/Collateral/JUNE%202009-%20REV.%200.PDF
0032 
0033   * Lineage Power
0034 
0035     Prefixes: 'mdt040', 'pdt003', 'pdt006', 'pdt012', 'udt020'
0036 
0037     Addresses scanned: -
0038 
0039     Datasheets:
0040 
0041         http://www.lineagepower.com/oem/pdf/PDT003A0X.pdf
0042 
0043         http://www.lineagepower.com/oem/pdf/PDT006A0X.pdf
0044 
0045         http://www.lineagepower.com/oem/pdf/PDT012A0X.pdf
0046 
0047         http://www.lineagepower.com/oem/pdf/UDT020A0X.pdf
0048 
0049         http://www.lineagepower.com/oem/pdf/MDT040A0X.pdf
0050 
0051   * Texas Instruments TPS40400, TPS544B20, TPS544B25, TPS544C20, TPS544C25
0052 
0053     Prefixes: 'tps40400', 'tps544b20', 'tps544b25', 'tps544c20', 'tps544c25'
0054 
0055     Addresses scanned: -
0056 
0057     Datasheets:
0058 
0059         https://www.ti.com/lit/gpn/tps40400
0060 
0061         https://www.ti.com/lit/gpn/tps544b20
0062 
0063         https://www.ti.com/lit/gpn/tps544b25
0064 
0065         https://www.ti.com/lit/gpn/tps544c20
0066 
0067         https://www.ti.com/lit/gpn/tps544c25
0068 
0069   * Maxim MAX20796
0070 
0071     Prefix: 'max20796'
0072 
0073     Addresses scanned: -
0074 
0075     Datasheet:
0076 
0077         Not published
0078 
0079   * Generic PMBus devices
0080 
0081     Prefix: 'pmbus'
0082 
0083     Addresses scanned: -
0084 
0085     Datasheet: n.a.
0086 
0087 
0088 Author: Guenter Roeck <linux@roeck-us.net>
0089 
0090 
0091 Description
0092 -----------
0093 
0094 This driver supports hardware monitoring for various PMBus compliant devices.
0095 It supports voltage, current, power, and temperature sensors as supported
0096 by the device.
0097 
0098 Each monitored channel has its own high and low limits, plus a critical
0099 limit.
0100 
0101 Fan support will be added in a later version of this driver.
0102 
0103 
0104 Usage Notes
0105 -----------
0106 
0107 This driver does not probe for PMBus devices, since there is no register
0108 which can be safely used to identify the chip (The MFG_ID register is not
0109 supported by all chips), and since there is no well defined address range for
0110 PMBus devices. You will have to instantiate the devices explicitly.
0111 
0112 Example: the following will load the driver for an LTC2978 at address 0x60
0113 on I2C bus #1::
0114 
0115         $ modprobe pmbus
0116         $ echo ltc2978 0x60 > /sys/bus/i2c/devices/i2c-1/new_device
0117 
0118 
0119 Platform data support
0120 ---------------------
0121 
0122 Support for additional PMBus chips can be added by defining chip parameters in
0123 a new chip specific driver file. For example, (untested) code to add support for
0124 Emerson DS1200 power modules might look as follows::
0125 
0126   static struct pmbus_driver_info ds1200_info = {
0127         .pages = 1,
0128         /* Note: All other sensors are in linear mode */
0129         .direct[PSC_VOLTAGE_OUT] = true,
0130         .direct[PSC_TEMPERATURE] = true,
0131         .direct[PSC_CURRENT_OUT] = true,
0132         .m[PSC_VOLTAGE_IN] = 1,
0133         .b[PSC_VOLTAGE_IN] = 0,
0134         .R[PSC_VOLTAGE_IN] = 3,
0135         .m[PSC_VOLTAGE_OUT] = 1,
0136         .b[PSC_VOLTAGE_OUT] = 0,
0137         .R[PSC_VOLTAGE_OUT] = 3,
0138         .m[PSC_TEMPERATURE] = 1,
0139         .b[PSC_TEMPERATURE] = 0,
0140         .R[PSC_TEMPERATURE] = 3,
0141         .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | PMBUS_HAVE_STATUS_INPUT
0142                    | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
0143                    | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
0144                    | PMBUS_HAVE_PIN | PMBUS_HAVE_POUT
0145                    | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP
0146                    | PMBUS_HAVE_FAN12 | PMBUS_HAVE_STATUS_FAN12,
0147   };
0148 
0149   static int ds1200_probe(struct i2c_client *client)
0150   {
0151         return pmbus_do_probe(client, &ds1200_info);
0152   }
0153 
0154   static const struct i2c_device_id ds1200_id[] = {
0155         {"ds1200", 0},
0156         {}
0157   };
0158 
0159   MODULE_DEVICE_TABLE(i2c, ds1200_id);
0160 
0161   /* This is the driver that will be inserted */
0162   static struct i2c_driver ds1200_driver = {
0163         .driver = {
0164                    .name = "ds1200",
0165                    },
0166         .probe_new = ds1200_probe,
0167         .id_table = ds1200_id,
0168   };
0169 
0170   static int __init ds1200_init(void)
0171   {
0172         return i2c_add_driver(&ds1200_driver);
0173   }
0174 
0175   static void __exit ds1200_exit(void)
0176   {
0177         i2c_del_driver(&ds1200_driver);
0178   }
0179 
0180 
0181 Sysfs entries
0182 -------------
0183 
0184 When probing the chip, the driver identifies which PMBus registers are
0185 supported, and determines available sensors from this information.
0186 Attribute files only exist if respective sensors are supported by the chip.
0187 Labels are provided to inform the user about the sensor associated with
0188 a given sysfs entry.
0189 
0190 The following attributes are supported. Limits are read-write; all other
0191 attributes are read-only.
0192 
0193 ======================= ========================================================
0194 inX_input               Measured voltage. From READ_VIN or READ_VOUT register.
0195 inX_min                 Minimum Voltage.
0196                         From VIN_UV_WARN_LIMIT or VOUT_UV_WARN_LIMIT register.
0197 inX_max                 Maximum voltage.
0198                         From VIN_OV_WARN_LIMIT or VOUT_OV_WARN_LIMIT register.
0199 inX_lcrit               Critical minimum Voltage.
0200                         From VIN_UV_FAULT_LIMIT or VOUT_UV_FAULT_LIMIT register.
0201 inX_crit                Critical maximum voltage.
0202                         From VIN_OV_FAULT_LIMIT or VOUT_OV_FAULT_LIMIT register.
0203 inX_min_alarm           Voltage low alarm. From VOLTAGE_UV_WARNING status.
0204 inX_max_alarm           Voltage high alarm. From VOLTAGE_OV_WARNING status.
0205 inX_lcrit_alarm         Voltage critical low alarm.
0206                         From VOLTAGE_UV_FAULT status.
0207 inX_crit_alarm          Voltage critical high alarm.
0208                         From VOLTAGE_OV_FAULT status.
0209 inX_label               "vin", "vcap", or "voutY"
0210 inX_rated_min           Minimum rated voltage.
0211                         From MFR_VIN_MIN or MFR_VOUT_MIN register.
0212 inX_rated_max           Maximum rated voltage.
0213                         From MFR_VIN_MAX or MFR_VOUT_MAX register.
0214 
0215 currX_input             Measured current. From READ_IIN or READ_IOUT register.
0216 currX_max               Maximum current.
0217                         From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT register.
0218 currX_lcrit             Critical minimum output current.
0219                         From IOUT_UC_FAULT_LIMIT register.
0220 currX_crit              Critical maximum current.
0221                         From IIN_OC_FAULT_LIMIT or IOUT_OC_FAULT_LIMIT register.
0222 currX_alarm             Current high alarm.
0223                         From IIN_OC_WARNING or IOUT_OC_WARNING status.
0224 currX_max_alarm         Current high alarm.
0225                         From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT status.
0226 currX_lcrit_alarm       Output current critical low alarm.
0227                         From IOUT_UC_FAULT status.
0228 currX_crit_alarm        Current critical high alarm.
0229                         From IIN_OC_FAULT or IOUT_OC_FAULT status.
0230 currX_label             "iin", "iinY", "iinY.Z", "ioutY", or "ioutY.Z",
0231                         where Y reflects the page number and Z reflects the
0232                         phase.
0233 currX_rated_max         Maximum rated current.
0234                         From MFR_IIN_MAX or MFR_IOUT_MAX register.
0235 
0236 powerX_input            Measured power. From READ_PIN or READ_POUT register.
0237 powerX_cap              Output power cap. From POUT_MAX register.
0238 powerX_max              Power limit. From PIN_OP_WARN_LIMIT or
0239                         POUT_OP_WARN_LIMIT register.
0240 powerX_crit             Critical output power limit.
0241                         From POUT_OP_FAULT_LIMIT register.
0242 powerX_alarm            Power high alarm.
0243                         From PIN_OP_WARNING or POUT_OP_WARNING status.
0244 powerX_crit_alarm       Output power critical high alarm.
0245                         From POUT_OP_FAULT status.
0246 powerX_label            "pin", "pinY", "pinY.Z", "poutY", or "poutY.Z",
0247                         where Y reflects the page number and Z reflects the
0248                         phase.
0249 powerX_rated_max        Maximum rated power.
0250                         From MFR_PIN_MAX or MFR_POUT_MAX register.
0251 
0252 tempX_input             Measured temperature.
0253                         From READ_TEMPERATURE_X register.
0254 tempX_min               Minimum temperature. From UT_WARN_LIMIT register.
0255 tempX_max               Maximum temperature. From OT_WARN_LIMIT register.
0256 tempX_lcrit             Critical low temperature.
0257                         From UT_FAULT_LIMIT register.
0258 tempX_crit              Critical high temperature.
0259                         From OT_FAULT_LIMIT register.
0260 tempX_min_alarm         Chip temperature low alarm. Set by comparing
0261                         READ_TEMPERATURE_X with UT_WARN_LIMIT if
0262                         TEMP_UT_WARNING status is set.
0263 tempX_max_alarm         Chip temperature high alarm. Set by comparing
0264                         READ_TEMPERATURE_X with OT_WARN_LIMIT if
0265                         TEMP_OT_WARNING status is set.
0266 tempX_lcrit_alarm       Chip temperature critical low alarm. Set by comparing
0267                         READ_TEMPERATURE_X with UT_FAULT_LIMIT if
0268                         TEMP_UT_FAULT status is set.
0269 tempX_crit_alarm        Chip temperature critical high alarm. Set by comparing
0270                         READ_TEMPERATURE_X with OT_FAULT_LIMIT if
0271                         TEMP_OT_FAULT status is set.
0272 tempX_rated_min         Minimum rated temperature.
0273                         From MFR_TAMBIENT_MIN register.
0274 tempX_rated_max         Maximum rated temperature.
0275                         From MFR_TAMBIENT_MAX, MFR_MAX_TEMP_1, MFR_MAX_TEMP_2 or
0276                         MFR_MAX_TEMP_3 register.
0277 ======================= ========================================================