/drivers/power/supply/ |
D | apm_power.c | 59 if (bp->full.intval > bp->max_charge) { in __find_main_battery() 61 bp->max_charge = bp->full.intval; in __find_main_battery() 65 if (bp->full.intval > bp->max_energy) { in __find_main_battery() 67 bp->max_energy = bp->full.intval; in __find_main_battery() 94 if (bp.max_energy > bp.max_charge * bp.full.intval) in find_main_battery() 100 if (bp.max_charge > bp.max_energy / bp.full.intval) in find_main_battery() 137 if (!I.intval) in do_calculate_time() 179 empty.intval = 0; in do_calculate_time() 189 return ((cur.intval - full.intval) * 60L) / I.intval; in do_calculate_time() 191 return -((cur.intval - empty.intval) * 60L) / I.intval; in do_calculate_time() [all …]
|
D | olpc_battery.c | 77 val->intval = !!(status & BAT_STAT_AC); in olpc_ac_get_prop() 103 val->intval = POWER_SUPPLY_STATUS_CHARGING; in olpc_bat_get_status() 105 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in olpc_bat_get_status() 107 val->intval = POWER_SUPPLY_STATUS_FULL; in olpc_bat_get_status() 109 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in olpc_bat_get_status() 113 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in olpc_bat_get_status() 115 val->intval = POWER_SUPPLY_STATUS_FULL; in olpc_bat_get_status() 117 val->intval = POWER_SUPPLY_STATUS_CHARGING; in olpc_bat_get_status() 134 val->intval = POWER_SUPPLY_HEALTH_GOOD; in olpc_bat_get_health() 138 val->intval = POWER_SUPPLY_HEALTH_OVERHEAT; in olpc_bat_get_health() [all …]
|
D | sbs-battery.c | 446 static int sbs_status_correct(struct i2c_client *client, int *intval) in sbs_status_correct() argument 457 if (*intval != POWER_SUPPLY_STATUS_FULL && ret == 0) in sbs_status_correct() 458 *intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in sbs_status_correct() 460 if (*intval == POWER_SUPPLY_STATUS_FULL) { in sbs_status_correct() 463 *intval = POWER_SUPPLY_STATUS_CHARGING; in sbs_status_correct() 465 *intval = POWER_SUPPLY_STATUS_DISCHARGING; in sbs_status_correct() 496 val->intval = 0; /* battery removed */ in sbs_get_ti_battery_presence_and_health() 503 val->intval = 0; /* battery removed */ in sbs_get_ti_battery_presence_and_health() 509 val->intval = 0; in sbs_get_ti_battery_presence_and_health() 521 val->intval = 0; in sbs_get_ti_battery_presence_and_health() [all …]
|
D | axp20x_usb_power.c | 190 val->intval = AXP20X_VBUS_VHOLD_uV(v); in axp20x_usb_power_get_property() 195 &val->intval); in axp20x_usb_power_get_property() 203 val->intval *= 1000; in axp20x_usb_power_get_property() 212 val->intval = ret * 1700; /* 1 step = 1.7 mV */ in axp20x_usb_power_get_property() 216 return axp813_get_current_max(power, &val->intval); in axp20x_usb_power_get_property() 217 return axp20x_get_current_max(power, &val->intval); in axp20x_usb_power_get_property() 221 &val->intval); in axp20x_usb_power_get_property() 229 val->intval *= 1000; in axp20x_usb_power_get_property() 238 val->intval = ret * 375; /* 1 step = 0.375 mA */ in axp20x_usb_power_get_property() 252 val->intval = POWER_SUPPLY_HEALTH_UNKNOWN; in axp20x_usb_power_get_property() [all …]
|
D | axp20x_ac_power.c | 75 val->intval = POWER_SUPPLY_HEALTH_GOOD; in axp20x_ac_power_get_property() 79 val->intval = POWER_SUPPLY_HEALTH_UNKNOWN; in axp20x_ac_power_get_property() 87 val->intval = !!(reg & AXP20X_PWR_STATUS_ACIN_PRESENT); in axp20x_ac_power_get_property() 95 val->intval = !!(reg & AXP20X_PWR_STATUS_ACIN_AVAIL); in axp20x_ac_power_get_property() 98 if (val->intval && power->has_acin_path_sel) { in axp20x_ac_power_get_property() 104 val->intval = !!(reg & AXP813_ACIN_PATH_SEL); in axp20x_ac_power_get_property() 110 ret = iio_read_channel_processed(power->acin_v, &val->intval); in axp20x_ac_power_get_property() 115 val->intval *= 1000; in axp20x_ac_power_get_property() 120 ret = iio_read_channel_processed(power->acin_i, &val->intval); in axp20x_ac_power_get_property() 125 val->intval *= 1000; in axp20x_ac_power_get_property() [all …]
|
D | adp5061.c | 186 val->intval = adp5061_in_current_lim[mode] * 1000; in adp5061_get_input_current_limit() 236 val->intval = adp5061_vmin[regval] * 1000; in adp5061_get_min_voltage() 252 val->intval = adp5061_const_chg_vmax[mode] * 1000; in adp5061_get_chg_volt_lim() 271 val->intval = adp5061_vmax[regval] * 1000; in adp5061_get_max_voltage() 349 val->intval = adp5061_const_ichg[regval] * 1000; in adp5061_get_const_chg_current() 365 val->intval = adp5061_prechg_current[regval] * 1000; in adp5061_get_prechg_current() 398 val->intval = adp5061_vweak_th[regval] * 1000; in adp5061_get_vweak_th() 432 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; in adp5061_get_chg_type() 434 val->intval = adp5061_chg_type[chg_type]; in adp5061_get_chg_type() 451 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in adp5061_get_charger_status() [all …]
|
D | mp2629_charger.c | 166 val->intval = chval * 1000; in mp2629_read_adc() 182 val->intval = rval * props[fld].step + props[fld].min; in mp2629_get_prop() 193 if (val->intval < props[fld].min || val->intval > props[fld].max) in mp2629_set_prop() 196 rval = (val->intval - props[fld].min) / props[fld].step; in mp2629_set_prop() 214 val->intval = (vnow.intval * 100) / vlim.intval; in mp2629_get_battery_capacity() 215 val->intval = min(val->intval, MP2629_MAX_BATT_CAPACITY); in mp2629_get_battery_capacity() 238 val->intval = 4520000; in mp2629_charger_battery_get_prop() 242 val->intval = 4670000; in mp2629_charger_battery_get_prop() 267 val->intval = POWER_SUPPLY_HEALTH_GOOD; in mp2629_charger_battery_get_prop() 269 val->intval = POWER_SUPPLY_HEALTH_OVERVOLTAGE; in mp2629_charger_battery_get_prop() [all …]
|
D | rn5t618_power.c | 135 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; in rn5t618_battery_status() 138 val->intval = rn5t618_decode_status(v); in rn5t618_battery_status() 140 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in rn5t618_battery_status() 157 val->intval = 0; in rn5t618_battery_present() 159 val->intval = 1; in rn5t618_battery_present() 174 val->intval = res * 2 * 2500 / 4095 * 1000; in rn5t618_battery_voltage_now() 190 val->intval = sign_extend32(res, 13) * 1000; in rn5t618_battery_current_now() 205 val->intval = v; in rn5t618_battery_capacity() 220 val->intval = sign_extend32(res, 11) * 10 / 16; in rn5t618_battery_temp() 238 val->intval = res * 60; in rn5t618_battery_tte() [all …]
|
D | goldfish_battery.c | 71 val->intval = GOLDFISH_BATTERY_READ(data, BATTERY_AC_ONLINE); in goldfish_ac_get_property() 74 val->intval = GOLDFISH_BATTERY_READ(data, BATTERY_VOLTAGE_MAX); in goldfish_ac_get_property() 77 val->intval = GOLDFISH_BATTERY_READ(data, BATTERY_CURRENT_MAX); in goldfish_ac_get_property() 95 val->intval = GOLDFISH_BATTERY_READ(data, BATTERY_STATUS); in goldfish_battery_get_property() 98 val->intval = GOLDFISH_BATTERY_READ(data, BATTERY_HEALTH); in goldfish_battery_get_property() 101 val->intval = GOLDFISH_BATTERY_READ(data, BATTERY_PRESENT); in goldfish_battery_get_property() 104 val->intval = POWER_SUPPLY_TECHNOLOGY_LION; in goldfish_battery_get_property() 107 val->intval = GOLDFISH_BATTERY_READ(data, BATTERY_CAPACITY); in goldfish_battery_get_property() 110 val->intval = GOLDFISH_BATTERY_READ(data, BATTERY_VOLTAGE); in goldfish_battery_get_property() 113 val->intval = GOLDFISH_BATTERY_READ(data, BATTERY_TEMP); in goldfish_battery_get_property() [all …]
|
D | cpcap-battery.c | 454 val->intval = 1; in cpcap_battery_get_property() 456 val->intval = 0; in cpcap_battery_get_property() 460 val->intval = POWER_SUPPLY_STATUS_FULL; in cpcap_battery_get_property() 464 val->intval = POWER_SUPPLY_STATUS_CHARGING; in cpcap_battery_get_property() 466 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in cpcap_battery_get_property() 469 val->intval = ddata->config.info.technology; in cpcap_battery_get_property() 472 val->intval = cpcap_battery_get_voltage(ddata); in cpcap_battery_get_property() 475 val->intval = ddata->config.info.voltage_max_design; in cpcap_battery_get_property() 478 val->intval = ddata->config.info.voltage_min_design; in cpcap_battery_get_property() 481 val->intval = ddata->config.bat.constant_charge_voltage_max_uv; in cpcap_battery_get_property() [all …]
|
D | lego_ev3_battery.c | 46 val->intval = batt->technology; in lego_ev3_battery_get_property() 50 ret = iio_read_channel_processed(batt->iio_v, &val->intval); in lego_ev3_battery_get_property() 54 val->intval *= 2000; in lego_ev3_battery_get_property() 55 val->intval += 50000; in lego_ev3_battery_get_property() 64 val->intval += val2; in lego_ev3_battery_get_property() 67 val->intval = batt->v_max; in lego_ev3_battery_get_property() 70 val->intval = batt->v_min; in lego_ev3_battery_get_property() 74 ret = iio_read_channel_processed(batt->iio_i, &val->intval); in lego_ev3_battery_get_property() 78 val->intval *= 20000; in lego_ev3_battery_get_property() 79 val->intval /= 15; in lego_ev3_battery_get_property() [all …]
|
D | axp20x_battery.c | 198 val->intval = !!(reg & AXP20X_PWR_OP_BATT_PRESENT); in axp20x_battery_get_prop() 208 val->intval = POWER_SUPPLY_STATUS_CHARGING; in axp20x_battery_get_prop() 218 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in axp20x_battery_get_prop() 231 val->intval = POWER_SUPPLY_STATUS_FULL; in axp20x_battery_get_prop() 233 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in axp20x_battery_get_prop() 243 val->intval = POWER_SUPPLY_HEALTH_DEAD; in axp20x_battery_get_prop() 247 val->intval = POWER_SUPPLY_HEALTH_GOOD; in axp20x_battery_get_prop() 252 &val->intval); in axp20x_battery_get_prop() 258 val->intval = axp20x_batt->max_ccc; in axp20x_battery_get_prop() 268 ret = iio_read_channel_processed(axp20x_batt->batt_chrg_i, &val->intval); in axp20x_battery_get_prop() [all …]
|
D | da9150-charger.c | 48 val->intval = (psy == charger->supply_online) ? 1 : 0; in da9150_charger_supply_online() 65 val->intval = v_val * 1000; in da9150_charger_vbus_voltage_now() 81 val->intval = i_val * 1000; in da9150_charger_ibus_current_avg() 97 val->intval = t_val / 100; in da9150_charger_tjunc_temp() 148 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in da9150_charger_battery_status() 161 val->intval = POWER_SUPPLY_STATUS_CHARGING; in da9150_charger_battery_status() 168 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in da9150_charger_battery_status() 171 val->intval = POWER_SUPPLY_STATUS_FULL; in da9150_charger_battery_status() 174 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; in da9150_charger_battery_status() 191 val->intval = POWER_SUPPLY_HEALTH_COLD; in da9150_charger_battery_health() [all …]
|
D | ingenic-battery.c | 34 ret = iio_read_channel_processed(bat->channel, &val->intval); in ingenic_battery_get_property() 35 val->intval *= 1000; in ingenic_battery_get_property() 36 if (val->intval < info->voltage_min_design_uv) in ingenic_battery_get_property() 37 val->intval = POWER_SUPPLY_HEALTH_DEAD; in ingenic_battery_get_property() 38 else if (val->intval > info->voltage_max_design_uv) in ingenic_battery_get_property() 39 val->intval = POWER_SUPPLY_HEALTH_OVERVOLTAGE; in ingenic_battery_get_property() 41 val->intval = POWER_SUPPLY_HEALTH_GOOD; in ingenic_battery_get_property() 44 ret = iio_read_channel_processed(bat->channel, &val->intval); in ingenic_battery_get_property() 45 val->intval *= 1000; in ingenic_battery_get_property() 48 val->intval = info->voltage_min_design_uv; in ingenic_battery_get_property() [all …]
|
D | pmu_battery.c | 36 val->intval = (!!(pmu_power_flags & PMU_PWR_AC_PRESENT)) || in pmu_get_ac_prop() 92 val->intval = POWER_SUPPLY_STATUS_CHARGING; in pmu_bat_get_property() 94 val->intval = POWER_SUPPLY_STATUS_FULL; in pmu_bat_get_property() 96 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in pmu_bat_get_property() 99 val->intval = !!(pbi->flags & PMU_BATT_PRESENT); in pmu_bat_get_property() 105 val->intval = pbi->charge * 1000; /* mWh -> µWh */ in pmu_bat_get_property() 108 val->intval = pbi->max_charge * 1000; /* mWh -> µWh */ in pmu_bat_get_property() 111 val->intval = pbi->amperage * 1000; /* mA -> µA */ in pmu_bat_get_property() 114 val->intval = pbi->voltage * 1000; /* mV -> µV */ in pmu_bat_get_property() 117 val->intval = pbi->time_remaining; in pmu_bat_get_property()
|
D | twl4030_madc_battery.c | 117 val->intval = POWER_SUPPLY_STATUS_FULL; in twl4030_madc_bat_get_property() 120 val->intval = POWER_SUPPLY_STATUS_CHARGING; in twl4030_madc_bat_get_property() 122 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in twl4030_madc_bat_get_property() 126 val->intval = twl4030_madc_bat_get_voltage(bat) * 1000; in twl4030_madc_bat_get_property() 129 val->intval = POWER_SUPPLY_TECHNOLOGY_LION; in twl4030_madc_bat_get_property() 132 val->intval = twl4030_madc_bat_get_current(bat); in twl4030_madc_bat_get_property() 136 val->intval = 1; in twl4030_madc_bat_get_property() 141 val->intval = (percent * bat->pdata->capacity) / 100; in twl4030_madc_bat_get_property() 145 val->intval = twl4030_madc_bat_voltscale(bat, in twl4030_madc_bat_get_property() 149 val->intval = bat->pdata->capacity; in twl4030_madc_bat_get_property() [all …]
|
D | cros_usbpd-charger.c | 403 val->intval = port->psy_online; in cros_usbpd_charger_get_prop() 406 val->intval = port->psy_status; in cros_usbpd_charger_get_prop() 409 val->intval = port->psy_current_max * 1000; in cros_usbpd_charger_get_prop() 412 val->intval = port->psy_voltage_max_design * 1000; in cros_usbpd_charger_get_prop() 415 val->intval = port->psy_voltage_now * 1000; in cros_usbpd_charger_get_prop() 418 val->intval = port->psy_usb_type; in cros_usbpd_charger_get_prop() 422 val->intval = -1; in cros_usbpd_charger_get_prop() 424 val->intval = input_current_limit * 1000; in cros_usbpd_charger_get_prop() 428 val->intval = -1; in cros_usbpd_charger_get_prop() 430 val->intval = input_voltage_limit * 1000; in cros_usbpd_charger_get_prop() [all …]
|
D | ipaq_micro_battery.c | 138 val->intval = POWER_SUPPLY_TECHNOLOGY_NiCd; in micro_batt_get_property() 141 val->intval = POWER_SUPPLY_TECHNOLOGY_NiMH; in micro_batt_get_property() 144 val->intval = POWER_SUPPLY_TECHNOLOGY_LION; in micro_batt_get_property() 147 val->intval = POWER_SUPPLY_TECHNOLOGY_LIPO; in micro_batt_get_property() 150 val->intval = POWER_SUPPLY_TECHNOLOGY_UNKNOWN; in micro_batt_get_property() 155 val->intval = get_status(b); in micro_batt_get_property() 158 val->intval = 4700000; in micro_batt_get_property() 161 val->intval = get_capacity(b); in micro_batt_get_property() 164 val->intval = mb->temperature; in micro_batt_get_property() 167 val->intval = mb->voltage; in micro_batt_get_property() [all …]
|
D | wilco-charger.c | 118 val->intval = raw; in wilco_charge_get_property() 132 mode = psp_val_to_charge_mode(val->intval); in wilco_charge_set_property() 137 if (val->intval < CHARGE_LOWER_LIMIT_MIN || in wilco_charge_set_property() 138 val->intval > CHARGE_LOWER_LIMIT_MAX) in wilco_charge_set_property() 141 val->intval); in wilco_charge_set_property() 143 if (val->intval < CHARGE_UPPER_LIMIT_MIN || in wilco_charge_set_property() 144 val->intval > CHARGE_UPPER_LIMIT_MAX) in wilco_charge_set_property() 147 val->intval); in wilco_charge_set_property()
|
D | test_power.c | 47 val->intval = ac_online; in test_power_get_ac_property() 61 val->intval = usb_online; in test_power_get_usb_property() 84 val->intval = battery_status; in test_power_get_battery_property() 87 val->intval = POWER_SUPPLY_CHARGE_TYPE_FAST; in test_power_get_battery_property() 90 val->intval = battery_health; in test_power_get_battery_property() 93 val->intval = battery_present; in test_power_get_battery_property() 96 val->intval = battery_technology; in test_power_get_battery_property() 99 val->intval = POWER_SUPPLY_CAPACITY_LEVEL_NORMAL; in test_power_get_battery_property() 103 val->intval = battery_capacity; in test_power_get_battery_property() 106 val->intval = battery_charge_counter; in test_power_get_battery_property() [all …]
|
D | qcom_smbb.c | 498 val->intval = !(chg->status & STATUS_CHG_GONE) && in smbb_usbin_get_property() 503 val->intval = chg->attr[ATTR_USBIN_IMAX]; in smbb_usbin_get_property() 506 val->intval = 2500000; in smbb_usbin_get_property() 526 val->intval); in smbb_usbin_set_property() 546 val->intval = !(chg->status & STATUS_CHG_GONE) && in smbb_dcin_get_property() 551 val->intval = chg->attr[ATTR_DCIN_IMAX]; in smbb_dcin_get_property() 554 val->intval = 2500000; in smbb_dcin_get_property() 574 val->intval); in smbb_dcin_set_property() 605 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in smbb_battery_get_property() 607 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in smbb_battery_get_property() [all …]
|
D | max8998_charger.c | 45 val->intval = 0; in max8998_battery_get_property() 47 val->intval = 1; in max8998_battery_get_property() 55 val->intval = 1; in max8998_battery_get_property() 57 val->intval = 0; in max8998_battery_get_property() 66 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in max8998_battery_get_property() 69 val->intval = POWER_SUPPLY_STATUS_FULL; in max8998_battery_get_property() 71 val->intval = POWER_SUPPLY_STATUS_CHARGING; in max8998_battery_get_property() 73 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in max8998_battery_get_property()
|
/drivers/usb/typec/ucsi/ |
D | psy.c | 35 val->intval = UCSI_PSY_OFFLINE; in ucsi_psy_get_online() 38 val->intval = UCSI_PSY_FIXED_ONLINE; in ucsi_psy_get_online() 50 val->intval = pdo_fixed_voltage(pdo) * 1000; in ucsi_psy_get_voltage_min() 56 val->intval = UCSI_TYPEC_VSAFE5V * 1000; in ucsi_psy_get_voltage_min() 59 val->intval = 0; in ucsi_psy_get_voltage_min() 74 val->intval = pdo_fixed_voltage(pdo) * 1000; in ucsi_psy_get_voltage_max() 76 val->intval = 0; in ucsi_psy_get_voltage_max() 83 val->intval = UCSI_TYPEC_VSAFE5V * 1000; in ucsi_psy_get_voltage_max() 86 val->intval = 0; in ucsi_psy_get_voltage_max() 103 val->intval = pdo_fixed_voltage(pdo) * 1000; in ucsi_psy_get_voltage_now() [all …]
|
/drivers/net/wireless/ath/ath9k/ |
D | common-beacon.c | 57 conf->intval = conf->beacon_interval; in ath9k_cmn_beacon_config_sta() 63 dtim_intval = conf->intval * conf->dtim_period; in ath9k_cmn_beacon_config_sta() 70 conf->nexttbtt = ath9k_get_next_tbtt(ah, tsf, conf->intval); in ath9k_cmn_beacon_config_sta() 72 bs->bs_intval = TU_TO_USEC(conf->intval); in ath9k_cmn_beacon_config_sta() 85 bs->bs_bmissthreshold = DIV_ROUND_UP(conf->bmiss_timeout, conf->intval); in ath9k_cmn_beacon_config_sta() 101 conf->intval)); in ath9k_cmn_beacon_config_sta() 119 conf->intval = TU_TO_USEC(conf->beacon_interval); in ath9k_cmn_beacon_config_adhoc() 122 conf->nexttbtt = conf->intval; in ath9k_cmn_beacon_config_adhoc() 135 conf->nexttbtt, conf->intval, conf->beacon_interval); in ath9k_cmn_beacon_config_adhoc() 151 conf->intval = TU_TO_USEC(conf->beacon_interval); in ath9k_cmn_beacon_config_ap() [all …]
|
/drivers/staging/nvec/ |
D | nvec_power.c | 230 val->intval = power->on; in nvec_power_get_property() 246 val->intval = power->bat_status; in nvec_battery_get_property() 249 val->intval = power->bat_cap; in nvec_battery_get_property() 252 val->intval = power->bat_present; in nvec_battery_get_property() 255 val->intval = power->bat_voltage_now; in nvec_battery_get_property() 258 val->intval = power->bat_current_now; in nvec_battery_get_property() 261 val->intval = power->bat_current_avg; in nvec_battery_get_property() 264 val->intval = power->time_remain; in nvec_battery_get_property() 267 val->intval = power->charge_full_design; in nvec_battery_get_property() 270 val->intval = power->charge_last_full; in nvec_battery_get_property() [all …]
|