dwc3_set_prtcap(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dwc3_set_prtcap(9) β€” like, the Kernel API Manual page, bestie ✨

okay so real talk, this is a page straight out of the Kernel API Manual and it's about dwc3_set_prtcap β€” the lil' function that sets your USB controller's PRTCAP mode. yes it's niche. yes it's iconic. let's get into it 🫢


✨ NAME ✨

dwc3_set_prtcap β€” literally just: set the USB controller PRTCAP mode πŸ’«


🌸 SYNOPSIS 🌸

void dwc3_set_prtcap (struct dwc3 *dwc , u32 mode , bool ignore_susphy );

that's the whole vibe. three args, one void return, no drama (well… okay a little drama, see DESCRIPTION) πŸ’œ


πŸŽ€ ARGUMENTS πŸŽ€

  • dwc β€” a pointer to your DWC3 controller context. this is the main character of the whole operation, no cap 🌟
  • mode β€” the target mode you want, and it must be one of DWC3_GCTL_PRTCAP_{HOST,DEVICE,OTG}. like, those are the only valid options, periodt πŸ’…
  • ignore_susphy β€” if this is true, we skip disabling the SUSPHY and just keep the current state. a little "nah, we're good, leave it" flag πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

So. What does this actually do? It updates the PRTCAP of the controller and current_dr_role inside the dwc3 structure. two things, one function, efficient queen behavior πŸ‘‘

For DRD controllers, it also disables SUSPHY β€” unless you explicitly told it to skip that via the ignore_susphy parameter. so like, know what you're asking for 🌈

⚠️ ngl, this is usually handled by the dwc3 core code. so please don't just go calling it for funsies.

The one situation where you'd genuinely reach for this: when skip_core_init_mode is used and the glue layer needs to manage mode transitions itself due to platform-specific requirements. that's the whole use case, iykyk 🧚

And here's the part you cannot skip: it must be called with the correct mode before calling dwc3_host_init or dwc3_gadget_init. order matters, bestie. do it out of order and you're on your own 😭


πŸ”₯ SEE ALSO πŸ”₯


that's the whole page!! live from ./drivers/usb/dwc3, dated October 2026, mwah πŸ’‹βœ¨ go set some PRTCAP modes responsibly, ily 🫢

πŸ“¦ where this page comes from