ab8500_charg...ect_chargers(9)
π NAME π
okay so bestie, let me introduce you to ab8500_charger_detect_chargers β the little function that goes "hiii what's plugged into me rn" and detects the connected chargers β¨π periodt.
This is a page from the Kernel API Manual, and yes we're doing kernel internals but make it cute π
πΈ SYNOPSIS πΈ
int ab8500_charger_detect_chargers (struct ab8500_charger *di , bool
probe );
like literally that's the whole signature, no cap π«Ά
π ARGUMENTS π
diβ pointer to theab8500_chargerstructure. it's giving "here's my whole personality in a struct" πprobeβ if probe, don't delay and wait for HW. so when this bad boy is set we skip the waiting-around era and go straight to the hardware, no chill mode π€
π¦ DESCRIPTION π¦
Returns the type of charger connected. π₯
but bestie, listen β for USB it does not mean we can actually charge from it. it just means there's a USB cable connected that we still have to identify π like knowing someone's at the door but not knowing who they are yet.
This is used during startup when we don't get interrupts of the charger detection. so like, the doorbell's broken so we're just checking the porch manually, iykyk π
Returns an integer value, that means:
NO_PW_CONNβ no power supply is connected πAC_PW_CONNβ if the AC power supply is connected β‘USB_PW_CONNβ if the USB power supply is connected πAC_PW_CONN + USB_PW_CONNβ if USB and AC power supplies are both connected πβ¨ (both? at the same time? main character energy fr fr)
π SEE ALSO π
the whole squad, assembled π«Ά first up, the kernel file itself:
Kernel file ./drivers/power/supply/ab8500_charger.c
then the friends:
struct ab8500_charger_interrupts(9)struct ab8500_charger(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_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)
bestie there are literally SO many handler functions and every single one of them made the list, we are not skipping a single one, that would be so rude π
mwah, that's the page π«Ά this little number lives under ./drivers/power/supply and it's dated October 2026, which is giving "from the future" but make it kernel docs β go plug something in, bestie, and slay π
π¦ 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