STRUCT AB8500_CHARGER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 actual struct device pointer. 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 be true when 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 an atomic_t, so it's doing the most.
  • parent β€” Pointer to the struct 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 the struct 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, and nb. 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:


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