pxa_udc_vbus_draw(9)
π 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 π
- ep matching & pio stuff:
is_match_usb_pxa(9),find_pxa_ep(9),update_pxa_ep_matches(9),pio_irq_enable(9),pio_irq_disable(9) - UDCCR mask things:
udc_set_mask_UDCCR(9),udc_clear_mask_UDCCR(9),ep_write_UDCCSR(9) - endpoint helpers:
ep_count_bytes_remain(9),ep_is_empty(9),ep_is_full(9),epout_has_pkt(9),set_ep0state(9),ep0_idle(9),inc_ep_stats_reqs(9),inc_ep_stats_bytes(9) - setup & requests:
pxa_ep_setup(9),pxa_eps_setup(9),pxa_ep_alloc_request(9),pxa_ep_free_request(9),ep_add_request(9),ep_del_request(9),req_done(9) - ending requests:
ep_end_out_req(9),ep0_end_out_req(9),ep_end_in_req(9),ep0_end_in_req(9),nuke(9) - packets & fifos:
read_packet(9),write_packet(9),read_fifo(9),write_fifo(9),read_ep0_fifo(9),write_ep0_fifo(9) - queueing & halting:
pxa_ep_queue(9),pxa_ep_dequeue(9),pxa_ep_set_halt(9),pxa_ep_fifo_status(9),pxa_ep_fifo_flush(9),pxa_ep_enable(9),pxa_ep_disable(9),dplus_pullup(9) - udc core-ish:
pxa_udc_get_frame(9),pxa_udc_wakeup(9),should_enable_udc(9),should_disable_udc(9),pxa_udc_pullup(9),pxa_udc_vbus_session(9),pxa_udc_phy_event(9),udc_disable(9),udc_init_data(9),udc_enable(9) - start & stop:
pxa27x_udc_start(9),stop_activity(9),pxa27x_udc_stop(9) - ep0 handling & reconfig:
handle_ep0_ctrl_req(9),handle_ep0(9),handle_ep(9),pxa27x_change_configuration(9),pxa27x_change_interface(9) - irq squad:
irq_udc_suspend(9),irq_udc_resume(9),irq_udc_reconfig(9),irq_udc_reset(9),pxa_udc_irq(9) - probe / remove / pm:
pxa_udc_probe(9),pxa_udc_remove(9),pxa_udc_suspend(9),pxa_udc_resume(9)
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
- 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