of_usb_get_dr_mode_by_phy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ 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 phy device_node. like, the phy you're asking about. that one. πŸ‘ˆ
  • arg0 β€” the phandle args[0] for phys that have #phy-cells >= 1, or -1 for phys which do not have phy-cells. yes, -1 is 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:

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