usb_role_switch_set_role(9)
π 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.
usb_role_switch_get_role(9)usb_role_switch_get(9)fwnode_usb_role_switch_get(9)usb_role_switch_put(9)usb_role_switch_find_by_fwnode(9)usb_role_switch_register(9)usb_role_switch_unregister(9)usb_role_switch_set_drvdata(9)usb_role_switch_get_drvdata(9)
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
- 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