Lines Matching +full:10 +full:- +full:bits

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Hardware monitoring driver for MPS Multi-phase Digital VR Controllers
27 #define MP2888_TEMP_UNIT 10
28 #define MP2888_MAX_PHASE 10
46 return -ENODATA; in mp2888_read_byte_data()
57 * , bits 0-2. The value is selected as below: in mp2888_current_sense_gain_and_resolution_get()
58 * 00b - 5µA/A, 01b - 8.5µA/A, 10b - 9.7µA/A, 11b - 10µA/A. Other in mp2888_current_sense_gain_and_resolution_get()
67 data->curr_sense_gain = 85; in mp2888_current_sense_gain_and_resolution_get()
70 data->curr_sense_gain = 97; in mp2888_current_sense_gain_and_resolution_get()
73 data->curr_sense_gain = 100; in mp2888_current_sense_gain_and_resolution_get()
76 data->curr_sense_gain = 50; in mp2888_current_sense_gain_and_resolution_get()
79 return -EINVAL; in mp2888_current_sense_gain_and_resolution_get()
87 data->total_curr_resolution = (ret & MP2888_TOTAL_CURRENT_RESOLUTION) >> 3; in mp2888_current_sense_gain_and_resolution_get()
88 data->phase_curr_resolution = (ret & MP2888_PHASE_CURRENT_RESOLUTION) >> 4; in mp2888_current_sense_gain_and_resolution_get()
109 * - Kcs is the DrMOS current sense gain of power stage, which is obtained from the in mp2888_read_phase()
110 * register MP2888_MFR_VR_CONFIG1, bits 13-12 with the following selection of DrMOS in mp2888_read_phase()
111 * (data->curr_sense_gain): in mp2888_read_phase()
112 * 00b - 8.5µA/A, 01b - 9.7µA/A, 1b - 10µA/A, 11b - 5µA/A. in mp2888_read_phase()
113 * - Rcs is the internal phase current sense resistor. This parameter depends on hardware in mp2888_read_phase()
121 ret = DIV_ROUND_CLOSEST(ret * 200 - 19600, data->curr_sense_gain); in mp2888_read_phase()
123 ret = (data->total_curr_resolution) ? ret * 2 : ret; in mp2888_read_phase()
149 return -ENODATA; in mp2888_read_phases()
168 * provides 10 bits for mantissa and 6 bits for exponent. Bits 15:10 are set with in mp2888_read_word_data()
171 ret = (ret & GENMASK(9, 0)) | ((ret & GENMASK(31, 10)) << 1); in mp2888_read_word_data()
178 * Chip reports limits in degrees C, but the actual temperature in 10th of in mp2888_read_word_data()
179 * degrees C - scaling is needed to match both. in mp2888_read_word_data()
191 * READ_IOUT register has unused bits 15:12 with fixed value 1110b. Clear these in mp2888_read_word_data()
192 * bits and scale with total current resolution. Data is provided in direct format. in mp2888_read_word_data()
195 ret = data->total_curr_resolution ? ret * 2 : ret; in mp2888_read_word_data()
207 ret = data->total_curr_resolution ? ret * 8 : ret * 4; in mp2888_read_word_data()
214 ret = data->total_curr_resolution ? ret : DIV_ROUND_CLOSEST(ret, 2); in mp2888_read_word_data()
225 ret = data->total_curr_resolution ? ret * 2 : ret; in mp2888_read_word_data()
229 * spec. Skip all of them to avoid exposing non-relevant inputs to sysfs. in mp2888_read_word_data()
255 return -ENXIO; in mp2888_read_word_data()
257 return -ENODATA; in mp2888_read_word_data()
271 /* Drop unused bits 15:8. */ in mp2888_write_word_data()
276 word = data->total_curr_resolution ? DIV_ROUND_CLOSEST(word, 8) : in mp2888_write_word_data()
278 /* Drop unused bits 15:10. */ in mp2888_write_word_data()
283 word = data->total_curr_resolution ? DIV_ROUND_CLOSEST(word, 4) : in mp2888_write_word_data()
285 /* Drop unused bits 15:10. */ in mp2888_write_word_data()
289 return -ENODATA; in mp2888_write_word_data()
304 /* Identify multiphase number - could be from 1 to 10. */ in mp2888_identify_multiphase()
309 info->phases[0] = ret & GENMASK(3, 0); in mp2888_identify_multiphase()
312 * The device provides a total of 10 PWM pins, and can be configured to different phase in mp2888_identify_multiphase()
315 if (info->phases[0] > MP2888_MAX_PHASE) in mp2888_identify_multiphase()
316 return -EINVAL; in mp2888_identify_multiphase()
360 data = devm_kzalloc(&client->dev, sizeof(struct mp2888_data), GFP_KERNEL); in mp2888_probe()
362 return -ENOMEM; in mp2888_probe()
364 memcpy(&data->info, &mp2888_info, sizeof(*info)); in mp2888_probe()
365 info = &data->info; in mp2888_probe()