STRUCT AB8500_CHARGER(9)
π NAME π
struct ab8500_charger β ab8500 Charger device information, aka the whole vibe of the charger's data structure, from the Kernel API Manual. This is the blueprint, bestie. It's giving "everything you need to know about the ab8500 charger" energy, fr fr. π
β¨ SYNOPSIS β¨
struct ab8500_charger {
struct device *dev;
bool vbus_detected;
bool vbus_detected_start;
bool ac_conn;
bool vddadc_en_ac;
bool vddadc_en_usb;
int vbat;
int old_vbat;
bool usb_device_is_unrecognised;
bool autopower;
bool autopower_cfg;
int invalid_charger_detect_state;
int is_aca_rid;
atomic_t current_stepping_sessions;
struct ab8500 *parent;
struct iio_channel *adc_main_charger_v;
struct iio_channel *adc_main_charger_c;
struct iio_channel *adc_vbus_v;
struct iio_channel *adc_usb_charger_c;
struct ab8500_bm_data *bm;
struct ab8500_charger_event_flags flags;
struct ab8500_charger_usb_state usb_state;
struct ab8500_charger_max_usb_in_curr max_usb_in_curr;
struct ux500_charger ac_chg;
struct ux500_charger usb_chg;
struct ab8500_charger_info ac;
struct ab8500_charger_info usb;
struct regulator *regu;
struct workqueue_struct *charger_wq;
struct mutex usb_ipt_crnt_lock;
struct delayed_work check_vbat_work;
struct delayed_work check_hw_failure_work;
struct delayed_work check_usbchgnotok_work;
struct delayed_work kick_wd_work;
struct delayed_work usb_state_changed_work;
struct delayed_work attach_work;
struct delayed_work ac_charger_attached_work;
struct delayed_work usb_charger_attached_work;
struct delayed_work vbus_drop_end_work;
struct work_struct ac_work;
struct work_struct detect_usb_type_work;
struct work_struct usb_link_status_work;
struct work_struct check_main_thermal_prot_work;
struct work_struct check_usb_thermal_prot_work;
struct usb_phy *usb_phy;
struct notifier_block nb;
struct mutex charger_attached_mutex;
};
π MEMBERS π
Okay so this is the cast of characters inside the struct. Every single one is iconic in its own way. Let's get into it. π
devβ Pointer to the structure device. Like, the actualstruct devicepointer. Main character energy.vbus_detectedβ VBUS detected. That's it. That's the whole thing.vbus_detected_startβ VBUS detected during startup. iykyk.ac_connβ This will betruewhen the AC charger has been plugged in. Slay.vddadc_en_acβ Indicate if VDD ADC supply is enabled because AC charger is enabled. Obsessed with the specificity.vddadc_en_usbβ Indicate if VDD ADC supply is enabled because USB charger is enabled. Twin energy with the one above.vbatβ Battery voltage. Simple, effective, we love her.old_vbatβ Previously measured battery voltage. The throwback version. π«Άusb_device_is_unrecognisedβ USB device is unrecognised by the hardware. Oop, not the hardware being confused. πautopowerβ Indicate if we should have automatic pwron after pwrloss. (Yes, that's "power on after power loss", and the abbreviation is exactly as written. No cap.)autopower_cfgβ Platform specific power config support for "pwron after pwrloss". The config for the autopower vibe.invalid_charger_detect_stateβ State when forcing AB to use invalid charger. Careful with this one, bestie.is_aca_ridβ Indicate if accessory is ACA type. Not "Incicate" β we fixed the typo, but the vibe is intact. π¦current_stepping_sessionsβ Counter for current stepping sessions. It's anatomic_t, so it's doing the most.parentβ Pointer to thestruct ab8500. The parent figure, literally.adc_main_charger_vβ ADC channel for main charger voltage. πadc_main_charger_cβ ADC channel for main charger current. πadc_vbus_vβ ADC channel for USB charger voltage. (Yes, "vbus_v" β not a typo, that's the name.) πadc_usb_charger_cβ ADC channel for USB charger current. πbmβ Platform specific battery management information. The battery's biography, basically.flagsβ Structure for information about events triggered. The receipts, if you will.usb_stateβ Structure for usb stack information. The USB lore.max_usb_in_currβ Max USB charger input current. The limit, the boundary, the icon.ac_chgβ AC charger power supply. It's the AC charger's main character moment.usb_chgβ USB charger power supply. Same but USB.acβ Structure that holds the AC charger properties. All the AC details live here.usbβ Structure that holds the USB charger properties. All the USB details live here.reguβ Pointer to thestruct regulator. The regulator's pointer, no notes.charger_wqβ Work queue for the IRQs and checking HW state. The queue where the work happens. πusb_ipt_crnt_lockβ Lock to protect VBUS input current setting from mutuals. Honestly, protect it from the mutuals, periodt.check_hw_failure_workβ Work for checking HW state. (Spoiler: it checks the hardware. We stan a straightforward queen.)check_usbchgnotok_workβ Work for checking USB charger not ok status. The "not ok" check, very important.kick_wd_workβ Work for kicking the charger watchdog in case of ABB rev 1.* due to the watchdog logic bug. Yes, there's a bug, and yes, this work kicks the watchdog because of it. (The original says "watchog" but we both know what it means. π)usb_state_changed_workβ Work for checking USB state. Because the state might have changed, bestie.attach_workβ Work for detecting USB type. The "what even are you" work.ac_charger_attached_workβ Work for checking if AC charger is still connected. Are they still with us? πusb_charger_attached_workβ Work for checking if USB charger is still connected. Same energy, USB edition.vbus_drop_end_workβ Work for detecting VBUS drop end. The end of the drop, literally.ac_workβ Work for checking AC charger connection. The connection check.detect_usb_type_workβ Work for detecting the USB type connected. The USB type detective.usb_link_status_workβ Work for checking the new USB link status. New link, who dis?check_main_thermal_prot_workβ Work for checking Main thermal status. Temperature check, literally.check_usb_thermal_prot_workβ Work for checking USB thermal status. The USB temp check.charger_attached_mutexβ For controlling the wakelock. The final boss of the struct, controlling the wakelock. π
Also in the struct but not described in the Members list above:check_vbat_work,usb_phy, andnb. They're in the synopsis though, so don't come for me. π
π₯ SEE ALSO π₯
The kernel file is ./drivers/power/supply/ab8500_charger.c β that's where this whole situation lives. And here's the full squad of functions, no skips, no cuts:
ab8500_charger_interrupts(9)ab8500_power_supply_changed(9)ab8500_charger_get_ac_voltage(9)ab8500_charger_ac_cv(9)ab8500_charger_get_vbus_voltage(9)ab8500_charger_get_usb_current(9)ab8500_charger_get_ac_current(9)ab8500_charger_usb_cv(9)ab8500_charger_detect_chargers(9)ab8500_charger_max_usb_curr(9)ab8500_charger_read_usb_type(9)ab8500_charger_detect_usb_type(9)ab8500_charger_get_usb_cur(9)ab8500_charger_check_continue_stepping(9)ab8500_charger_set_current(9)ab8500_charger_set_vbus_in_curr(9)ab8500_charger_set_main_in_curr(9)ab8500_charger_set_output_curr(9)ab8500_charger_led_en(9)ab8500_charger_ac_en(9)ab8500_charger_usb_en(9)ab8500_charger_usb_check_enable(9)ab8500_charger_ac_check_enable(9)ab8500_charger_watchdog_kick(9)ab8500_charger_update_charger_current(9)ab8500_charger_check_vbat_work(9)ab8500_charger_check_hw_failure_work(9)ab8500_charger_kick_watchdog_work(9)ab8500_charger_ac_work(9)ab8500_charger_detect_usb_type_work(9)ab8500_charger_usb_link_attach_work(9)ab8500_charger_usb_link_status_work(9)ab8500_charger_check_usbchargernotok_work(9)ab8500_charger_check_main_thermal_prot_work(9)ab8500_charger_check_usb_thermal_prot_work(9)ab8500_charger_mainchunplugdet_handler(9)ab8500_charger_mainchplugdet_handler(9)ab8500_charger_mainextchnotok_handler(9)ab8500_charger_mainchthprotr_handler(9)ab8500_charger_mainchthprotf_handler(9)ab8500_charger_vbusdetf_handler(9)ab8500_charger_vbusdetr_handler(9)ab8500_charger_usblinkstatus_handler(9)ab8500_charger_usbchthprotr_handler(9)ab8500_charger_usbchthprotf_handler(9)ab8500_charger_usbchargernotokr_handler(9)ab8500_charger_chwdexp_handler(9)ab8500_charger_vbuschdropend_handler(9)ab8500_charger_vbusovv_handler(9)ab8500_charger_ac_get_property(9)ab8500_charger_usb_get_property(9)ab8500_charger_init_hw_registers(9)
Okay so that's the whole struct, every single member, no cap. This page is from ./drivers/power/supply and it's dated October 2026, so you know it's fresh. Go forth and charger, bestie. πβ¨π¦
π¦ 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