ENUM USB_CHG_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… enum usb_chg_state(9) πŸ’…

okay bestie, welcome to the Kernel API Manual page for enum usb_chg_state(9). the vibe? different states involved in USB charger detection. no cap, it’s a whole little enum era ✨

🌸 NAME 🌸

enum usb_chg_state β€” Different states involved in USB charger detection.

✨ SYNOPSIS ✨

enum usb_chg_state {
    USB_CHG_STATE_UNDEFINED ,
    USB_CHG_STATE_WAIT_FOR_DCD ,
    USB_CHG_STATE_DCD_DONE ,
    USB_CHG_STATE_PRIMARY_DONE ,
    USB_CHG_STATE_SECONDARY_DONE ,
    USB_CHG_STATE_DETECTED

};

she’s giving β€œstate machine but make it cute,” and honestly? iconic πŸŽ€

🧚 Constants 🧚

here’s the squad, one by one:

  • USB_CHG_STATE_UNDEFINED β€” USB charger is not connected or detection process is not yet started. basically: no charger, or we haven’t even begun the detection process yet.
  • USB_CHG_STATE_WAIT_FOR_DCD β€” Waiting for Data pins contact. yes bestie, Data pins contact β€” that’s the whole mood rn.
  • USB_CHG_STATE_DCD_DONE β€” Data pin contact is detected. slay, contact made πŸ’…
  • USB_CHG_STATE_PRIMARY_DONE β€” Primary detection is completed (Detects between SDP and DCP/CDP). iykyk β€” SDP vs DCP/CDP is the tea πŸ“
  • USB_CHG_STATE_SECONDARY_DONE β€” Secondary detection is completed (Detects between DCP and CDP). another round of β€œwhich one is it?” energy, fr fr.
  • USB_CHG_STATE_DETECTED β€” USB charger type is determined. periodt. the charger type has been figured out πŸ‘‘

πŸ¦‹ SEE ALSO πŸ¦‹

okay so if you want the lore, check the Kernel file ./drivers/phy/rockchip/phy-rockchip-inno-usb2.c and these iconic structs:

  • struct rockchip_chg_det_reg(9)
  • struct rockchip_usb2phy_port_cfg(9)
  • struct rockchip_usb2phy_cfg(9)
  • struct rockchip_usb2phy_port(9)
  • struct rockchip_usb2phy(9)

that’s the whole page, bestie 🫢 source/version: ./drivers/phy/rockchip Β· date: October 2026. mwah πŸ’‹

πŸ“¦ where this page comes from