staticint mp5990_read_byte_data(struct i2c_client *client, int page, int reg)
{ conststruct pmbus_driver_info *info = pmbus_get_driver_info(client); struct mp5990_data *data = to_mp5990_data(info);
switch (reg) { case PMBUS_VOUT_MODE: if (data->vout_mode == linear) { /* * The VOUT format used by the chip is linear11, * not linear16. Report that VOUT is in linear mode * and return exponent value extracted while probing * the chip.
*/ return data->vout_linear_exponent;
}
/* * The datasheet does not support the VOUT command, * but the device responds with a default value of 0x17. * In the standard, 0x17 represents linear mode. * Therefore, we should report that VOUT is in direct * format when the chip is configured for it.
*/ return PB_VOUT_MODE_DIRECT;
default: return -ENODATA;
}
}
staticint mp5990_read_word_data(struct i2c_client *client, int page, int phase, int reg)
{ conststruct pmbus_driver_info *info = pmbus_get_driver_info(client); struct mp5990_data *data = to_mp5990_data(info); int ret;
s32 mantissa;
switch (reg) { case PMBUS_READ_VOUT:
ret = pmbus_read_word_data(client, page, phase, reg); if (ret < 0) return ret; /* * Because the VOUT format used by the chip is linear11 and not * linear16, we disregard bits[15:11]. The exponent is reported * as part of the VOUT_MODE command.
*/ if (data->vout_mode == linear) {
mantissa = ((s16)((ret & 0x7ff) << 5)) >> 5;
ret = mantissa;
} break; default: return -ENODATA;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.