/Linux-v5.4/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 | axp20x_usb_power.c | 173 val->intval = AXP20X_VBUS_VHOLD_uV(v); in axp20x_usb_power_get_property() 178 &val->intval); in axp20x_usb_power_get_property() 186 val->intval *= 1000; in axp20x_usb_power_get_property() 195 val->intval = ret * 1700; /* 1 step = 1.7 mV */ in axp20x_usb_power_get_property() 199 return axp813_get_current_max(power, &val->intval); in axp20x_usb_power_get_property() 200 return axp20x_get_current_max(power, &val->intval); in axp20x_usb_power_get_property() 204 &val->intval); in axp20x_usb_power_get_property() 212 val->intval *= 1000; in axp20x_usb_power_get_property() 221 val->intval = ret * 375; /* 1 step = 0.375 mA */ in axp20x_usb_power_get_property() 235 val->intval = POWER_SUPPLY_HEALTH_UNKNOWN; in axp20x_usb_power_get_property() [all …]
|
D | axp20x_ac_power.c | 68 val->intval = POWER_SUPPLY_HEALTH_GOOD; in axp20x_ac_power_get_property() 72 val->intval = POWER_SUPPLY_HEALTH_UNKNOWN; in axp20x_ac_power_get_property() 80 val->intval = !!(reg & AXP20X_PWR_STATUS_ACIN_PRESENT); in axp20x_ac_power_get_property() 88 val->intval = !!(reg & AXP20X_PWR_STATUS_ACIN_AVAIL); in axp20x_ac_power_get_property() 92 ret = iio_read_channel_processed(power->acin_v, &val->intval); in axp20x_ac_power_get_property() 97 val->intval *= 1000; in axp20x_ac_power_get_property() 102 ret = iio_read_channel_processed(power->acin_i, &val->intval); in axp20x_ac_power_get_property() 107 val->intval *= 1000; in axp20x_ac_power_get_property() 116 val->intval = AXP813_VHOLD_REG_TO_UV(reg); in axp20x_ac_power_get_property() 125 val->intval = AXP813_CURR_LIMIT_REG_TO_UA(reg); 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 = chg_type; in adp5061_get_chg_type() 451 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in adp5061_get_charger_status() [all …]
|
D | sbs-battery.c | 286 static int sbs_status_correct(struct i2c_client *client, int *intval) in sbs_status_correct() argument 298 *intval = POWER_SUPPLY_STATUS_FULL; in sbs_status_correct() 300 if (*intval == POWER_SUPPLY_STATUS_FULL) { in sbs_status_correct() 303 *intval = POWER_SUPPLY_STATUS_CHARGING; in sbs_status_correct() 305 *intval = POWER_SUPPLY_STATUS_DISCHARGING; in sbs_status_correct() 322 val->intval = 0; in sbs_get_battery_presence_and_health() 329 val->intval = 1; /* battery present */ in sbs_get_battery_presence_and_health() 332 val->intval = POWER_SUPPLY_HEALTH_UNKNOWN; in sbs_get_battery_presence_and_health() 351 val->intval = 0; /* battery removed */ in sbs_get_ti_battery_presence_and_health() 358 val->intval = 0; /* battery removed */ in sbs_get_ti_battery_presence_and_health() [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 | 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 | 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 | axp20x_battery.c | 199 val->intval = !!(reg & AXP20X_PWR_OP_BATT_PRESENT); in axp20x_battery_get_prop() 209 val->intval = POWER_SUPPLY_STATUS_CHARGING; in axp20x_battery_get_prop() 219 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in axp20x_battery_get_prop() 232 val->intval = POWER_SUPPLY_STATUS_FULL; in axp20x_battery_get_prop() 234 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in axp20x_battery_get_prop() 244 val->intval = POWER_SUPPLY_HEALTH_DEAD; in axp20x_battery_get_prop() 248 val->intval = POWER_SUPPLY_HEALTH_GOOD; in axp20x_battery_get_prop() 253 &val->intval); in axp20x_battery_get_prop() 259 val->intval = axp20x_batt->max_ccc; in axp20x_battery_get_prop() 273 ret = iio_read_channel_processed(chan, &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 | 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 | cpcap-battery.c | 452 val->intval = 1; in cpcap_battery_get_property() 454 val->intval = 0; in cpcap_battery_get_property() 458 val->intval = POWER_SUPPLY_STATUS_FULL; in cpcap_battery_get_property() 462 val->intval = POWER_SUPPLY_STATUS_CHARGING; in cpcap_battery_get_property() 464 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in cpcap_battery_get_property() 467 val->intval = ddata->config.info.technology; in cpcap_battery_get_property() 470 val->intval = cpcap_battery_get_voltage(ddata); in cpcap_battery_get_property() 473 val->intval = ddata->config.info.voltage_max_design; in cpcap_battery_get_property() 476 val->intval = ddata->config.info.voltage_min_design; in cpcap_battery_get_property() 481 val->intval = cpcap_battery_cc_get_avg_current(ddata); in cpcap_battery_get_property() [all …]
|
D | wilco-charger.c | 113 val->intval = raw; in wilco_charge_get_property() 127 mode = psp_val_to_charge_mode(val->intval); in wilco_charge_set_property() 132 if (val->intval < CHARGE_LOWER_LIMIT_MIN || in wilco_charge_set_property() 133 val->intval > CHARGE_LOWER_LIMIT_MAX) in wilco_charge_set_property() 136 val->intval); in wilco_charge_set_property() 138 if (val->intval < CHARGE_UPPER_LIMIT_MIN || in wilco_charge_set_property() 139 val->intval > CHARGE_UPPER_LIMIT_MAX) in wilco_charge_set_property() 142 val->intval); in wilco_charge_set_property()
|
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 | sbs-charger.c | 55 val->intval = !!(reg & SBS_CHARGER_STATUS_BATTERY_PRESENT); in sbs_get_property() 59 val->intval = !!(reg & SBS_CHARGER_STATUS_AC_PRESENT); in sbs_get_property() 63 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; in sbs_get_property() 66 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in sbs_get_property() 69 val->intval = POWER_SUPPLY_STATUS_CHARGING; in sbs_get_property() 71 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in sbs_get_property() 77 val->intval = POWER_SUPPLY_HEALTH_COLD; in sbs_get_property() 79 val->intval = POWER_SUPPLY_HEALTH_OVERHEAT; in sbs_get_property() 81 val->intval = POWER_SUPPLY_HEALTH_GOOD; in sbs_get_property()
|
D | cros_usbpd-charger.c | 409 val->intval = port->psy_online; in cros_usbpd_charger_get_prop() 412 val->intval = port->psy_status; in cros_usbpd_charger_get_prop() 415 val->intval = port->psy_current_max * 1000; in cros_usbpd_charger_get_prop() 418 val->intval = port->psy_voltage_max_design * 1000; in cros_usbpd_charger_get_prop() 421 val->intval = port->psy_voltage_now * 1000; in cros_usbpd_charger_get_prop() 424 val->intval = port->psy_usb_type; in cros_usbpd_charger_get_prop() 428 val->intval = -1; in cros_usbpd_charger_get_prop() 430 val->intval = input_current_limit * 1000; in cros_usbpd_charger_get_prop() 434 val->intval = -1; in cros_usbpd_charger_get_prop() 436 val->intval = input_voltage_limit * 1000; in cros_usbpd_charger_get_prop() [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 | lt3651-charger.c | 49 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; in lt3651_charger_get_property() 53 val->intval = POWER_SUPPLY_STATUS_CHARGING; in lt3651_charger_get_property() 55 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in lt3651_charger_get_property() 58 val->intval = gpiod_get_value(lt3651_charger->acpr_gpio); in lt3651_charger_get_property() 62 val->intval = POWER_SUPPLY_HEALTH_UNKNOWN; in lt3651_charger_get_property() 66 val->intval = POWER_SUPPLY_HEALTH_GOOD; in lt3651_charger_get_property() 74 val->intval = POWER_SUPPLY_HEALTH_UNSPEC_FAILURE; in lt3651_charger_get_property() 77 val->intval = gpiod_get_value(lt3651_charger->chrg_gpio) ? in lt3651_charger_get_property()
|
D | max77650-charger.c | 204 val->intval = POWER_SUPPLY_STATUS_CHARGING; in max77650_charger_get_property() 213 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in max77650_charger_get_property() 222 val->intval = POWER_SUPPLY_STATUS_CHARGING; in max77650_charger_get_property() 225 val->intval = POWER_SUPPLY_STATUS_FULL; in max77650_charger_get_property() 228 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; in max77650_charger_get_property() 236 val->intval = MAX77650_CHARGER_CHG_CHARGING(reg); in max77650_charger_get_property() 244 val->intval = POWER_SUPPLY_CHARGE_TYPE_NONE; in max77650_charger_get_property() 254 val->intval = POWER_SUPPLY_CHARGE_TYPE_FAST; in max77650_charger_get_property() 258 val->intval = POWER_SUPPLY_CHARGE_TYPE_TRICKLE; in max77650_charger_get_property() 261 val->intval = POWER_SUPPLY_CHARGE_TYPE_UNKNOWN; in max77650_charger_get_property()
|
D | power_supply_hwmon.c | 176 pspval.intval = DIV_ROUND_CLOSEST(pspval.intval, 1000); in power_supply_hwmon_read() 182 if (check_mul_overflow(pspval.intval, 100, in power_supply_hwmon_read() 183 &pspval.intval)) in power_supply_hwmon_read() 190 *val = pspval.intval; in power_supply_hwmon_read() 208 pspval.intval = val; in power_supply_hwmon_write() 218 if (check_mul_overflow(pspval.intval, 1000, in power_supply_hwmon_write() 219 &pspval.intval)) in power_supply_hwmon_write() 226 pspval.intval = DIV_ROUND_CLOSEST(pspval.intval, 100); in power_supply_hwmon_write()
|
D | test_power.c | 45 val->intval = ac_online; in test_power_get_ac_property() 59 val->intval = usb_online; in test_power_get_usb_property() 82 val->intval = battery_status; in test_power_get_battery_property() 85 val->intval = POWER_SUPPLY_CHARGE_TYPE_FAST; in test_power_get_battery_property() 88 val->intval = battery_health; in test_power_get_battery_property() 91 val->intval = battery_present; in test_power_get_battery_property() 94 val->intval = battery_technology; in test_power_get_battery_property() 97 val->intval = POWER_SUPPLY_CAPACITY_LEVEL_NORMAL; in test_power_get_battery_property() 101 val->intval = battery_capacity; in test_power_get_battery_property() 105 val->intval = 100; in test_power_get_battery_property() [all …]
|
/Linux-v5.4/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 …]
|
/Linux-v5.4/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 …]
|