vga_switcher...audio_client(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ vga_switcheroo_register_audio_client β€” the kernel API manual, bestie edition πŸ’œ

okay so this is from the Kernel API Manual, page vga_switcher...audio_client(9), and it's literally the whole "how do I tell the kernel about my audio client" situation. sit down, grab a strawberry πŸ“, we're doing this.


✨ NAME ✨

vga_switcheroo_register_audio_client β€” register audio client

like... it registers an audio client. that's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

int vga_switcheroo_register_audio_client (struct pci_dev *pdev , const
struct vga_switcheroo_client_ops *ops , struct pci_dev *vga_dev );

that's the signature, no cap, copy it exactly, pdev space comma ops space comma vga_dev β€” the spacing is giving old manpage, and we respect it 🫢


✨ ARGUMENTS ✨

  • pdev β€” the client pci device, like the actual device you're registering. main character energy πŸ‘‘
  • ops β€” the client callbacks. the little function pointers that go "hey do this" when stuff happens. lowkey essential πŸ’…
  • vga_dev β€” the pci device that's bound to the current audio client. not a rando, it's the one that's like, actually attached. πŸ¦‹

✨ DESCRIPTION ✨

so here's the tea β˜• β€” this registers an audio client, meaning the audio device on a GPU. yes, GPU audio, it's a thing, iykyk.

the client is assumed to use runtime PM. like, that's the deal going in, the function is not checking your vibe, it's assuming it. 😭

and before you even call this, you gotta call vga_switcheroo_client_probe_defer first β€” that's the vibe check ✨, it makes sure all the prerequisites are actually met. don't skip the pre-check, bestie, that's the whole point of it existing.


✨ RETURN ✨

  • 0 β€” slay, success πŸ’–
  • -ENOMEM β€” memory allocation error, the classic "out of memory" moment πŸ’€
  • -EINVAL β€” got an error getting the client id. not invalid input exactly, it's the getting client id part that went wrong, so read carefully πŸ™ˆ

✨ SEE ALSO ✨

the whole friend group, fr fr 🌈 β€” go read these next:


ok that's the whole page!! you ate that πŸ’… no notes.

and ily, but the receipts at the bottom: this lil page lives in ./drivers/gpu/vga and it's dated October 2026 ✨ go off, kernel docs, periodt πŸ§šπŸ’œ

πŸ“¦ where this page comes from