Lines Matching +full:32 +full:- +full:rail

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Hardware monitoring driver for MPS Multi-phase Digital VR Controllers(MP2891)
18 * to read input power per rail. The MP2891 does not have standard
30 #define MP2891_IOUT_SCALE_DIV 32
76 val >>= -exponent; in mp2891_reg2data_linear11()
99 * Obtain vout scale from the register MFR_VOUT_LOOP_CTRL, bits 15-14,bit 13. in mp2891_identify_vout_scale()
104 * 00b - 6.25mV/LSB, 01b - 5mV/LSB, 10b - 2mV/LSB, 11b - 1mV in mp2891_identify_vout_scale()
107 data->vout_scale[page] = 250; in mp2891_identify_vout_scale()
111 data->vout_scale[page] = 625; in mp2891_identify_vout_scale()
113 data->vout_scale[page] = 500; in mp2891_identify_vout_scale()
115 data->vout_scale[page] = 200; in mp2891_identify_vout_scale()
117 data->vout_scale[page] = 100; in mp2891_identify_vout_scale()
143 * 000b - 1A/LSB, 001b - (1/32)A/LSB, 010b - (1/16)A/LSB, in mp2891_identify_iout_scale()
144 * 011b - (1/8)A/LSB, 100b - (1/4)A/LSB, 101b - (1/2)A/LSB in mp2891_identify_iout_scale()
145 * 110b - 1A/LSB, 111b - 2A/LSB in mp2891_identify_iout_scale()
150 data->iout_scale[page] = 32; in mp2891_identify_iout_scale()
153 data->iout_scale[page] = 1; in mp2891_identify_iout_scale()
156 data->iout_scale[page] = 2; in mp2891_identify_iout_scale()
159 data->iout_scale[page] = 4; in mp2891_identify_iout_scale()
162 data->iout_scale[page] = 8; in mp2891_identify_iout_scale()
165 data->iout_scale[page] = 16; in mp2891_identify_iout_scale()
168 data->iout_scale[page] = 64; in mp2891_identify_iout_scale()
179 /* Identify vout scale for rail 1. */ in mp2891_identify()
184 /* Identify vout scale for rail 2. */ in mp2891_identify()
189 /* Identify iout scale for rail 1. */ in mp2891_identify()
194 /* Identify iout scale for rail 2. */ in mp2891_identify()
214 ret = -ENODATA; in mp2891_read_byte_data()
254 * is not used to read the input power per rail. The input power in mp2891_read_word_data()
255 * per rail is read through the vender redefined register in mp2891_read_word_data()
286 ret = DIV_ROUND_CLOSEST(ret * data->vout_scale[page], MP2891_VOUT_SCALE_DIV); in mp2891_read_word_data()
293 ret = DIV_ROUND_CLOSEST((ret & GENMASK(10, 0)) * data->iout_scale[page], in mp2891_read_word_data()
306 ret = (ret & GENMASK(7, 0)) - MP2891_TEMP_LIMIT_OFFSET; in mp2891_read_word_data()
326 ret = FIELD_GET(GENMASK(7, 0), ret) * MP2891_UV_LIMIT_SCALE - in mp2891_read_word_data()
350 ret = DIV_ROUND_CLOSEST((ret & GENMASK(7, 0)) * data->iout_scale[page] * in mp2891_read_word_data()
380 ret = -ENODATA; in mp2891_read_word_data()
383 ret = -EINVAL; in mp2891_read_word_data()
401 data->vout_scale[page])); in mp2891_write_word_data()
405 * The PMBUS_VOUT_UV_FAULT_LIMIT[7:0] is the limit value, and bit8-bit15 in mp2891_write_word_data()
429 * The PMBUS_VOUT_OV_FAULT_LIMIT[7:0] is the limit value, and bit8-bit15 in mp2891_write_word_data()
440 DIV_ROUND_CLOSEST(word - in mp2891_write_word_data()
453 * The PMBUS_VIN_OV_FAULT_LIMIT[7:0] is the limit value, and bit8-bit15 in mp2891_write_word_data()
471 * have 40°C offset. The bit0-bit7 is the limit value, and bit8-bit15 in mp2891_write_word_data()
487 data->iout_scale[page])); in mp2891_write_word_data()
508 ret = -ENODATA; in mp2891_write_word_data()
511 ret = -EINVAL; in mp2891_write_word_data()
528 .m[PSC_VOLTAGE_IN] = 32,
565 data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL); in mp2891_probe()
567 return -ENOMEM; in mp2891_probe()
569 memcpy(&data->info, &mp2891_info, sizeof(mp2891_info)); in mp2891_probe()
571 return pmbus_do_probe(client, &data->info); in mp2891_probe()