/drivers/iio/adc/ |
D | qcom-vadc-common.c | 115 s64 voltage = 0, result = 0; in qcom_vadc_scale_volt() local 117 qcom_vadc_scale_calib(calib_graph, adc_code, absolute, &voltage); in qcom_vadc_scale_volt() 119 voltage = voltage * prescale->den; in qcom_vadc_scale_volt() 120 result = div64_s64(voltage, prescale->num); in qcom_vadc_scale_volt() 131 s64 voltage = 0, result = 0; in qcom_vadc_scale_therm() local 134 qcom_vadc_scale_calib(calib_graph, adc_code, absolute, &voltage); in qcom_vadc_scale_therm() 137 voltage = div64_s64(voltage, 1000); in qcom_vadc_scale_therm() 141 voltage, &result); in qcom_vadc_scale_therm() 156 s64 voltage = 0; in qcom_vadc_scale_die_temp() local 159 qcom_vadc_scale_calib(calib_graph, adc_code, absolute, &voltage); in qcom_vadc_scale_die_temp() [all …]
|
/drivers/soc/tegra/ |
D | pmc.c | 134 unsigned int voltage; member 1070 enum tegra_io_pad_voltage voltage) in tegra_io_pad_set_voltage() argument 1079 if (pad->voltage == UINT_MAX) in tegra_io_pad_set_voltage() 1086 value |= BIT(pad->voltage); in tegra_io_pad_set_voltage() 1092 if (voltage == TEGRA_IO_PAD_1800000UV) in tegra_io_pad_set_voltage() 1093 value &= ~BIT(pad->voltage); in tegra_io_pad_set_voltage() 1095 value |= BIT(pad->voltage); in tegra_io_pad_set_voltage() 1116 if (pad->voltage == UINT_MAX) in tegra_io_pad_get_voltage() 1121 if ((value & BIT(pad->voltage)) == 0) in tegra_io_pad_get_voltage() 1584 { .id = TEGRA_IO_PAD_AUDIO, .dpd = 17, .voltage = UINT_MAX }, [all …]
|
/drivers/regulator/ |
D | Kconfig | 6 This framework is designed to provide a generic interface to voltage 8 provide voltage and current control to client or consumer drivers and 14 to both voltage regulators (where voltage output is controllable) and 32 tristate "Fixed voltage regulator support" 34 This driver provides support for fixed voltage regulators, 41 This driver provides a virtual consumer for the voltage and 61 This driver supports Marvell 88PM800 voltage regulator chips. 63 the voltage is programmed via I2C interface. 71 This driver supports 88PM8607 voltage regulator chips. 74 tristate "Active-semi act8865 voltage regulator" [all …]
|
D | twl6030-regulator.c | 328 int voltage = 0; in twl6030smps_list_voltage() local 332 voltage = 100000; in twl6030smps_list_voltage() 337 voltage = 0; in twl6030smps_list_voltage() 340 voltage = 1350 * 1000; in twl6030smps_list_voltage() 343 voltage = 1500 * 1000; in twl6030smps_list_voltage() 346 voltage = 1800 * 1000; in twl6030smps_list_voltage() 349 voltage = 1900 * 1000; in twl6030smps_list_voltage() 352 voltage = 2100 * 1000; in twl6030smps_list_voltage() 355 voltage += (600000 + (12500 * (index - 1))); in twl6030smps_list_voltage() 361 voltage = 0; in twl6030smps_list_voltage() [all …]
|
D | pwm-regulator.c | 162 unsigned int voltage; in pwm_regulator_get_voltage() local 166 voltage = pwm_get_relative_duty_cycle(&pstate, duty_unit); in pwm_regulator_get_voltage() 174 voltage = min_uV_duty - voltage; in pwm_regulator_get_voltage() 177 voltage = voltage - min_uV_duty; in pwm_regulator_get_voltage() 181 voltage = DIV_ROUND_CLOSEST_ULL((u64)voltage * diff_uV, diff_duty); in pwm_regulator_get_voltage() 183 return voltage + min_uV; in pwm_regulator_get_voltage()
|
D | helpers.c | 244 int ret, voltage; in regulator_map_voltage_linear() local 269 voltage = rdev->desc->ops->list_voltage(rdev, ret); in regulator_map_voltage_linear() 270 if (voltage < min_uV || voltage > max_uV) in regulator_map_voltage_linear() 292 int voltage, i; in regulator_map_voltage_linear_range() local 331 voltage = rdev->desc->ops->list_voltage(rdev, ret); in regulator_map_voltage_linear_range() 332 if (voltage < min_uV || voltage > max_uV) in regulator_map_voltage_linear_range()
|
/drivers/hwmon/ |
D | ltc4245.c | 177 u32 voltage = 0; in ltc4245_get_voltage() local 182 voltage = regval * 55; in ltc4245_get_voltage() 186 voltage = regval * 22; in ltc4245_get_voltage() 190 voltage = regval * 15; in ltc4245_get_voltage() 194 voltage = regval * -55; in ltc4245_get_voltage() 197 voltage = regval * 10; in ltc4245_get_voltage() 205 return voltage; in ltc4245_get_voltage() 213 unsigned int voltage; in ltc4245_get_current() local 233 voltage = regval * 250; /* voltage in uV */ in ltc4245_get_current() 234 curr = voltage / 50; /* sense resistor 50 mOhm */ in ltc4245_get_current() [all …]
|
D | ltc4215.c | 83 u32 voltage = 0; in ltc4215_get_voltage() local 88 voltage = regval * 151 / 1000; in ltc4215_get_voltage() 92 voltage = regval * 605 / 10; in ltc4215_get_voltage() 99 voltage = regval * 482 * 125 / 1000; in ltc4215_get_voltage() 107 return voltage; in ltc4215_get_voltage() 131 const unsigned int voltage = data->regs[LTC4215_SENSE] * 151; in ltc4215_get_current() local 134 const unsigned int curr = voltage / 4; in ltc4215_get_current() 144 const int voltage = ltc4215_get_voltage(dev, attr->index); in ltc4215_show_voltage() local 146 return snprintf(buf, PAGE_SIZE, "%d\n", voltage); in ltc4215_show_voltage()
|
D | ab8500.c | 82 int voltage, ret; in ab8500_read_sensor() local 90 voltage = ab8500_gpadc_convert(ab8500_data->gpadc, sensor); in ab8500_read_sensor() 91 if (voltage < 0) in ab8500_read_sensor() 92 return voltage; in ab8500_read_sensor() 94 ret = ab8500_voltage_to_temp(&ab8500_data->cfg, voltage, temp); in ab8500_read_sensor()
|
/drivers/thermal/ |
D | devfreq_cooling.c | 180 unsigned long voltage; in get_voltage() local 193 voltage = dev_pm_opp_get_voltage(opp) / 1000; /* mV */ in get_voltage() 196 if (voltage == 0) { in get_voltage() 202 return voltage; in get_voltage() 219 unsigned long voltage; in get_static_power() local 224 voltage = get_voltage(df, freq); in get_static_power() 226 if (voltage == 0) in get_static_power() 229 return dfc->power_ops->get_static_power(df, voltage); in get_static_power() 246 unsigned long voltage) in get_dynamic_power() argument 254 voltage); in get_dynamic_power() [all …]
|
/drivers/power/supply/ |
D | jz4740-battery.c | 45 long voltage; member 73 long voltage; in jz_battery_read_voltage() local 92 voltage = (long)val; in jz_battery_read_voltage() 94 voltage = t ? t : -ETIMEDOUT; in jz_battery_read_voltage() 102 return voltage; in jz_battery_read_voltage() 109 long voltage; in jz_battery_get_capacity() local 113 voltage = jz_battery_read_voltage(jz_battery); in jz_battery_get_capacity() 115 if (voltage < 0) in jz_battery_get_capacity() 116 return voltage; in jz_battery_get_capacity() 119 ret = ((voltage - info->voltage_min_design) * 100) / voltage_span; in jz_battery_get_capacity() [all …]
|
D | twl4030_madc_battery.c | 86 if (volt > calibration[0].voltage) { in twl4030_madc_bat_voltscale() 89 for (i = 0; calibration[i+1].voltage >= 0; i++) { in twl4030_madc_bat_voltscale() 90 if (volt <= calibration[i].voltage && in twl4030_madc_bat_voltscale() 91 volt >= calibration[i+1].voltage) { in twl4030_madc_bat_voltscale() 94 ((calibration[i].voltage - volt) * in twl4030_madc_bat_voltscale() 97 (calibration[i].voltage - in twl4030_madc_bat_voltscale() 98 calibration[i+1].voltage); in twl4030_madc_bat_voltscale() 187 return ((struct twl4030_madc_bat_calibration *)b)->voltage - in twl4030_cmp() 188 ((struct twl4030_madc_bat_calibration *)a)->voltage; in twl4030_cmp()
|
D | rx51_battery.c | 56 int voltage = rx51_battery_read_adc(di->channel_vbat); in rx51_battery_read_voltage() local 58 if (voltage < 0) { in rx51_battery_read_voltage() 59 dev_err(di->dev, "Could not read ADC: %d\n", voltage); in rx51_battery_read_voltage() 60 return voltage; in rx51_battery_read_voltage() 63 return 1000 * (10000 * voltage / 1705); in rx51_battery_read_voltage()
|
D | cpcap-battery.c | 97 int voltage; member 375 if (state->voltage >= (ddata->config.info.voltage_max_design - 4000)) in cpcap_battery_full() 399 state.voltage = cpcap_battery_get_voltage(ddata); in cpcap_battery_update_status() 498 tmp = (latest->voltage / 10000) * latest->current_ua; in cpcap_battery_get_property() 504 tmp *= (latest->voltage / 10000); in cpcap_battery_get_property() 512 tmp *= ((latest->voltage + previous->voltage) / 20000); in cpcap_battery_get_property() 518 else if (latest->voltage >= 3750000) in cpcap_battery_get_property() 520 else if (latest->voltage >= 3300000) in cpcap_battery_get_property() 522 else if (latest->voltage > 3100000) in cpcap_battery_get_property() 524 else if (latest->voltage <= 3100000) in cpcap_battery_get_property()
|
/drivers/leds/ |
D | leds-regulator.c | 36 int voltage = regulator_list_voltage(supply, 0); in led_regulator_get_max_brightness() local 38 if (voltage <= 0) in led_regulator_get_max_brightness() 45 ret = regulator_set_voltage(supply, voltage, voltage); in led_regulator_get_max_brightness() 98 int voltage; in regulator_led_brightness_set() local 109 voltage = led_regulator_get_voltage(led->vcc, value); in regulator_led_brightness_set() 111 value, voltage); in regulator_led_brightness_set() 113 ret = regulator_set_voltage(led->vcc, voltage, voltage); in regulator_led_brightness_set() 116 voltage, ret); in regulator_led_brightness_set()
|
/drivers/media/pci/ddbridge/ |
D | ddbridge-maxs8.c | 152 enum fe_sec_voltage voltage) in lnb_set_voltage() argument 156 if (dev->link[link].lnb.oldvoltage[input] == voltage) in lnb_set_voltage() 158 switch (voltage) { in lnb_set_voltage() 160 if (dev->link[link].lnb.voltage[input]) in lnb_set_voltage() 174 dev->link[link].lnb.oldvoltage[input] = voltage; in lnb_set_voltage() 191 dev->link[port->lnr].lnb.voltage[dvb->input & 3] & bit; in max_set_input_unlocked() 193 dev->link[port->lnr].lnb.voltage[dvb->input & 3] &= ~bit; in max_set_input_unlocked() 195 dev->link[port->lnr].lnb.voltage[dvb->input & 3] |= obit; in max_set_input_unlocked() 224 if (dvb->voltage == SEC_VOLTAGE_18) in max_set_tone() 229 if (dvb->voltage == SEC_VOLTAGE_18) in max_set_tone() [all …]
|
/drivers/w1/slaves/ |
D | w1_ds2438.c | 190 int adc_input, uint16_t *voltage) in w1_ds2438_get_voltage() argument 226 …*voltage = (((uint16_t) w1_buf[DS2438_VOLTAGE_MSB]) << 8) | ((uint16_t) w1_buf[DS2438_VOLTAGE_LSB]… in w1_ds2438_get_voltage() 238 static int w1_ds2438_get_current(struct w1_slave *sl, int16_t *voltage) in w1_ds2438_get_current() argument 247 *voltage = (((int16_t) w1_buf[DS2438_CURRENT_MSB]) << 8) | ((int16_t) w1_buf[DS2438_CURRENT_LSB]); in w1_ds2438_get_current() 285 int16_t voltage; in iad_read() local 292 if (w1_ds2438_get_current(sl, &voltage) == 0) { in iad_read() 293 ret = snprintf(buf, count, "%i\n", voltage); in iad_read() 357 uint16_t voltage; in vad_read() local 364 if (w1_ds2438_get_voltage(sl, DS2438_ADC_INPUT_VAD, &voltage) == 0) { in vad_read() 365 ret = snprintf(buf, count, "%u\n", voltage); in vad_read() [all …]
|
/drivers/gpu/drm/nouveau/nvkm/subdev/clk/ |
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 = 9, [all …]
|
D | base.c | 84 int voltage; in nvkm_cstate_valid() local 104 voltage = nvkm_volt_map(volt, cstate->voltage, temp); in nvkm_cstate_valid() 105 if (voltage < 0) in nvkm_cstate_valid() 107 return voltage <= min(max_volt, volt->max_uv); in nvkm_cstate_valid() 186 ret = nvkm_volt_set_id(volt, cstate->voltage, in nvkm_cstate_prog() 187 pstate->base.voltage, clk->temp, +1); in nvkm_cstate_prog() 201 ret = nvkm_volt_set_id(volt, cstate->voltage, in nvkm_cstate_prog() 202 pstate->base.voltage, clk->temp, -1); in nvkm_cstate_prog() 238 if (volt && nvkm_volt_map_min(volt, cstepX.voltage) > volt->max_uv) in nvkm_cstate_new() 246 cstate->voltage = cstepX.voltage; in nvkm_cstate_new() [all …]
|
D | gm20b.c | 476 clk->new_uv = volt->vid[cstate->voltage].uv; in gm20b_clk_calc() 642 .voltage = 0, 648 .voltage = 1, 654 .voltage = 2, 660 .voltage = 3, 666 .voltage = 4, 672 .voltage = 5, 678 .voltage = 6, 684 .voltage = 7, 690 .voltage = 8, [all …]
|
/drivers/media/usb/ttusb-dec/ |
D | ttusbdecfe.c | 33 u8 voltage; member 140 lnb_voltage = htonl(state->voltage); in ttusbdecfe_dvbs_set_frontend() 180 enum fe_sec_voltage voltage) in ttusbdecfe_dvbs_set_voltage() argument 184 switch (voltage) { in ttusbdecfe_dvbs_set_voltage() 186 state->voltage = 13; in ttusbdecfe_dvbs_set_voltage() 189 state->voltage = 18; in ttusbdecfe_dvbs_set_voltage() 237 state->voltage = 0; in ttusbdecfe_dvbs_attach()
|
/drivers/gpu/drm/radeon/ |
D | rs600.c | 221 struct radeon_voltage *voltage = &ps->clock_info[0].voltage; in rs600_pm_misc() local 225 if ((voltage->type == VOLTAGE_GPIO) && (voltage->gpio.valid)) { in rs600_pm_misc() 227 tmp = RREG32(voltage->gpio.reg); in rs600_pm_misc() 228 if (voltage->active_high) in rs600_pm_misc() 229 tmp |= voltage->gpio.mask; in rs600_pm_misc() 231 tmp &= ~(voltage->gpio.mask); in rs600_pm_misc() 232 WREG32(voltage->gpio.reg, tmp); in rs600_pm_misc() 233 if (voltage->delay) in rs600_pm_misc() 234 udelay(voltage->delay); in rs600_pm_misc() 236 tmp = RREG32(voltage->gpio.reg); in rs600_pm_misc() [all …]
|
/drivers/input/keyboard/ |
D | sun4i-lradc-keys.c | 67 u32 voltage; member 85 u32 i, ints, val, voltage, diff, keycode = 0, closest = 0xffffffff; in sun4i_lradc_irq() local 101 voltage = val * lradc->vref / 63; in sun4i_lradc_irq() 104 diff = abs(lradc->chan0_map[i].voltage - voltage); in sun4i_lradc_irq() 192 error = of_property_read_u32(pp, "voltage", &map->voltage); in sun4i_lradc_load_dt_keymap()
|
/drivers/soc/imx/ |
D | gpcv2.c | 68 const int voltage; member 172 .voltage = 1000000, 184 .voltage = 1000000, 196 .voltage = 1200000, 217 domain->voltage, domain->voltage); in imx7_pgc_domain_probe()
|
/drivers/mfd/ |
D | rts5249.c | 36 static void rts5249_fill_driving(struct rtsx_pcr *pcr, u8 voltage) in rts5249_fill_driving() argument 52 if (voltage == OUTPUT_3V3) { in rts5249_fill_driving() 250 static int rtsx_base_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage) in rtsx_base_switch_output_voltage() argument 255 switch (voltage) { in rtsx_base_switch_output_voltage() 278 pcr_dbg(pcr, "unknown output voltage %d\n", voltage); in rtsx_base_switch_output_voltage() 284 rts5249_fill_driving(pcr, voltage); in rtsx_base_switch_output_voltage() 493 static int rts525a_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage) in rts525a_switch_output_voltage() argument 495 switch (voltage) { in rts525a_switch_output_voltage() 512 rts5249_fill_driving(pcr, voltage); in rts525a_switch_output_voltage()
|