usb_phy_notify_charger_work(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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_detect path, the usb phy driver has to call usb_phy_set_charger_state itself 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:


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