usb_role_switch_set_role(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… usb_role_switch_set_role(9)

okay so this is a page straight out of the Kernel API Manual β€” yes, the kernel has a manual, and yes it's serving πŸŽ€


✨ NAME ✨

usb_role_switch_set_role β€” set the USB role for a switch, that's it, that's the whole vibe πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

int usb_role_switch_set_role (struct usb_role_switch *sw , enum usb_role
role );

🌸 ARGUMENTS 🌸

  • sw β€” the USB role switch you're messing with. like, the actual switch object, bestie 🫢
  • role β€” the USB role you want it switched to. the destination. the moment. the switch-up πŸ’…

⭐ DESCRIPTION ⭐

So here's the tea: you call this and it sets the USB role role for sw. That's literally the entire function. Set the role, for the switch, on the switch. It's giving "does exactly what it says on the tin" and honestly? iconic πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/usb/roles/class.c β€” go read it, it's lowkey the source of truth, no cap.


bestie, this page lives in ./drivers/usb/roles and it's dated October 2026, so like… future-coded of it honestly 🌈

and that's the whole page!! mwah πŸ’‹βœ¨ go set some roles, you got this πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from