pxa_udc_vbus_draw(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pxa_udc_vbus_draw(9) β€” the kernel API manual, but make it make sense

okay so bestie, welcome to the glow-up edition of pxa_udc_vbus_draw(9), straight out of the Kernel API Manual ✨ this one is short and sweet β€” no cap, it's literally one job β€” so let's get into it 🫢


✨ NAME ✨

pxa_udc_vbus_draw β€” the function that gets called by the gadget driver once SET_CONFIGURATION has completed, so everybody knows how much juice we're allowed to pull πŸ’–


🌸 SYNOPSIS 🌸

int pxa_udc_vbus_draw (struct usb_gadget *_gadget , unsigned mA );

πŸŽ€ ARGUMENTS πŸŽ€

  • _gadget β€” the usb gadget in question, main character of the USB world πŸ‘‘
  • mA β€” the current being drawn, in milliamps. yes, actual numbers, we love a measurable vibe ⚑

πŸ¦‹ CONTEXT πŸ¦‹

task context β€” and heads up bestie, it might sleep 😴 so do not, I repeat do not, call this from somewhere spicy like an atomic context. she naps and she's allowed to.


πŸ’œ DESCRIPTION πŸ’œ

So the flow is: a USB host picks a configuration, and then this function gets called to let everyone know how much current the device is allowed to draw from the VBus line πŸ”Œβœ¨ that's it, that's the whole job. clean, simple, iconic.

It returns 0, or -EOPNOTSUPP if there is no transceiver handling the udc πŸ’€ (iykyk β€” that error is basically the kernel saying "bestie, nobody's home").


🌈 SEE ALSO 🌈

the whole friend group, fr fr β€” no skipping, they all get their moment πŸ’…

also: the kernel file ./drivers/usb/gadget/udc/pxa27x_udc.c is where all of this lives, so that's your source of truth 🧚

okay that's the whole page, you ate that πŸ’…πŸ’– this lil' writeup came to you from the kernel files at ./drivers/usb/gadget/udc, dated October 2026 β€” mwah, go read some source, bestie 🌸✨

πŸ“¦ where this page comes from