usb_gadget_vbus_draw(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– usb_gadget_vbus_draw(9) β€” the Kernel API Manual page you didn't know you needed πŸ’–

okay so bestie, welcome to the usb_gadget_vbus_draw(9) page from the Kernel API Manual ✨ this one's short and sweet and honestly it's giving "small but mighty" energy, so let's get into it 🫢


🌸 NAME 🌸

usb_gadget_vbus_draw β€” constrain controller's VBUS power usage ⚑


πŸŽ€ SYNOPSIS πŸŽ€

int usb_gadget_vbus_draw (struct usb_gadget *gadget , unsigned mA );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • gadget β€” the device whose VBUS usage is being described, iykyk πŸ‘‘ this is the gadget in question, no cap
  • mA β€” how much current to draw, in milliAmperes πŸ’… and listen, this one has a lil rule: this should be twice the value listed in the configuration descriptor bMaxPower field. twice!! fr fr, don't forget the 2x πŸ™ˆ

✨ DESCRIPTION ✨

so this call is used by gadget drivers during SET_CONFIGURATION calls, and it's basically reporting how much power the device may consume πŸ”₯ for example, this could affect how quickly batteries are recharged β€” like literally, it can change your charging vibe πŸ“

Returns zero on success, else negative errno πŸ’€ (that's the whole return story, bestie β€” zero means slay, negative means something went sideways)


🌈 SEE ALSO 🌈

okay this list is LONG but we don't skip, periodt. first up, the kernel file itself: ./drivers/usb/gadget/udc/core.c 🧚 and then all the friends:


that's the whole page bestie, no filler, all facts πŸ’– go forth and constrain that VBUS power usage responsibly πŸ’…

and a lil sign-off πŸŽ€ this one comes from the source ./drivers/usb/gadget/udc, dated October 2026 β€” iconic, we love a dated queen πŸ‘‘βœ¨

πŸ“¦ where this page comes from