Lines Matching +full:light +full:- +full:to +full:- +full:digital
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Hardware monitoring driver for MPS Multi-phase Digital VR Controllers
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()
114 * assembly. By default it is set to 1kΩ. In case of different assembly, user should in mp2888_read_phase()
116 * If phase current resolution bit is set to 1, READ_CSx value should be doubled. in mp2888_read_phase()
119 * light load. in mp2888_read_phase()
121 ret = DIV_ROUND_CLOSEST(ret * 200 - 19600, data->curr_sense_gain); in mp2888_read_phase()
122 /* Scale according to total current resolution. */ in mp2888_read_phase()
123 ret = (data->total_curr_resolution) ? ret * 2 : ret; in mp2888_read_phase()
149 return -ENODATA; in mp2888_read_phases()
167 * READ_VIN requires fixup to scale it to linear11 format. Register data format in mp2888_read_word_data()
179 * degrees C - scaling is needed to match both. in mp2888_read_word_data()
195 ret = data->total_curr_resolution ? ret * 2 : ret; in mp2888_read_word_data()
205 * Scaling is needed to match both. 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()
223 * is needed to match both. in mp2888_read_word_data()
225 ret = data->total_curr_resolution ? ret * 2 : ret; in mp2888_read_word_data()
228 * The below registers are not implemented by device or implemented not according to the 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()
275 /* Fix limit according to total curent resolution. */ in mp2888_write_word_data()
276 word = data->total_curr_resolution ? DIV_ROUND_CLOSEST(word, 8) : in mp2888_write_word_data()
282 /* Fix limit according to total curent resolution. */ in mp2888_write_word_data()
283 word = data->total_curr_resolution ? DIV_ROUND_CLOSEST(word, 4) : 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()