usb_phy_notify_charger_work(9)
π usb_phy_notify_charger_work(9) π
okay so bestie, this page is straight out of the Kernel API Manual, and todayβs main character is the charger-state notification work. Itβs giving βtell everyone the charger situation changedβ energy, fr fr. β¨
π NAME π
usb_phy_notify_charger_work β notify the USB charger state. literally the whole point, no cap. π
πΈ SYNOPSIS πΈ
void usb_phy_notify_charger_work (struct work_struct *work );
π¦ ARGUMENTS π¦
workβ the charger work that gets to notify the USB charger state. thatβs the one and only arg, bestie. π«Ά
π DESCRIPTION π
This work can be issued when the USB charger state has been changed or when the USB charger current has been changed. Then we can notify the current β like what can be drawn to power user β and the charger state to userspace. So yeah, itβs the little messenger of charger updates. iconic behavior, honestly. π
If we get the charger type from the extcon subsystem, we can notify the charger state to the power user automatically by usb_phy_get_charger_type issuing from the extcon subsystem. iykyk β extcon handles the auto-notify vibe. β¨
If we get the charger type from ->charger_detect instead of the extcon subsystem, the usb phy driver should issue usb_phy_set_charger_state to set the charger state when the charger state has been changed. No skipping that step, bestie β thatβs the manualβs rule. π
lowkey important: on the->charger_detectpath, the usb phy driver has to callusb_phy_set_charger_stateitself when the charger state changes. The extcon path is the automatic one. π¦
π SEE ALSO π
Kernel file ./drivers/usb/phy/phy.c, plus these absolute icons:
usb_phy_get_charger_type(9)usb_phy_set_charger_current(9)usb_phy_get_charger_current(9)usb_phy_set_charger_state(9)devm_usb_get_phy(9)usb_get_phy(9)devm_usb_get_phy_by_node(9)devm_usb_get_phy_by_phandle(9)usb_put_phy(9)usb_add_phy(9)usb_add_phy_dev(9)usb_remove_phy(9)usb_phy_set_event(9)
mwah π β source/version tag is ./drivers/usb/phy, and the date stamp is October 2026. thatβs the whole page, bestie; go forth and notify that charger state π«Άπ
π¦ 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