rerun_election(chip->fcc_votable);
pl_dbg(chip, PR_PARALLEL, "taper entry scheduling work after %d ms\n",
PL_TAPER_WORK_DELAY_MS);
- schedule_delayed_work(&chip->pl_taper_work,
+ queue_delayed_work(system_power_efficient_wq, &chip->pl_taper_work,
msecs_to_jiffies(PL_TAPER_WORK_DELAY_MS));
return;
}
vote(chip->pl_awake_votable, FCC_STEPPER_VOTER,
true, 0);
get_fcc_step_update_params(chip, total_fcc_ua, 0);
- schedule_delayed_work(&chip->fcc_step_update_work, 0);
+ queue_delayed_work(system_power_efficient_wq, &chip->fcc_step_update_work, 0);
return 0;
}
true, 0);
get_fcc_step_update_params(chip, master_fcc_ua,
slave_fcc_ua);
- schedule_delayed_work(&chip->fcc_step_update_work, 0);
+ queue_delayed_work(system_power_efficient_wq, &chip->fcc_step_update_work, 0);
} else {
/*
* If there is an increase in slave share
chip->slave_fcc_ua = parallel_fcc;
if (reschedule_ms) {
- schedule_delayed_work(&chip->fcc_step_update_work,
+ queue_delayed_work(system_power_efficient_wq, &chip->fcc_step_update_work,
msecs_to_jiffies(reschedule_ms));
pr_debug("Rescheduling FCC_STEPPER work\n");
} else {
if (icl_ua <= 1400000)
vote(chip->pl_enable_votable_indirect, USBIN_I_VOTER, false, 0);
else
- schedule_delayed_work(&chip->status_change_work,
+ queue_delayed_work(system_power_efficient_wq, &chip->status_change_work,
msecs_to_jiffies(PL_DELAY_MS));
/* rerun AICL */
if (pval.intval == POWER_SUPPLY_CHARGE_TYPE_TAPER) {
pl_dbg(chip, PR_PARALLEL,
"pl enabled in Taper scheduing work\n");
- schedule_delayed_work(&chip->pl_taper_work, 0);
+ queue_delayed_work(system_power_efficient_wq, &chip->pl_taper_work, 0);
}
}
} else {
cancel_delayed_work_sync(&chip->pl_awake_work);
if (chip->pl_awake_votable)
- schedule_delayed_work(&chip->pl_awake_work,
+ queue_delayed_work(system_power_efficient_wq, &chip->pl_awake_work,
msecs_to_jiffies(5000));
}
&& (pval.intval == POWER_SUPPLY_CHARGE_TYPE_TAPER)) {
chip->charge_type = pval.intval;
pl_dbg(chip, PR_PARALLEL, "taper entry scheduling work\n");
- schedule_delayed_work(&chip->pl_taper_work, 0);
+ queue_delayed_work(system_power_efficient_wq, &chip->pl_taper_work, 0);
return;
}
if ((strcmp(psy->desc->name, "parallel") == 0)
|| (strcmp(psy->desc->name, "battery") == 0)
|| (strcmp(psy->desc->name, "main") == 0))
- schedule_delayed_work(&chip->status_change_work, 0);
+ queue_delayed_work(system_power_efficient_wq, &chip->status_change_work, 0);
return NOTIFY_OK;
}
chip->ttf.last_ttf = 0;
chip->ttf.last_ms = 0;
mutex_unlock(&chip->ttf.lock);
- schedule_delayed_work(&chip->ttf_work, msecs_to_jiffies(delay_ms));
+ queue_delayed_work(system_power_efficient_wq, &chip->ttf_work, msecs_to_jiffies(delay_ms));
}
static void restore_cycle_counter(struct fg_chip *chip)
fg_dbg(chip, FG_STATUS, "SRAM Dump done at %lld.%d\n",
quotient, remainder);
resched:
- schedule_delayed_work(&chip->sram_dump_work,
+ queue_delayed_work(system_power_efficient_wq, &chip->sram_dump_work,
msecs_to_jiffies(fg_sram_dump_period_ms));
}
chip = power_supply_get_drvdata(bms_psy);
if (fg_sram_dump)
- schedule_delayed_work(&chip->sram_dump_work,
+ queue_delayed_work(system_power_efficient_wq, &chip->sram_dump_work,
msecs_to_jiffies(fg_sram_dump_period_ms));
else
cancel_delayed_work_sync(&chip->sram_dump_work);
/* keep the wake lock and prime the IBATT and VBATT buffers */
if (ttf < 0) {
/* delay for one FG cycle */
- schedule_delayed_work(&chip->ttf_work,
+ queue_delayed_work(system_power_efficient_wq, &chip->ttf_work,
msecs_to_jiffies(1500));
mutex_unlock(&chip->ttf.lock);
return;
}
/* recurse every 10 seconds */
- schedule_delayed_work(&chip->ttf_work, msecs_to_jiffies(10000));
+ queue_delayed_work(system_power_efficient_wq, &chip->ttf_work, msecs_to_jiffies(10000));
end_work:
vote(chip->awake_votable, TTF_PRIMING, false, 0);
mutex_unlock(&chip->ttf.lock);
}
clear_battery_profile(chip);
- schedule_delayed_work(&chip->profile_load_work, 0);
+ queue_delayed_work(system_power_efficient_wq, &chip->profile_load_work, 0);
if (chip->fg_psy)
power_supply_changed(chip->fg_psy);
prev_soc = soc;
}
- schedule_delayed_work(
+ queue_delayed_work(system_power_efficient_wq,
&chip->soc_work, msecs_to_jiffies(SOC_WORK_MS));
}
chip->param.batt_soc, chip->param.batt_raw_soc,
chip->param.batt_ma, chip->charge_status);
- schedule_delayed_work(&chip->soc_monitor_work,
+ queue_delayed_work(system_power_efficient_wq, &chip->soc_monitor_work,
msecs_to_jiffies(MONITOR_SOC_WAIT_PER_MS));
}
}
device_init_wakeup(chip->dev, true);
- schedule_delayed_work(&chip->profile_load_work, 0);
- schedule_delayed_work(&chip->soc_work, 0);
+ queue_delayed_work(system_power_efficient_wq, &chip->profile_load_work, 0);
+ queue_delayed_work(system_power_efficient_wq, &chip->soc_work, 0);
chip->param.batt_soc = -EINVAL;
- schedule_delayed_work(&chip->soc_monitor_work,
+ queue_delayed_work(system_power_efficient_wq, &chip->soc_monitor_work,
msecs_to_jiffies(MONITOR_SOC_WAIT_MS));
pr_debug("FG GEN3 driver probed successfully\n");
if (rc < 0)
pr_err("Error in configuring ESR timer, rc=%d\n", rc);
- schedule_delayed_work(&chip->ttf_work, 0);
+ queue_delayed_work(system_power_efficient_wq, &chip->ttf_work, 0);
if (fg_sram_dump)
- schedule_delayed_work(&chip->sram_dump_work,
+ queue_delayed_work(system_power_efficient_wq, &chip->sram_dump_work,
msecs_to_jiffies(fg_sram_dump_period_ms));
if (!work_pending(&chip->status_change_work)) {
chip->param.update_now = true;
spin_unlock(&chip->suspend_lock);
- schedule_delayed_work(&chip->soc_monitor_work,
+ queue_delayed_work(system_power_efficient_wq, &chip->soc_monitor_work,
msecs_to_jiffies(MONITOR_SOC_WAIT_MS));
return 0;
usb_present, chg->real_charger_type,
batt_present, batt_health, batt_charge_type);
- schedule_delayed_work(&chg->reg_work, 60 * HZ);
+ queue_delayed_work(system_power_efficient_wq, &chg->reg_work, 60 * HZ);
return rc;
cleanup:
jeita_cc_delta_ua = 0;
}
}
- schedule_delayed_work(&chg->monitor_low_temp_work,
+ queue_delayed_work(system_power_efficient_wq, &chg->monitor_low_temp_work,
msecs_to_jiffies(CHG_MONITOR_WORK_DELAY_MS));
}
/* Schedule work to enable parallel charger */
vote(chg->awake_votable, PL_DELAY_VOTER, true, 0);
- schedule_delayed_work(&chg->pl_enable_work,
+ queue_delayed_work(system_power_efficient_wq, &chg->pl_enable_work,
msecs_to_jiffies(PL_DELAY_MS));
- schedule_delayed_work(&chg->monitor_low_temp_work,
+ queue_delayed_work(system_power_efficient_wq, &chg->monitor_low_temp_work,
msecs_to_jiffies(CHG_MONITOR_WORK_DELAY_MS));
/*
- schedule_delayed_work(&chg->cc_float_charge_work,
+ queue_delayed_work(system_power_efficient_wq, &chg->cc_float_charge_work,
msecs_to_jiffies(CC_FLOAT_WORK_START_DELAY_MS));
*/
- schedule_delayed_work(&chg->typec_reenable_work,
+ queue_delayed_work(system_power_efficient_wq, &chg->typec_reenable_work,
msecs_to_jiffies(300));
} else {
cancel_delayed_work_sync(&chg->charger_type_recheck);
delay = 0;
cancel_delayed_work_sync(&chg->icl_change_work);
- schedule_delayed_work(&chg->icl_change_work,
+ queue_delayed_work(system_power_efficient_wq, &chg->icl_change_work,
msecs_to_jiffies(delay));
}
current_ua = DCP_CURRENT_UA;
if (!chg->check_vbus_once) {
- schedule_delayed_work(&chg->check_vbus_work,
+ queue_delayed_work(system_power_efficient_wq, &chg->check_vbus_work,
msecs_to_jiffies(CHECK_VBUS_WORK_DELAY_MS));
chg->check_vbus_once = true;
}
break;
case DCP_CHARGER_BIT:
if (chg->wa_flags & QC_CHARGER_DETECTION_WA_BIT)
- schedule_delayed_work(&chg->hvdcp_detect_work,
+ queue_delayed_work(system_power_efficient_wq, &chg->hvdcp_detect_work,
msecs_to_jiffies(HVDCP_DET_MS));
break;
default:
smblib_dbg(chg, PR_OEM, "TypeC %s insertion\n",
smblib_typec_mode_name[chg->typec_mode]);
smblib_handle_typec_insertion(chg);
- schedule_delayed_work(&chg->charger_type_recheck, msecs_to_jiffies(20000));
+ queue_delayed_work(system_power_efficient_wq, &chg->charger_type_recheck, msecs_to_jiffies(20000));
} else if (chg->typec_present &&
chg->typec_mode == POWER_SUPPLY_TYPEC_NONE) {
cancel_delayed_work_sync(&chg->charger_type_recheck);
cancel_delayed_work_sync(&chg->uusb_otg_work);
vote(chg->awake_votable, OTG_DELAY_VOTER, true, 0);
smblib_dbg(chg, PR_INTERRUPT, "Scheduling OTG work\n");
- schedule_delayed_work(&chg->uusb_otg_work,
+ queue_delayed_work(system_power_efficient_wq, &chg->uusb_otg_work,
msecs_to_jiffies(chg->otg_delay_ms));
return IRQ_HANDLED;
}
if (chg->irq_info[HIGH_DUTY_CYCLE_IRQ].irq)
disable_irq_nosync(chg->irq_info[HIGH_DUTY_CYCLE_IRQ].irq);
- schedule_delayed_work(&chg->clear_hdc_work, msecs_to_jiffies(60));
+ queue_delayed_work(system_power_efficient_wq, &chg->clear_hdc_work, msecs_to_jiffies(60));
return IRQ_HANDLED;
}
* permanently suspending the input if the boost-back
* condition is unintentionally hit.
*/
- schedule_delayed_work(&chg->bb_removal_work,
+ queue_delayed_work(system_power_efficient_wq, &chg->bb_removal_work,
msecs_to_jiffies(BOOST_BACK_UNVOTE_DELAY_MS));
}
}
* triggered then it is likely that the software based soft start was
* successful and the VBUS < 1V restriction should be re-enabled.
*/
- schedule_delayed_work(&chg->otg_ss_done_work, msecs_to_jiffies(500));
+ queue_delayed_work(system_power_efficient_wq, &chg->otg_ss_done_work, msecs_to_jiffies(500));
rc = _smblib_vbus_regulator_disable(chg->vbus_vreg->rdev);
if (rc < 0) {
rc = smblib_get_prop_usb_present(chg, &val);
if (rc < 0) {
pr_err("Couldn't get usb present rc=%d\n", rc);
- schedule_delayed_work(&chg->reg_work,
+ queue_delayed_work(system_power_efficient_wq, &chg->reg_work,
NOT_CHARGING_PERIOD_S * HZ);
return;
}
smblib_dbg(chg, PR_OEM, "Type-C orientation[%d], Type-C mode[%d], Real Charge Type[%d]\n",
typec_orientation, typec_mode, charge_type);
- schedule_delayed_work(&chg->reg_work, CHARGING_PERIOD_S * HZ);
+ queue_delayed_work(system_power_efficient_wq, &chg->reg_work, CHARGING_PERIOD_S * HZ);
}
else
- schedule_delayed_work(&chg->reg_work, NOT_CHARGING_PERIOD_S * HZ);
+ queue_delayed_work(system_power_efficient_wq, &chg->reg_work, NOT_CHARGING_PERIOD_S * HZ);
}
static void smblib_legacy_detection_work(struct work_struct *work)
mutex_unlock(&chg->lock);
- schedule_delayed_work(&chg->cc_float_charge_work,
+ queue_delayed_work(system_power_efficient_wq, &chg->cc_float_charge_work,
msecs_to_jiffies(200));
}
check_next:
check_count++;
- schedule_delayed_work(&chg->charger_type_recheck, msecs_to_jiffies(recheck_time));
+ queue_delayed_work(system_power_efficient_wq, &chg->charger_type_recheck, msecs_to_jiffies(recheck_time));
}
static int smblib_create_votables(struct smb_charger *chg)