pch_udc_pcd_vbus_draw(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pch_udc_pcd_vbus_draw(9) β€” like, the whole vibe

okay bestie, so this page is from the Kernel API Manual, and it's literally all about pch_udc_pcd_vbus_draw. she's a little function with a big job and honestly? she ate. let's get into it 🫢


✨ NAME ✨

pch_udc_pcd_vbus_draw β€” so this API is used by gadget drivers during SET_CONFIGURATION calls to specify how much power the device can consume. that's it, that's the whole point of her existence, and she's serving πŸ’–


🌸 SYNOPSIS 🌸

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

she takes two things and gives you back an int, no cap.


πŸŽ€ ARGUMENTS πŸŽ€

  • gadget β€” Reference to the gadget driver. this is the main character she's talking to, lowkey important, don't forget her πŸ¦‹
  • mA β€” specifies the current limit in 2mA unit. read that again bestie, 2mA unit, not 1mA, not milliamp-per-milliamp. do the math accordingly ✨

πŸ”₯ DESCRIPTION πŸ”₯

so this is the part where we talk about what she gives back, and it's giving return codes:

  • -EINVAL β€” If the gadget passed is NULL. yes, if you hand her nothing she's gonna be like "girl, no" and return this πŸ™ˆ
  • -EOPNOTSUPP β€”

and that's… genuinely where the original page ends. like, mid-sentence, mid-thought, the manpage just stops. no notes, no further explanation, just -EOPNOTSUPP: and then vibes πŸ’€ i'm not making anything up here, i'm reporting exactly what's on the page. the docs said "and for my next trick" and then clocked out. iconic behavior honestly.


πŸ‘‘ SEE ALSO πŸ‘‘

okay this section is a whole friend group, it's giving "and here's everyone she knows." the kernel file is ./drivers/usb/gadget/udc/pch_udc.c and the extended fam is huge, buckle up πŸŽ€

like i said. huge friend group. she knows everyone at this point, iykyk πŸ’…


ngl the takeaway is: pass her a real gadget, pass mA in 2mA units, and if you pass NULL she WILL hit you with -EINVAL. and -EOPNOTSUPP is out here too, existing, unexplained, mysterious, main character energy πŸ‘‘

and that's the page bestie!! 🌈 this was the pch_udc_pcd_vbus_draw(9) situation, straight outta ./drivers/usb/gadget/udc, dated October 2026. go forth, draw some vbus, and stay slay πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from