/linux/drivers/power/supply/ |
H A 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() 67 bp->max_energy = bp->full.intval; in __find_main_battery() 136 if (!I.intval) in do_calculate_time() 178 empty.intval = 0; in do_calculate_time() 188 return ((cur.intval - full.intval) * 60L) / I.intval; in do_calculate_time() 190 return -((cur.intval - empty.intval) * 60L) / I.intval; in do_calculate_time() 265 empty.intval = 0; in calculate_capacity() 268 if (full.intval - empty.intval) in calculate_capacity() 269 ret = ((cur.intval - empty.intval) * 100L) / in calculate_capacity() [all …]
|
H A D | qcom_battmgr.c | 132 } intval; member 500 val->intval = battmgr->status.status; in qcom_battmgr_bat_get_property() 506 val->intval = battmgr->status.health; in qcom_battmgr_bat_get_property() 509 val->intval = battmgr->info.present; in qcom_battmgr_bat_get_property() 579 val->intval = battmgr->status.percent; in qcom_battmgr_bat_get_property() 591 val->intval = battmgr->info.year; in qcom_battmgr_bat_get_property() 594 val->intval = battmgr->info.month; in qcom_battmgr_bat_get_property() 597 val->intval = battmgr->info.day; in qcom_battmgr_bat_get_property() 694 val->intval = battmgr->ac.online; in qcom_battmgr_ac_get_property() 762 val->intval = battmgr->usb.online; in qcom_battmgr_usb_get_property() [all …]
|
H A D | olpc_battery.c | 77 val->intval = !!(status & BAT_STAT_AC); in olpc_ac_get_prop() 134 val->intval = POWER_SUPPLY_HEALTH_GOOD; in olpc_bat_get_health() 227 switch (tech.intval) { in olpc_bat_get_charge_full_design() 231 val->intval = 3000000*.8; in olpc_bat_get_charge_full_design() 242 val->intval = 2800000; in olpc_bat_get_charge_full_design() 270 val->intval = soc * (full.intval / 100); in olpc_bat_get_charge_now() 292 switch (tech.intval) { in olpc_bat_get_voltage_max_design() 296 val->intval = 6000000; in olpc_bat_get_voltage_max_design() 306 val->intval = 6400000; in olpc_bat_get_voltage_max_design() 309 val->intval = 6500000; in olpc_bat_get_voltage_max_design() [all …]
|
H A D | mm8013.c | 103 val->intval = regval; in mm8013_get_property() 110 val->intval = 1000 * regval; in mm8013_get_property() 117 val->intval = 1000 * regval; in mm8013_get_property() 124 val->intval = 1000 * regval; in mm8013_get_property() 131 val->intval = -1000 * (s16)regval; in mm8013_get_property() 138 val->intval = -1000 * (s16)regval; in mm8013_get_property() 145 val->intval = regval; in mm8013_get_property() 170 val->intval = ((s16)regval > 0); in mm8013_get_property() 204 val->intval = regval; in mm8013_get_property() 215 val->intval = regval; in mm8013_get_property() [all …]
|
H A D | rn5t618_power.c | 194 val->intval = 0; in rn5t618_battery_present() 196 val->intval = 1; in rn5t618_battery_present() 242 val->intval = v; in rn5t618_battery_capacity() 275 val->intval = res * 60; in rn5t618_battery_tte() 293 val->intval = res * 60; in rn5t618_battery_ttf() 301 if (val->intval < CHG_MIN_CUR) in rn5t618_battery_set_current_limit() 338 val->intval = res * 1000; in rn5t618_battery_charge_full() 353 val->intval = res * 1000; in rn5t618_battery_charge_now() 452 val->intval = online; in rn5t618_adp_get_property() 572 val->intval = online; in rn5t618_usb_get_property() [all …]
|
H A D | adp5061.c | 236 val->intval = adp5061_vmin[regval] * 1000; in adp5061_get_min_voltage() 271 val->intval = adp5061_vmax[regval] * 1000; in adp5061_get_max_voltage() 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() 456 val->intval = POWER_SUPPLY_STATUS_CHARGING; in adp5061_get_charger_status() 459 val->intval = POWER_SUPPLY_STATUS_FULL; in adp5061_get_charger_status() 466 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; in adp5061_get_charger_status() 515 val->intval = adp5061_iend[regval]; in adp5061_get_termination_current() 551 val->intval = 0; in adp5061_get_property() [all …]
|
H A D | axp20x_ac_power.c | 74 val->intval = POWER_SUPPLY_HEALTH_GOOD; in axp20x_ac_power_get_property() 78 val->intval = POWER_SUPPLY_HEALTH_UNKNOWN; in axp20x_ac_power_get_property() 97 if (val->intval && power->has_acin_path_sel) { in axp20x_ac_power_get_property() 114 val->intval *= 1000; in axp20x_ac_power_get_property() 124 val->intval *= 1000; in axp20x_ac_power_get_property() 133 val->intval = AXP813_VHOLD_REG_TO_UV(reg); in axp20x_ac_power_get_property() 144 if (val->intval > 4000000) in axp20x_ac_power_get_property() 145 val->intval = 4000000; in axp20x_ac_power_get_property() 169 if (val->intval < 4000000 || val->intval > 4700000) in axp813_ac_power_set_property() 174 AXP813_VHOLD_UV_TO_BIT(val->intval)); in axp813_ac_power_set_property() [all …]
|
H A D | cpcap-battery.c | 485 *val = prop.intval; in cpcap_battery_get_charger_status() 659 val->intval = 1; in cpcap_battery_get_property() 661 val->intval = 0; in cpcap_battery_get_property() 700 val->intval = latest->current_ua; in cpcap_battery_get_property() 730 val->intval = clamp(val->intval, 0, ddata->charge_full); in cpcap_battery_get_property() 731 val->intval = val->intval * 100 / ddata->charge_full; in cpcap_battery_get_property() 752 if (val->intval < 0) { in cpcap_battery_get_property() 759 val->intval = 0; in cpcap_battery_get_property() 773 val->intval = ddata->charge_full; in cpcap_battery_get_property() 815 val.intval = const_charge_voltage; in cpcap_battery_update_charger() [all …]
|
H A D | mp2629_charger.c | 166 val->intval = chval * 1000; in mp2629_read_adc() 193 if (val->intval < props[fld].min || val->intval > props[fld].max) 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() 291 val->intval = POWER_SUPPLY_STATUS_FULL; in mp2629_charger_battery_get_prop() 372 val->intval = POWER_SUPPLY_USB_TYPE_SDP; in mp2629_charger_usb_get_prop() 375 val->intval = POWER_SUPPLY_USB_TYPE_CDP; in mp2629_charger_usb_get_prop() [all …]
|
H A D | sbs-battery.c | 544 val->intval = 0; in sbs_get_ti_battery_presence_and_health() 556 val->intval = 0; in sbs_get_ti_battery_presence_and_health() 558 val->intval = 1; in sbs_get_ti_battery_presence_and_health() 590 val->intval = 0; in sbs_get_battery_presence_and_health() 627 val->intval = ret; in sbs_get_battery_property() 630 val->intval = in sbs_get_battery_property() 633 val->intval = in sbs_get_battery_property() 636 val->intval = in sbs_get_battery_property() 639 val->intval = in sbs_get_battery_property() 671 val->intval = 0; in sbs_get_battery_property() [all …]
|
H A 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() 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() 116 val->intval = GOLDFISH_BATTERY_READ(data, in goldfish_battery_get_property() [all …]
|
H A 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() 78 val->intval *= 20000; in lego_ev3_battery_get_property() 79 val->intval /= 15; in lego_ev3_battery_get_property() 82 val->intval = POWER_SUPPLY_SCOPE_SYSTEM; in lego_ev3_battery_get_property() [all …]
|
H A D | axp20x_battery.c | 252 &val->intval); in axp20x_battery_get_prop() 258 val->intval = axp20x_batt->max_ccc; in axp20x_battery_get_prop() 271 val->intval = -val1; in axp20x_battery_get_prop() 277 val->intval *= 1000; in axp20x_battery_get_prop() 288 val->intval = 100; in axp20x_battery_get_prop() 308 &val->intval); in axp20x_battery_get_prop() 320 &val->intval); in axp20x_battery_get_prop() 325 val->intval *= 1000; in axp20x_battery_get_prop() 466 val->intval); in axp20x_battery_set_prop() 469 val->intval); in axp20x_battery_set_prop() [all …]
|
H A 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() 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() 152 val->intval = twl4030_madc_bat_get_temp(bat); in twl4030_madc_bat_get_property() [all …]
|
H A D | axp20x_usb_power.c | 183 val->intval = AXP20X_VBUS_VHOLD_uV(v); in axp20x_usb_power_get_property() 188 &val->intval); in axp20x_usb_power_get_property() 196 val->intval *= 1000; 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() 259 val->intval = POWER_SUPPLY_HEALTH_GOOD; in axp20x_usb_power_get_property() 285 int intval) in axp20x_usb_power_set_voltage_min() argument 289 switch (intval) { in axp20x_usb_power_set_voltage_min() 298 val = (intval - 4000000) / 100000; in axp20x_usb_power_set_voltage_min() 311 int intval) in axp20x_usb_power_set_input_current_limit() argument [all …]
|
H A 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 …]
|
H A D | da9150-charger.c | 63 val->intval = v_val * 1000; in da9150_charger_vbus_voltage_now() 79 val->intval = i_val * 1000; in da9150_charger_ibus_current_avg() 95 val->intval = t_val / 100; in da9150_charger_tjunc_temp() 169 val->intval = POWER_SUPPLY_STATUS_FULL; in da9150_charger_battery_status() 189 val->intval = POWER_SUPPLY_HEALTH_COLD; in da9150_charger_battery_health() 202 val->intval = POWER_SUPPLY_HEALTH_DEAD; in da9150_charger_battery_health() 208 val->intval = POWER_SUPPLY_HEALTH_GOOD; in da9150_charger_battery_health() 223 val->intval = 0; in da9150_charger_battery_present() 225 val->intval = 1; in da9150_charger_battery_present() 277 val->intval = v_val * 1000; in da9150_charger_battery_voltage_now() [all …]
|
H A D | test_power.c | 49 val->intval = ac_online; in test_power_get_ac_property() 63 val->intval = usb_online; in test_power_get_usb_property() 86 val->intval = battery_status; in test_power_get_battery_property() 92 val->intval = battery_health; in test_power_get_battery_property() 95 val->intval = battery_present; in test_power_get_battery_property() 112 val->intval = 100; in test_power_get_battery_property() 116 val->intval = 3600; in test_power_get_battery_property() 119 val->intval = 26; in test_power_get_battery_property() 122 val->intval = battery_voltage; in test_power_get_battery_property() 126 val->intval = battery_current; in test_power_get_battery_property() [all …]
|
H A 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()
|
H A D | ip5xxx_power.c | 364 val->intval = 100000 * rval; in ip5xxx_battery_get_property() 368 val->intval = 100000 * 0x1f; in ip5xxx_battery_get_property() 381 val->intval = vmax + 14000 * (rval >> 1); in ip5xxx_battery_get_property() 389 val->intval = vmax + 14000 * 3; in ip5xxx_battery_get_property() 444 switch (val->intval) { in ip5xxx_battery_set_property() 462 rval = val->intval / 100000; in ip5xxx_battery_set_property() 471 rval = ((val->intval - vmax) / 14000) << 1; in ip5xxx_battery_set_property() 522 val->intval = !!(rval & IP5XXX_SYS_CTL0_BOOST_EN); in ip5xxx_boost_get_property() 531 val->intval = 4530000 + 100000 * (rval >> 2); in ip5xxx_boost_get_property() 553 rval = val->intval ? IP5XXX_SYS_CTL0_BOOST_EN : 0; in ip5xxx_boost_set_property() [all …]
|
H A 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()
|
H A 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 …]
|
/linux/drivers/usb/typec/ucsi/ |
H A D | psy.c | 49 val->intval = scope; in ucsi_psy_get_scope() 56 val->intval = UCSI_PSY_OFFLINE; in ucsi_psy_get_online() 59 val->intval = UCSI_PSY_FIXED_ONLINE; in ucsi_psy_get_online() 80 val->intval = 0; in ucsi_psy_get_voltage_min() 97 val->intval = 0; in ucsi_psy_get_voltage_max() 107 val->intval = 0; in ucsi_psy_get_voltage_max() 126 val->intval = 0; in ucsi_psy_get_voltage_now() 136 val->intval = 0; in ucsi_psy_get_voltage_now() 153 val->intval = 0; in ucsi_psy_get_current_max() 166 val->intval = 0; in ucsi_psy_get_current_max() [all …]
|
/linux/drivers/net/wireless/ath/ath9k/ |
H A 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() 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() 152 conf->intval /= bc_buf; in ath9k_cmn_beacon_config_ap() [all …]
|
/linux/drivers/staging/nvec/ |
H A 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() 276 val->intval = power->capacity_remain; in nvec_battery_get_property() 279 val->intval = power->bat_temperature; in nvec_battery_get_property() [all …]
|