acpi_nhlt_find_fmtcfg(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… acpi_nhlt_find_fmtcfg β€” the kernel API manual, bestie edition πŸŽ€

okay so bestie, this one lives in the Kernel API Manual, section 9 β€” and it's honestly such a mood. The whole vibe? You've got an audio format out there somewhere in the NHLT tables and you need to find it. Not me refreshing the search bar five times. Anyway. Let's get into it πŸ¦‹


✨ NAME ✨

acpi_nhlt_find_fmtcfg β€” literally goes through all the NHLT tables looking for one specific format. That's the whole job. Iconic, focused, no notes πŸ’…


🌸 SYNOPSIS 🌸

struct acpi_nhlt_format_config * acpi_nhlt_find_fmtcfg (int link_type ,
int dev_type , int dir , int bus_id , u16 ch , u32 rate , u16 vbps , u16
bps );

🫢 ARGUMENTS 🫢

  • link_type β€” the hardware link type, e.g.: PDM or SSP. yes it's giving "which flavour of wire are we on" πŸ’–
  • dev_type β€” the device type. what kind of device we're even talking about ✨
  • dir β€” stream direction. like, which way is the audio flowing, bestie πŸŽ€
  • bus_id β€” the ID of virtual bus hosting the endpoint. it's the address of the whole situation, iykyk πŸ¦‹
  • ch β€” number of channels. how many at once, no cap 🌸
  • rate β€” samples per second. the tempo of it all πŸ”₯
  • vbps β€” valid bits per sample. πŸ’«
  • bps β€” bits per sample. yes both of these exist, they're different things, don't @ me πŸ’€

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the little secret that makes this function so flexible: either of link_type, dev_type, dir or bus_id may be set to a negative value to ignore that parameter during the search. 🧚 So you get to be like "idk bestie, don't filter on this one" and it just... respects that. Wild. Love that for you. >= 0? It's getting filtered. < 0? It's a free pass. Periodt πŸ‘‘


⭐ RETURN ⭐

  • A pointer to the format matching the criteria πŸ’–
  • NULL if it's not found 😭
  • an ERR_PTR otherwise πŸ™ˆ

so like, check what you got back before you go dereferencing, mwah πŸŽ€


🌈 SEE ALSO 🌈

Kernel file ./drivers/acpi/nhlt.c, plus the whole friend group:


okay that's the whole page bestie, go find your format πŸ¦‹πŸ’œ

sign-off szn: this lives in ./drivers/acpi, dated October 2026, from the Kernel API Manual β€” acpi_nhlt_find_fmtcfg(9), section 9 and all πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from