acpi_nhlt_find_fmtcfg(9)
π 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.:PDMorSSP. 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 π
NULLif it's not found π- an
ERR_PTRotherwise π
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:
acpi_nhlt_get_gbl_table(9)acpi_nhlt_put_gbl_table(9)acpi_nhlt_endpoint_match(9)acpi_nhlt_tb_find_endpoint(9)acpi_nhlt_find_endpoint(9)acpi_nhlt_endpoint_find_fmtcfg(9)acpi_nhlt_tb_find_fmtcfg(9)acpi_nhlt_endpoint_mic_count(9)
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
- 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