is_ext_pwr_online(9)
π is_ext_pwr_online(9) π
okay bestie, welcome to the Kernel API Manual β this one is short and sweet and honestly kind of a vibe check for your battery's external power situation πβ¨
πΈ SYNOPSIS πΈ
bool is_ext_pwr_online (struct charger_manager *cm );
π ARGUMENTS π
cmβ the Charger Manager representing the battery, aka the main character of this whole little situation π
π¦ DESCRIPTION π¦
So this function returns true if at least one of the chargers of the battery has an external power source attached to charge the battery. And the important little detail? It doesn't care whether it is actually charging or not β just whether that external source is attached, periodt π
β¨
Like, the charger is plugged in, bestie. Whether the battery is actively sipping that power is a whole separate question ππ
π SEE ALSO π
Kernel file ./drivers/power/supply/charger-manager.c and its whole friend group:
is_batt_present(9)get_batt_uV(9)is_charging(9)is_full_charged(9)is_polling_required(9)try_charger_enable(9)check_charging_duration(9)cm_get_target_status(9)_cm_monitor(9)cm_monitor(9)_setup_polling(9)cm_monitor_poller(9)cm_setup_timer(9)charger_extcon_work(9)charger_extcon_notifier(9)charger_extcon_init(9)charger_manager_register_extcon(9)charger_manager_prepare_sysfs(9)
and that's the whole page, no cap π«Ά this little icon came from ./drivers/power/supply, dated October 2026 β slay, stay charged, and go read the whole charger-manager friend group when you're done here ππβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms