STRUCT ROCKCHIP_USB2PHY_PORT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct rockchip_usb2phy_port(9) πŸ’–

okay bestie, welcome to the Kernel API Manual ✨ β€” we're looking at struct rockchip_usb2phy_port today and honestly? she's doing a lot. this is the usb-phy port data struct, and by the end of this page you're gonna know every single field in her little group chat 🫢


✨ NAME ✨

struct rockchip_usb2phy_port β€” usb-phy port data. that's the whole vibe. port data. iconic. πŸ’…


🌸 SYNOPSIS 🌸

struct rockchip_usb2phy_port {
    struct phy      *phy;
    unsigned int    port_id;
    bool suspended;
    bool vbus_attached;
    bool host_disconnect;
    int bvalid_irq;
    int id_irq;
    int ls_irq;
    int otg_mux_irq;
    struct mutex    mutex;
    struct delayed_work chg_work;
    struct delayed_work otg_sm_work;
    struct delayed_work sm_work;
    const struct    rockchip_usb2phy_port_cfg *port_cfg;
    struct notifier_block   event_nb;
    enum usb_otg_state      state;
    enum usb_dr_mode        mode;
};

like, look at her. so many fields. so much going on. let's do a vibe check on every single one πŸ’œ


πŸ¦‹ Members πŸ¦‹

the basics πŸŽ€

  • phy β€” generic phy. that's it. that's the pointer. she's just a girl πŸ’…
  • port_id β€” flag for otg port or host port. so you know which one you're dealing with, ykwim?
  • suspended β€” phy suspended flag. is she napping? this tells you πŸ¦‹

the status flags ✨

  • vbus_attached β€” otg device vbus status. literally just: is the vbus attached or not πŸ”₯
  • host_disconnect β€” usb host disconnect status. highkey important bestie, don't skip her 😭

the IRQ numbers πŸ””

  • bvalid_irq β€” IRQ number assigned for vbus valid rise detection. she detects the rise, no cap ✨
  • id_irq β€” IRQ number assigned for ID pin detection.
  • ls_irq β€” IRQ number assigned for linestate detection. linestate! she's watching πŸ‘€
  • otg_mux_irq β€” IRQ number which multiplex otg-id/otg-bvalid/linestate irqs to one irq in otg-port. okay so she's out here multiplexing three irqs into one, that's giving main character energy fr fr πŸ‘‘

the locking + work stuff 🧚

  • mutex β€” for register updating in sm_work. keep it locked bestie, no data races on my watch πŸ™ˆ
  • chg_work β€” charge detect work.
  • otg_sm_work β€” OTG state machine work.
  • sm_work β€” HOST state machine work.

the config + events + state 🌈

  • port_cfg β€” port register configuration, assigned by driver data. she didn't pick her own config, the driver data assigned it. iykyk πŸ’œ
  • event_nb β€” hold event notification callback. she's holding it. gently. 🫢
  • state β€” define OTG enumeration states before device reset. the before-reset era, we remember πŸŽ€
  • mode β€” the dr_mode of the controller. periodt. ⭐
lowkey reminder bestie: this page is listing the fields exactly as they are β€” I'm not adding behaviour that isn't here, so don't come for me 😭

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/phy/rockchip/phy-rockchip-inno-usb2.c, enum usb_chg_state(9), struct rockchip_chg_det_reg(9), struct rockchip_usb2phy_port_cfg(9), struct rockchip_usb2phy_cfg(9), struct rockchip_usb2phy(9)

like, go read those too, they're all in the same friend group πŸ’–


and that's the whole page, bestie! 🌸 this little beauty lives under ./drivers/phy/rockchip, dated October 2026, and you can find her again any time as struct rockc...usb2phy_port(9) β€” slay, bye! πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from