/kernel/linux/linux-5.10/drivers/iio/adc/ |
H A D | qcom-vadc-common.c | 388 s64 voltage = 0, result = 0; in qcom_vadc_scale_volt() local 390 qcom_vadc_scale_calib(calib_graph, adc_code, absolute, &voltage); in qcom_vadc_scale_volt() 392 voltage = voltage * prescale->den; in qcom_vadc_scale_volt() 393 result = div64_s64(voltage, prescale->num); in qcom_vadc_scale_volt() 404 s64 voltage = 0; in qcom_vadc_scale_therm() local 407 qcom_vadc_scale_calib(calib_graph, adc_code, absolute, &voltage); in qcom_vadc_scale_therm() 410 voltage = div64_s64(voltage, 1000); in qcom_vadc_scale_therm() 414 voltage, result_mde in qcom_vadc_scale_therm() 428 s64 voltage = 0; qcom_vadc_scale_die_temp() local 451 s64 voltage = 0, result = 0; qcom_vadc_scale_chg_temp() local 470 s64 voltage, temp, adc_vdd_ref_mv = 1875; qcom_vadc_scale_code_voltage_factor() local 537 int voltage; qcom_vadc_scale_hw_calib_therm() local 566 int voltage, vtemp0, temp, i; qcom_vadc7_scale_hw_calib_die_temp() local [all...] |
/kernel/linux/linux-6.6/drivers/iio/adc/ |
H A D | qcom-vadc-common.c | 16 * @y: Represent the physical data which can be temperature, voltage, 413 s64 voltage = 0, result = 0; in qcom_vadc_scale_volt() local 415 qcom_vadc_scale_calib(calib_graph, adc_code, absolute, &voltage); in qcom_vadc_scale_volt() 417 voltage *= prescale->denominator; in qcom_vadc_scale_volt() 418 result = div64_s64(voltage, prescale->numerator); in qcom_vadc_scale_volt() 429 s64 voltage = 0; in qcom_vadc_scale_therm() local 432 qcom_vadc_scale_calib(calib_graph, adc_code, absolute, &voltage); in qcom_vadc_scale_therm() 435 voltage = div64_s64(voltage, 1000); in qcom_vadc_scale_therm() 439 voltage, result_mde in qcom_vadc_scale_therm() 451 s64 voltage = 0; qcom_vadc_scale_die_temp() local 474 s64 voltage = 0, result = 0; qcom_vadc_scale_chg_temp() local 489 qcom_vadc_scale_voltage_code(s32 voltage, const struct u32_fract *prescale, const u32 full_scale_code_volt, unsigned int factor) qcom_vadc_scale_voltage_code() argument 508 s64 voltage, temp, adc_vdd_ref_mv = 1875; qcom_vadc_scale_code_voltage_factor() local 575 int voltage; qcom_vadc_scale_hw_calib_therm() local 604 int voltage; qcom_vadc7_scale_hw_calib_die_temp() local 671 s32 voltage; qcom_adc_tm5_temp_volt_scale() local [all...] |
/kernel/linux/linux-5.10/drivers/hwmon/ |
H A D | ltc4245.c | 109 /* Read the GPIO voltage from the GPIOADC register */ in ltc4245_update_gpios() 148 /* Read voltage registers -- 0x10 to 0x1c */ in ltc4245_update_device() 169 /* Return the voltage from the given register in millivolts */ 174 u32 voltage = 0; in ltc4245_get_voltage() local 179 voltage = regval * 55; in ltc4245_get_voltage() 183 voltage = regval * 22; in ltc4245_get_voltage() 187 voltage = regval * 15; in ltc4245_get_voltage() 191 voltage = regval * -55; in ltc4245_get_voltage() 194 voltage = regval * 10; in ltc4245_get_voltage() 202 return voltage; in ltc4245_get_voltage() 210 unsigned int voltage; ltc4245_get_current() local 318 long voltage; ltc4245_read_power() local [all...] |
H A D | ads7871.c | 133 static SENSOR_DEVICE_ATTR_RO(in0_input, voltage, 0); 134 static SENSOR_DEVICE_ATTR_RO(in1_input, voltage, 1); 135 static SENSOR_DEVICE_ATTR_RO(in2_input, voltage, 2); 136 static SENSOR_DEVICE_ATTR_RO(in3_input, voltage, 3); 137 static SENSOR_DEVICE_ATTR_RO(in4_input, voltage, 4); 138 static SENSOR_DEVICE_ATTR_RO(in5_input, voltage, 5); 139 static SENSOR_DEVICE_ATTR_RO(in6_input, voltage, 6); 140 static SENSOR_DEVICE_ATTR_RO(in7_input, voltage, 7);
|
H A D | ltc4215.c | 75 /* Return the voltage from the given register in millivolts */ 80 u32 voltage = 0; in ltc4215_get_voltage() local 85 voltage = regval * 151 / 1000; in ltc4215_get_voltage() 89 voltage = regval * 605 / 10; in ltc4215_get_voltage() 96 voltage = regval * 482 * 125 / 1000; in ltc4215_get_voltage() 104 return voltage; in ltc4215_get_voltage() 117 * Step 2: convert voltage to milliAmperes in ltc4215_get_current() 123 * the voltage and resistance by 10, to shift the decimal point. in ltc4215_get_current() 127 /* Calculate voltage in microVolts (151 uV per increment) */ in ltc4215_get_current() 128 const unsigned int voltage in ltc4215_get_current() local 140 const int voltage = ltc4215_get_voltage(dev, attr->index); ltc4215_voltage_show() local [all...] |
/kernel/linux/linux-6.6/drivers/hwmon/ |
H A D | ltc4245.c | 109 /* Read the GPIO voltage from the GPIOADC register */ in ltc4245_update_gpios() 148 /* Read voltage registers -- 0x10 to 0x1c */ in ltc4245_update_device() 169 /* Return the voltage from the given register in millivolts */ 174 u32 voltage = 0; in ltc4245_get_voltage() local 179 voltage = regval * 55; in ltc4245_get_voltage() 183 voltage = regval * 22; in ltc4245_get_voltage() 187 voltage = regval * 15; in ltc4245_get_voltage() 191 voltage = regval * -55; in ltc4245_get_voltage() 194 voltage = regval * 10; in ltc4245_get_voltage() 202 return voltage; in ltc4245_get_voltage() 210 unsigned int voltage; ltc4245_get_current() local 318 long voltage; ltc4245_read_power() local [all...] |
H A D | ads7871.c | 133 static SENSOR_DEVICE_ATTR_RO(in0_input, voltage, 0); 134 static SENSOR_DEVICE_ATTR_RO(in1_input, voltage, 1); 135 static SENSOR_DEVICE_ATTR_RO(in2_input, voltage, 2); 136 static SENSOR_DEVICE_ATTR_RO(in3_input, voltage, 3); 137 static SENSOR_DEVICE_ATTR_RO(in4_input, voltage, 4); 138 static SENSOR_DEVICE_ATTR_RO(in5_input, voltage, 5); 139 static SENSOR_DEVICE_ATTR_RO(in6_input, voltage, 6); 140 static SENSOR_DEVICE_ATTR_RO(in7_input, voltage, 7);
|
H A D | ltc4215.c | 75 /* Return the voltage from the given register in millivolts */ 80 u32 voltage = 0; in ltc4215_get_voltage() local 85 voltage = regval * 151 / 1000; in ltc4215_get_voltage() 89 voltage = regval * 605 / 10; in ltc4215_get_voltage() 96 voltage = regval * 482 * 125 / 1000; in ltc4215_get_voltage() 104 return voltage; in ltc4215_get_voltage() 117 * Step 2: convert voltage to milliAmperes in ltc4215_get_current() 123 * the voltage and resistance by 10, to shift the decimal point. in ltc4215_get_current() 127 /* Calculate voltage in microVolts (151 uV per increment) */ in ltc4215_get_current() 128 const unsigned int voltage in ltc4215_get_current() local 140 const int voltage = ltc4215_get_voltage(dev, attr->index); ltc4215_voltage_show() local [all...] |
/kernel/linux/linux-5.10/drivers/thermal/ |
H A D | devfreq_cooling.c | 138 unsigned long voltage; in get_voltage() local 151 voltage = dev_pm_opp_get_voltage(opp) / 1000; /* mV */ in get_voltage() 154 if (voltage == 0) { in get_voltage() 156 "Failed to get voltage for frequency %lu\n", in get_voltage() 160 return voltage; in get_voltage() 169 * get_static_power(). The current voltage is calculated using the 177 unsigned long voltage; in get_static_power() local 182 voltage = get_voltage(df, freq); in get_static_power() 184 if (voltage == 0) in get_static_power() 187 return dfc->power_ops->get_static_power(df, voltage); in get_static_power() 203 get_dynamic_power(struct devfreq_cooling_device *dfc, unsigned long freq, unsigned long voltage) get_dynamic_power() argument 222 get_total_power(struct devfreq_cooling_device *dfc, unsigned long freq, unsigned long voltage) get_total_power() argument 239 unsigned long voltage; devfreq_cooling_get_requested_power() local 401 unsigned long power, voltage; devfreq_cooling_gen_tables() local [all...] |
/kernel/linux/linux-5.10/drivers/leds/ |
H A D | leds-regulator.c | 32 int voltage = regulator_list_voltage(supply, 0); in led_regulator_get_max_brightness() local 34 if (voltage <= 0) in led_regulator_get_max_brightness() 41 ret = regulator_set_voltage(supply, voltage, voltage); in led_regulator_get_max_brightness() 94 int voltage; in regulator_led_brightness_set() local 105 voltage = led_regulator_get_voltage(led->vcc, value); in regulator_led_brightness_set() 106 dev_dbg(led->cdev.dev, "brightness: %d voltage: %d\n", in regulator_led_brightness_set() 107 value, voltage); in regulator_led_brightness_set() 109 ret = regulator_set_voltage(led->vcc, voltage, voltage); in regulator_led_brightness_set() [all...] |
/kernel/linux/linux-6.6/drivers/leds/ |
H A D | leds-regulator.c | 33 int voltage = regulator_list_voltage(supply, 0); in led_regulator_get_max_brightness() local 35 if (voltage <= 0) in led_regulator_get_max_brightness() 42 ret = regulator_set_voltage(supply, voltage, voltage); in led_regulator_get_max_brightness() 95 int voltage; in regulator_led_brightness_set() local 106 voltage = led_regulator_get_voltage(led->vcc, value); in regulator_led_brightness_set() 107 dev_dbg(led->cdev.dev, "brightness: %d voltage: %d\n", in regulator_led_brightness_set() 108 value, voltage); in regulator_led_brightness_set() 110 ret = regulator_set_voltage(led->vcc, voltage, voltage); in regulator_led_brightness_set() [all...] |
/kernel/linux/linux-5.10/drivers/regulator/ |
H A D | twl6030-regulator.c | 38 /* data passed from board for external get/set voltage */ 317 int voltage = 0; in twl6030smps_list_voltage() local 321 voltage = 100000; in twl6030smps_list_voltage() 326 voltage = 0; in twl6030smps_list_voltage() 329 voltage = 1350 * 1000; in twl6030smps_list_voltage() 332 voltage = 1500 * 1000; in twl6030smps_list_voltage() 335 voltage = 1800 * 1000; in twl6030smps_list_voltage() 338 voltage = 1900 * 1000; in twl6030smps_list_voltage() 341 voltage = 2100 * 1000; in twl6030smps_list_voltage() 344 voltage in twl6030smps_list_voltage() [all...] |
/kernel/linux/linux-6.6/drivers/regulator/ |
H A D | twl6030-regulator.c | 37 /* data passed from board for external get/set voltage */ 316 int voltage = 0; in twl6030smps_list_voltage() local 320 voltage = 100000; in twl6030smps_list_voltage() 325 voltage = 0; in twl6030smps_list_voltage() 328 voltage = 1350 * 1000; in twl6030smps_list_voltage() 331 voltage = 1500 * 1000; in twl6030smps_list_voltage() 334 voltage = 1800 * 1000; in twl6030smps_list_voltage() 337 voltage = 1900 * 1000; in twl6030smps_list_voltage() 340 voltage = 2100 * 1000; in twl6030smps_list_voltage() 343 voltage in twl6030smps_list_voltage() [all...] |
H A D | pwm-regulator.c | 156 unsigned int voltage; in pwm_regulator_get_voltage() local 160 voltage = pwm_get_relative_duty_cycle(&pstate, duty_unit); in pwm_regulator_get_voltage() 161 if (voltage < min(max_uV_duty, min_uV_duty) || in pwm_regulator_get_voltage() 162 voltage > max(max_uV_duty, min_uV_duty)) in pwm_regulator_get_voltage() 171 voltage = min_uV_duty - voltage; in pwm_regulator_get_voltage() 174 voltage = voltage - min_uV_duty; in pwm_regulator_get_voltage() 178 voltage = DIV_ROUND_CLOSEST_ULL((u64)voltage * diff_u in pwm_regulator_get_voltage() [all...] |
/kernel/linux/linux-5.10/drivers/w1/slaves/ |
H A D | w1_ds2438.c | 188 int adc_input, uint16_t *voltage) in w1_ds2438_get_voltage() 224 *voltage = (((uint16_t) w1_buf[DS2438_VOLTAGE_MSB]) << 8) | ((uint16_t) w1_buf[DS2438_VOLTAGE_LSB]); in w1_ds2438_get_voltage() 236 static int w1_ds2438_get_current(struct w1_slave *sl, int16_t *voltage) in w1_ds2438_get_current() argument 244 /* The voltage measured across current sense resistor RSENS. */ in w1_ds2438_get_current() 245 *voltage = (((int16_t) w1_buf[DS2438_CURRENT_MSB]) << 8) | ((int16_t) w1_buf[DS2438_CURRENT_LSB]); in w1_ds2438_get_current() 283 int16_t voltage; in iad_read() local 290 if (w1_ds2438_get_current(sl, &voltage) == 0) { in iad_read() 291 ret = snprintf(buf, count, "%i\n", voltage); in iad_read() 355 uint16_t voltage; in vad_read() local 362 if (w1_ds2438_get_voltage(sl, DS2438_ADC_INPUT_VAD, &voltage) in vad_read() 187 w1_ds2438_get_voltage(struct w1_slave *sl, int adc_input, uint16_t *voltage) w1_ds2438_get_voltage() argument 376 uint16_t voltage; vdd_read() local [all...] |
/kernel/linux/linux-5.10/drivers/power/supply/ |
H A D | twl4030_madc_battery.c | 87 if (volt > calibration[0].voltage) { in twl4030_madc_bat_voltscale() 90 for (i = 0; calibration[i+1].voltage >= 0; i++) { in twl4030_madc_bat_voltscale() 91 if (volt <= calibration[i].voltage && in twl4030_madc_bat_voltscale() 92 volt >= calibration[i+1].voltage) { in twl4030_madc_bat_voltscale() 95 ((calibration[i].voltage - volt) * in twl4030_madc_bat_voltscale() 98 (calibration[i].voltage - in twl4030_madc_bat_voltscale() 99 calibration[i+1].voltage); in twl4030_madc_bat_voltscale() 188 return ((struct twl4030_madc_bat_calibration *)b)->voltage - in twl4030_cmp() 189 ((struct twl4030_madc_bat_calibration *)a)->voltage; in twl4030_cmp()
|
H A D | cpcap-charger.c | 49 #define CPCAP_REG_CRM_VCHRG3 BIT(7) /* Charge voltage bits */ 149 int voltage; member 240 val->intval = ddata->voltage; in cpcap_charger_get_property() 266 static int cpcap_charger_match_voltage(int voltage) in cpcap_charger_match_voltage() argument 268 switch (voltage) { in cpcap_charger_match_voltage() 294 int voltage = ddata->voltage; in cpcap_charger_get_bat_const_charge_voltage() local 303 voltage = prop.intval; in cpcap_charger_get_bat_const_charge_voltage() 308 return voltage; in cpcap_charger_get_bat_const_charge_voltage() 316 int voltage, batvol in cpcap_charger_set_property() local 565 cpcap_charger_voltage_to_regval(int voltage) cpcap_charger_voltage_to_regval() argument [all...] |
/kernel/linux/linux-6.6/drivers/power/supply/ |
H A D | twl4030_madc_battery.c | 87 if (volt > calibration[0].voltage) { in twl4030_madc_bat_voltscale() 90 for (i = 0; calibration[i+1].voltage >= 0; i++) { in twl4030_madc_bat_voltscale() 91 if (volt <= calibration[i].voltage && in twl4030_madc_bat_voltscale() 92 volt >= calibration[i+1].voltage) { in twl4030_madc_bat_voltscale() 95 ((calibration[i].voltage - volt) * in twl4030_madc_bat_voltscale() 98 (calibration[i].voltage - in twl4030_madc_bat_voltscale() 99 calibration[i+1].voltage); in twl4030_madc_bat_voltscale() 182 return ((struct twl4030_madc_bat_calibration *)b)->voltage - in twl4030_cmp() 183 ((struct twl4030_madc_bat_calibration *)a)->voltage; in twl4030_cmp()
|
H A D | cpcap-charger.c | 49 #define CPCAP_REG_CRM_VCHRG3 BIT(7) /* Charge voltage bits */ 143 int voltage; member 222 val->intval = ddata->voltage; in cpcap_charger_get_property() 248 static int cpcap_charger_match_voltage(int voltage) in cpcap_charger_match_voltage() argument 250 switch (voltage) { in cpcap_charger_match_voltage() 276 int voltage = ddata->voltage; in cpcap_charger_get_bat_const_charge_voltage() local 285 voltage = prop.intval; in cpcap_charger_get_bat_const_charge_voltage() 290 return voltage; in cpcap_charger_get_bat_const_charge_voltage() 318 int voltage, batvol in cpcap_charger_set_property() local 569 cpcap_charger_voltage_to_regval(int voltage) cpcap_charger_voltage_to_regval() argument [all...] |
H A D | cpcap-battery.c | 116 int voltage; member 515 * The full battery voltage here can be inaccurate, it's used just to in cpcap_battery_full() 521 if (ddata->is_full && state->voltage < vfull) in cpcap_battery_full() 532 if (state->current_ua > 0 && (state->voltage <= 3350000 || is_low)) in cpcap_battery_low() 559 state.voltage = cpcap_battery_get_voltage(ddata); in cpcap_battery_update_status() 577 if (empty->voltage && empty->voltage != -1) { in cpcap_battery_update_status() 578 empty->voltage = -1; in cpcap_battery_update_status() 582 empty->voltage = -1; in cpcap_battery_update_status() 591 if (full->voltage) { in cpcap_battery_update_status() [all...] |
/kernel/linux/linux-5.10/drivers/media/pci/ddbridge/ |
H A D | ddbridge-max.c | 153 enum fe_sec_voltage voltage) in lnb_set_voltage() 157 if (dev->link[link].lnb.oldvoltage[input] == voltage) in lnb_set_voltage() 159 switch (voltage) { in lnb_set_voltage() 161 if (dev->link[link].lnb.voltage[input]) in lnb_set_voltage() 175 dev->link[link].lnb.oldvoltage[input] = voltage; in lnb_set_voltage() 192 dev->link[port->lnr].lnb.voltage[dvb->input & 3] & bit; in max_set_input_unlocked() 194 dev->link[port->lnr].lnb.voltage[dvb->input & 3] &= ~bit; in max_set_input_unlocked() 196 dev->link[port->lnr].lnb.voltage[dvb->input & 3] |= obit; in max_set_input_unlocked() 225 if (dvb->voltage == SEC_VOLTAGE_18) in max_set_tone() 230 if (dvb->voltage in max_set_tone() 152 lnb_set_voltage(struct ddb *dev, u32 link, u32 input, enum fe_sec_voltage voltage) lnb_set_voltage() argument 240 max_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage) max_set_voltage() argument [all...] |
/kernel/linux/linux-6.6/drivers/media/pci/ddbridge/ |
H A D | ddbridge-max.c | 144 enum fe_sec_voltage voltage) in lnb_set_voltage() 148 if (dev->link[link].lnb.oldvoltage[input] == voltage) in lnb_set_voltage() 150 switch (voltage) { in lnb_set_voltage() 152 if (dev->link[link].lnb.voltage[input]) in lnb_set_voltage() 166 dev->link[link].lnb.oldvoltage[input] = voltage; in lnb_set_voltage() 183 dev->link[port->lnr].lnb.voltage[dvb->input & 3] & bit; in max_set_input_unlocked() 185 dev->link[port->lnr].lnb.voltage[dvb->input & 3] &= ~bit; in max_set_input_unlocked() 187 dev->link[port->lnr].lnb.voltage[dvb->input & 3] |= obit; in max_set_input_unlocked() 216 if (dvb->voltage == SEC_VOLTAGE_18) in max_set_tone() 221 if (dvb->voltage in max_set_tone() 143 lnb_set_voltage(struct ddb *dev, u32 link, u32 input, enum fe_sec_voltage voltage) lnb_set_voltage() argument 231 max_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage) max_set_voltage() argument [all...] |
/kernel/linux/linux-6.6/drivers/devfreq/ |
H A D | mtk-cci-devfreq.c | 43 int pre_voltage, pre_vsram, new_vsram, vsram, voltage, ret; in mtk_ccifreq_set_voltage() local 78 voltage = new_voltage; in mtk_ccifreq_set_voltage() 80 voltage = vsram - soc_data->min_volt_shift; in mtk_ccifreq_set_voltage() 82 ret = regulator_set_voltage(drv->proc_reg, voltage, in mtk_ccifreq_set_voltage() 90 voltage = max(new_voltage, in mtk_ccifreq_set_voltage() 92 ret = regulator_set_voltage(drv->proc_reg, voltage, in mtk_ccifreq_set_voltage() 97 if (voltage == new_voltage) in mtk_ccifreq_set_voltage() 101 voltage + soc_data->min_volt_shift); in mtk_ccifreq_set_voltage() 112 pre_voltage = voltage; in mtk_ccifreq_set_voltage() 117 "over loop count, failed to set voltage\ in mtk_ccifreq_set_voltage() 132 int voltage, pre_voltage, inter_voltage, target_voltage, ret; mtk_ccifreq_target() local [all...] |
/kernel/linux/linux-5.10/drivers/gpu/drm/nouveau/nvkm/subdev/clk/ |
H A D | gk20a.c | 370 .voltage = 0, 376 .voltage = 1, 382 .voltage = 2, 388 .voltage = 3, 394 .voltage = 4, 400 .voltage = 5, 406 .voltage = 6, 412 .voltage = 7, 418 .voltage = 8, 424 .voltage [all...] |
/kernel/linux/linux-6.6/drivers/gpu/drm/nouveau/nvkm/subdev/clk/ |
H A D | gk20a.c | 370 .voltage = 0, 376 .voltage = 1, 382 .voltage = 2, 388 .voltage = 3, 394 .voltage = 4, 400 .voltage = 5, 406 .voltage = 6, 412 .voltage = 7, 418 .voltage = 8, 424 .voltage [all...] |