Kernel driver pmbus

Supported chips:

  • Ericsson BMR453, BMR454

    Prefixes: ‘bmr453’, ‘bmr454’

    Addresses scanned: -

    Datasheet:

http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146395

Author: Guenter Roeck <linux@roeck-us.net>

Description

This driver supports hardware monitoring for various PMBus compliant devices.It supports voltage, current, power, and temperature sensors as supportedby the device.

Each monitored channel has its own high and low limits, plus a criticallimit.

Fan support will be added in a later version of this driver.

Usage Notes

This driver does not probe for PMBus devices, since there is no registerwhich can be safely used to identify the chip (The MFG_ID register is notsupported by all chips), and since there is no well defined address range forPMBus devices. You will have to instantiate the devices explicitly.

Example: the following will load the driver for an LTC2978 at address 0x60on I2C bus #1:

$ modprobe pmbus$ echo ltc2978 0x60 > /sys/bus/i2c/devices/i2c-1/new_device

Platform data support

Support for additional PMBus chips can be added by defining chip parameters ina new chip specific driver file. For example, (untested) code to add support forEmerson DS1200 power modules might look as follows:

static struct pmbus_driver_info ds1200_info = {      .pages = 1,      /* Note: All other sensors are in linear mode */      .direct[PSC_VOLTAGE_OUT] = true,      .direct[PSC_TEMPERATURE] = true,      .direct[PSC_CURRENT_OUT] = true,      .m[PSC_VOLTAGE_IN] = 1,      .b[PSC_VOLTAGE_IN] = 0,      .R[PSC_VOLTAGE_IN] = 3,      .m[PSC_VOLTAGE_OUT] = 1,      .b[PSC_VOLTAGE_OUT] = 0,      .R[PSC_VOLTAGE_OUT] = 3,      .m[PSC_TEMPERATURE] = 1,      .b[PSC_TEMPERATURE] = 0,      .R[PSC_TEMPERATURE] = 3,      .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | PMBUS_HAVE_STATUS_INPUT                 | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT                 | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT                 | PMBUS_HAVE_PIN | PMBUS_HAVE_POUT                 | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP                 | PMBUS_HAVE_FAN12 | PMBUS_HAVE_STATUS_FAN12,};static int ds1200_probe(struct i2c_client *client,                        const struct i2c_device_id *id){      return pmbus_do_probe(client, id, &ds1200_info);}static int ds1200_remove(struct i2c_client *client){      return pmbus_do_remove(client);}static const struct i2c_device_id ds1200_id[] = {      {"ds1200", 0},      {}};MODULE_DEVICE_TABLE(i2c, ds1200_id);/* This is the driver that will be inserted */static struct i2c_driver ds1200_driver = {      .driver = {                 .name = "ds1200",                 },      .probe = ds1200_probe,      .remove = ds1200_remove,      .id_table = ds1200_id,};static int __init ds1200_init(void){      return i2c_add_driver(&ds1200_driver);}static void __exit ds1200_exit(void){      i2c_del_driver(&ds1200_driver);}

Sysfs entries

When probing the chip, the driver identifies which PMBus registers aresupported, and determines available sensors from this information.Attribute files only exist if respective sensors are supported by the chip.Labels are provided to inform the user about the sensor associated witha given sysfs entry.

The following attributes are supported. Limits are read-write; all otherattributes are read-only.

inX_inputMeasured voltage. From READ_VIN or READ_VOUT register.
inX_minMinimum Voltage.From VIN_UV_WARN_LIMIT or VOUT_UV_WARN_LIMIT register.
inX_maxMaximum voltage.From VIN_OV_WARN_LIMIT or VOUT_OV_WARN_LIMIT register.
inX_lcritCritical minimum Voltage.From VIN_UV_FAULT_LIMIT or VOUT_UV_FAULT_LIMIT register.
inX_critCritical maximum voltage.From VIN_OV_FAULT_LIMIT or VOUT_OV_FAULT_LIMIT register.
inX_min_alarmVoltage low alarm. From VOLTAGE_UV_WARNING status.
inX_max_alarmVoltage high alarm. From VOLTAGE_OV_WARNING status.
inX_lcrit_alarmVoltage critical low alarm.From VOLTAGE_UV_FAULT status.
inX_crit_alarmVoltage critical high alarm.From VOLTAGE_OV_FAULT status.
inX_label“vin”, “vcap”, or “voutY”
currX_inputMeasured current. From READ_IIN or READ_IOUT register.
currX_maxMaximum current.From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT register.
currX_lcritCritical minimum output current.From IOUT_UC_FAULT_LIMIT register.
currX_critCritical maximum current.From IIN_OC_FAULT_LIMIT or IOUT_OC_FAULT_LIMIT register.
currX_alarmCurrent high alarm.From IIN_OC_WARNING or IOUT_OC_WARNING status.
currX_max_alarmCurrent high alarm.From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT status.
currX_lcrit_alarmOutput current critical low alarm.From IOUT_UC_FAULT status.
currX_crit_alarmCurrent critical high alarm.From IIN_OC_FAULT or IOUT_OC_FAULT status.
currX_label“iin”, “iinY”, “iinY.Z”, “ioutY”, or “ioutY.Z”,where Y reflects the page number and Z reflects thephase.
powerX_inputMeasured power. From READ_PIN or READ_POUT register.
powerX_capOutput power cap. From POUT_MAX register.
powerX_maxPower limit. From PIN_OP_WARN_LIMIT orPOUT_OP_WARN_LIMIT register.
powerX_critCritical output power limit.From POUT_OP_FAULT_LIMIT register.
powerX_alarmPower high alarm.From PIN_OP_WARNING or POUT_OP_WARNING status.
powerX_crit_alarmOutput power critical high alarm.From POUT_OP_FAULT status.
powerX_label“pin”, “pinY”, “pinY.Z”, “poutY”, or “poutY.Z”,where Y reflects the page number and Z reflects thephase.
tempX_inputMeasured temperature.From READ_TEMPERATURE_X register.
tempX_minMimimum temperature. From UT_WARN_LIMIT register.
tempX_maxMaximum temperature. From OT_WARN_LIMIT register.
tempX_lcritCritical low temperature.From UT_FAULT_LIMIT register.
tempX_critCritical high temperature.From OT_FAULT_LIMIT register.
tempX_min_alarmChip temperature low alarm. Set by comparingREAD_TEMPERATURE_X with UT_WARN_LIMIT ifTEMP_UT_WARNING status is set.
tempX_max_alarmChip temperature high alarm. Set by comparingREAD_TEMPERATURE_X with OT_WARN_LIMIT ifTEMP_OT_WARNING status is set.
tempX_lcrit_alarmChip temperature critical low alarm. Set by comparingREAD_TEMPERATURE_X with UT_FAULT_LIMIT ifTEMP_UT_FAULT status is set.
tempX_crit_alarmChip temperature critical high alarm. Set by comparingREAD_TEMPERATURE_X with OT_FAULT_LIMIT ifTEMP_OT_FAULT status is set.