dwc3_set_prtcap(9)
π 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 ofDWC3_GCTL_PRTCAP_{HOST,DEVICE,OTG}. like, those are the only valid options, periodt πignore_susphyβ if this istrue, 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 π₯
- Kernel file
./drivers/usb/dwc3/glue.hβ go read it, it's giving essential context π dwc3_core_probe(9)dwc3_core_remove(9)dwc3_core_init(9)dwc3_core_exit(9)dwc3_host_init(9)dwc3_host_exit(9)dwc3_gadget_init(9)dwc3_gadget_exit(9)dwc3_enable_susphy(9)
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
- 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