include/acpi/nhlt.h
Source file repositories/reference/linux-study-clean/include/acpi/nhlt.h
File Facts
- System
- Linux kernel
- Corpus path
include/acpi/nhlt.h- Extension
.h- Size
- 5425 bytes
- Lines
- 182
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/kconfig.hlinux/overflow.hlinux/types.h
Detected Declarations
function Copyrightfunction acpi_nhlt_get_gbl_tablefunction acpi_nhlt_put_gbl_tablefunction acpi_nhlt_tb_find_endpointfunction acpi_nhlt_endpoint_find_fmtcfgfunction acpi_nhlt_tb_find_fmtcfgfunction acpi_nhlt_endpoint_mic_countfunction acpi_nhlt_find_endpointfunction acpi_nhlt_find_fmtcfg
Annotated Snippet
#ifndef __ACPI_NHLT_H__
#define __ACPI_NHLT_H__
#include <linux/acpi.h>
#include <linux/kconfig.h>
#include <linux/overflow.h>
#include <linux/types.h>
#define __acpi_nhlt_endpoint_config(ep) ((void *)((ep) + 1))
#define __acpi_nhlt_config_caps(cfg) ((void *)((cfg) + 1))
/**
* acpi_nhlt_endpoint_fmtscfg - Get the formats configuration space.
* @ep: the endpoint to retrieve the space for.
*
* Return: A pointer to the formats configuration space.
*/
static inline struct acpi_nhlt_formats_config *
acpi_nhlt_endpoint_fmtscfg(const struct acpi_nhlt_endpoint *ep)
{
struct acpi_nhlt_config *cfg = __acpi_nhlt_endpoint_config(ep);
return (struct acpi_nhlt_formats_config *)((u8 *)(cfg + 1) + cfg->capabilities_size);
}
#define __acpi_nhlt_first_endpoint(tb) \
((void *)(tb + 1))
#define __acpi_nhlt_next_endpoint(ep) \
((void *)((u8 *)(ep) + (ep)->length))
#define __acpi_nhlt_get_endpoint(tb, ep, i) \
((i) ? __acpi_nhlt_next_endpoint(ep) : __acpi_nhlt_first_endpoint(tb))
#define __acpi_nhlt_first_fmtcfg(fmts) \
((void *)(fmts + 1))
#define __acpi_nhlt_next_fmtcfg(fmt) \
((void *)((u8 *)((fmt) + 1) + (fmt)->config.capabilities_size))
#define __acpi_nhlt_get_fmtcfg(fmts, fmt, i) \
((i) ? __acpi_nhlt_next_fmtcfg(fmt) : __acpi_nhlt_first_fmtcfg(fmts))
/*
* The for_each_nhlt_*() macros rely on an iterator to deal with the
* variable length of each endpoint structure and the possible presence
* of an OED-Config used by Windows only.
*/
/**
* for_each_nhlt_endpoint - Iterate over endpoints in a NHLT table.
* @tb: the pointer to a NHLT table.
* @ep: the pointer to endpoint to use as loop cursor.
*/
#define for_each_nhlt_endpoint(tb, ep) \
for (unsigned int __i = 0; \
__i < (tb)->endpoints_count && \
(ep = __acpi_nhlt_get_endpoint(tb, ep, __i)); \
__i++)
/**
* for_each_nhlt_fmtcfg - Iterate over format configurations.
* @fmts: the pointer to formats configuration space.
* @fmt: the pointer to format to use as loop cursor.
*/
#define for_each_nhlt_fmtcfg(fmts, fmt) \
for (unsigned int __i = 0; \
__i < (fmts)->formats_count && \
(fmt = __acpi_nhlt_get_fmtcfg(fmts, fmt, __i)); \
__i++)
/**
* for_each_nhlt_endpoint_fmtcfg - Iterate over format configurations in an endpoint.
* @ep: the pointer to an endpoint.
* @fmt: the pointer to format to use as loop cursor.
*/
#define for_each_nhlt_endpoint_fmtcfg(ep, fmt) \
for_each_nhlt_fmtcfg(acpi_nhlt_endpoint_fmtscfg(ep), fmt)
#if IS_ENABLED(CONFIG_ACPI_NHLT)
/*
* System-wide pointer to the first NHLT table.
*
* A sound driver may utilize acpi_nhlt_get/put_gbl_table() on its
* initialization and removal respectively to avoid excessive mapping
* and unmapping of the memory occupied by the table between streaming
* operations.
*/
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/kconfig.h`, `linux/overflow.h`, `linux/types.h`.
- Detected declarations: `function Copyright`, `function acpi_nhlt_get_gbl_table`, `function acpi_nhlt_put_gbl_table`, `function acpi_nhlt_tb_find_endpoint`, `function acpi_nhlt_endpoint_find_fmtcfg`, `function acpi_nhlt_tb_find_fmtcfg`, `function acpi_nhlt_endpoint_mic_count`, `function acpi_nhlt_find_endpoint`, `function acpi_nhlt_find_fmtcfg`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.