of_usb_get_dr_mode_by_phy(9)
π of_usb_get_dr_mode_by_phy β like, the whole thing, from the Kernel API Manual π
okay bestie, gather round, because this one is genuinely so useful and nobody talks about it enough. this is of_usb_get_dr_mode_by_phy(9) and it's giving "quiet main character of the USB device tree" energy. no cap. π¦
πΈ NAME πΈ
of_usb_get_dr_mode_by_phy β gets the dual role mode for the controller device that's associated with the phy device_node you hand it. that's it, that's the whole vibe. π
β¨ SYNOPSIS β¨
enum usb_dr_mode of_usb_get_dr_mode_by_phy (struct device_node *np , int
arg0 );
literally just these two args. slay. π
π«Ά ARGUMENTS π«Ά
npβ a pointer to the given phydevice_node. like, the phy you're asking about. that one. πarg0β the phandleargs[0]for phys that have#phy-cells >= 1, or-1for phys which do not have phy-cells. yes,-1is the "no cells here, bestie" sentinel. don't forget it. β
π₯ DESCRIPTION π₯
so in dts (the device tree, iykyk), a usb controller associates with phy devices. this function goes and grabs the string from the property 'dr_mode' of the controller that's associated with the phy device node you passed in, and then returns the corresponding enum usb_dr_mode. π«
that's the whole flow. node in, dr_mode enum out. iconic behaviour honestly. π
heads up: it's reading 'dr_mode' off the controller associated with the phy node β not off the phy node itself. keep that straight and you're golden. π
π SEE ALSO π
the kernel file lives at ./drivers/usb/common/common.c and here's the whole friend group you should also go say hi to:
usb_ep_type_string(9)usb_otg_state_string(9)usb_speed_string(9)usb_get_maximum_speed(9)usb_get_maximum_ssp_rate(9)usb_state_string(9)usb_get_dr_mode_from_string(9)usb_get_role_switch_default_mode(9)usb_decode_interval(9)of_usb_host_tpl_support(9)of_usb_update_otg_caps(9)usb_of_get_companion_dev(9)
go follow all of them fr fr π§π
aaaand that's the page!! π shoutout to the ./drivers/usb/common directory, dated October 2026, home of of_usb_get_dr_mode_by_phy(9) β mwah, love u, bye bestie!! πβ¨ππ¦πΈπ
π«Άπ₯πβππππ§π
π¦ 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