STRUCT AB8500_CHARGALG(9)
β¨ struct ab8500_chargalg(9) β¨
okay so bestie, lemme tell you about this kernel API manual thing, it's giving very much "charging algorithm device information" energy and honestly? it's iconic π
this is from the Linux Kernel API Manual, and we're about to dive into the struct ab8500_chargalg like it's the main character, because it literally is π
π NAME π
struct ab8500_chargalg β ab8500 Charging algorithm device information, no cap, that's literally what it is bestie β¨
π¦ SYNOPSIS π¦
okay so here's the whole vibe, the entire struct, every single field, and like... it's a LOT but we're gonna get through it together, i promise π«Ά
struct ab8500_chargalg {
struct device *dev;
int charge_status;
int eoc_cnt;
bool maintenance_chg;
int t_hyst_norm;
int t_hyst_lowhigh;
enum ab8500_chargalg_states charge_state;
struct ab8500_charge_curr_maximization ccm;
struct ab8500_chargalg_charger_info chg_info;
struct ab8500_chargalg_battery_data batt_data;
struct ab8500 *parent;
struct ab8500_bm_data *bm;
struct power_supply *chargalg_psy;
struct ux500_charger *ac_chg;
struct ux500_charger *usb_chg;
struct ab8500_chargalg_events events;
struct workqueue_struct *chargalg_wq;
struct delayed_work chargalg_periodic_work;
struct delayed_work chargalg_wd_work;
struct work_struct chargalg_work;
struct hrtimer safety_timer;
struct hrtimer maintenance_timer;
struct kobject chargalg_kobject;
};
like, look at all those fields, it's giving organized chaos and we love to see it π₯
πΈ Members πΈ
okay bestie, time for the member-by-member breakdown, and there are like a million of them but every single one matters, periodt π
devβ pointer to the structure device, super important, it's the whole reason we're here tbh πcharge_statusβ battery operating status, like how's the battery doing, is it thriving or surviving, this tells you πeoc_cntβ counter used to determine end-of_charge (yes with the underscore, don't @ me, that's literally what it says), it's counting down to the end bestie βmaintenance_chgβ indicate if maintenance charge is active, like is the maintenance charge currently doing its thing, yes or no, that's the vibe πt_hyst_normβ temperature hysteresis when the temperature has been over or under normal limits, it's giving temperature drama and this is the hysteresis for when things are normal-ish but like, borderline πt_hyst_lowhighβ temperature hysteresis when the temperature has been over or under the high or low limits, so when things get EXTREME, this is the hysteresis you need to know about π₯charge_stateβ current state of the charging algorithm, like what chapter are we in, what's the plot rn, this tells you the state bestie πccmβ charging current maximization parameters, it's all about maximizing that charging current, we love efficiency here πchg_infoβ information about connected charger types, like what chargers are plugged in, what's the situation, this has the tea βbatt_dataβ data of the battery, all the battery info you could ever want, it's giving data-rich and we're obsessed πparentβ pointer to thestruct ab8500, it's the parent struct, the OG, the one that came before, respect the elders fr fr π§bmβ Platform specific battery management information, platform specific means it's tailored, it's custom, it's special, and it's all about battery management πchargalg_psyβ structure that holds the battery properties exposed by the charging algorithm, like these are the properties the charging algorithm is showing to the world, it's giving public-facing and proud β¨ac_chgβ AC charger power supply, the AC charger, the plug-in-the-wall situation, very important for charging obviously πusb_chgβ USB charger power supply, the USB charger, the plug-into-your-laptop situation, equally important, we stan both π«Άeventsβ structure for information about events triggered, like what events happened, what's the lore, this has the receipts πΈchargalg_wqβ work queue for running the charging algorithm, it's the queue where the work happens, the charging algorithm's workspace, iconic behavior πchargalg_periodic_workβ work to run the charging algorithm periodically, so like, on a schedule, regularly, periodically, you get it πchargalg_wd_workβ work to kick the charger watchdog periodically, kicking the watchdog, keeping it alive, making sure it doesn't fall asleep, very important work honestly π¦chargalg_workβ work to run the charging algorithm instantly, no waiting, no delay, instant, immediately, right now, that's the vibe β‘safety_timerβ charging safety timer, it's a timer for safety, keeping things safe, we love safety here at the charging algorithm household πmaintenance_timerβ maintenance charging timer, a timer for maintenance charging, keeping the maintenance charge on schedule, very organized πchargalg_kobjectβ structure of type kobject, it's a kobject, that's what it is, a structure of type kobject, and that's the whole description, no notes π
π SEE ALSO π
okay so if you wanna go deeper (and honestly why wouldn't you), here's the whole squad, the entire friend group of related functions and files, and they're all linked below bestie π
- Kernel file
./drivers/power/supply/ab8500_chargalg.cstructab8500_charge_curr_maximization(9), ab8500_chargalg_safety_timer_expired(9),ab8500_chargalg_maintenance_timer_expired(9),ab8500_chargalg_state_to(9),ab8500_chargalg_check_charger_connection(9),ab8500_chargalg_start_safety_timer(9),ab8500_chargalg_stop_safety_timer(9),ab8500_chargalg_start_maintenance_timer(9),ab8500_chargalg_stop_maintenance_timer(9),ab8500_chargalg_kick_watchdog(9),ab8500_chargalg_ac_en(9),ab8500_chargalg_usb_en(9),ab8500_chargalg_update_chg_curr(9),ab8500_chargalg_stop_charging(9),ab8500_chargalg_hold_charging(9),ab8500_chargalg_start_charging(9),ab8500_chargalg_check_temp(9),ab8500_chargalg_check_charger_voltage(9),ab8500_chargalg_end_of_charge(9),ab8500_chargalg_chg_curr_maxim(9),ab8500_chargalg_external_power_changed(9),ab8500_chargalg_time_to_restart(9),ab8500_chargalg_algorithm(9),ab8500_chargalg_periodic_work(9),ab8500_chargalg_wd_work(9),ab8500_chargalg_work(9),ab8500_chargalg_get_property(9)
like, that's the whole crew, every single one, no skips, no cap π§β¨
okay so real talk bestie, this manual page is from the Linux Kernel API Manual, and it's all about that struct ab8500_chargalg life, which is literally the charging algorithm device information for the ab8500, and if you're deep in the kernel power supply game, you already know, iykyk π
source file vibe check: ./drivers/power/supply β version date: October 2026 β that's the whole footer situation, and honestly? iconic. periodt. πβ¨π
π¦ 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