include/sound/hdaudio.h
Source file repositories/reference/linux-study-clean/include/sound/hdaudio.h
File Facts
- System
- Linux kernel
- Corpus path
include/sound/hdaudio.h- Extension
.h- Size
- 25825 bytes
- Lines
- 766
- Domain
- Driver Families
- Bucket
- include/sound
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/interrupt.hlinux/io.hlinux/io-64-nonatomic-lo-hi.hlinux/iopoll.hlinux/pci.hlinux/pm_runtime.hlinux/timecounter.hsound/core.hsound/pcm.hsound/memalloc.hsound/hda_verbs.hdrm/intel/i915_component.h
Detected Declarations
struct hdac_busstruct hdac_streamstruct hdac_devicestruct hdac_driverstruct hdac_widget_treestruct hda_device_idstruct snd_arraystruct hdac_devicestruct hdac_driverstruct hdac_bus_opsstruct hdac_ext_bus_opsstruct hdac_rbstruct hdac_busstruct hdac_streamfunction snd_hdac_read_parmfunction snd_hdac_enter_pmfunction snd_hdac_leave_pmfunction snd_hdac_is_in_pmfunction snd_hdac_is_power_onfunction snd_hdac_power_upfunction snd_hdac_power_downfunction snd_hdac_power_up_pmfunction snd_hdac_power_down_pmfunction snd_hdac_keep_power_upfunction snd_hdac_enter_pmfunction snd_hdac_is_power_onfunction snd_hdac_reg_writebfunction snd_hdac_reg_writewfunction snd_hdac_reg_readbfunction snd_hdac_reg_readwfunction snd_hdac_dsp_preparefunction snd_hdac_dsp_triggerfunction snd_hdac_get_wcaps_channelsfunction snd_array_initfunction snd_array_index
Annotated Snippet
extern const struct bus_type snd_hda_bus_type;
/*
* generic arrays
*/
struct snd_array {
unsigned int used;
unsigned int alloced;
unsigned int elem_size;
unsigned int alloc_align;
void *list;
};
/*
* HD-audio codec base device
*/
struct hdac_device {
struct device dev;
int type;
struct hdac_bus *bus;
unsigned int addr; /* codec address */
struct list_head list; /* list point for bus codec_list */
hda_nid_t afg; /* AFG node id */
hda_nid_t mfg; /* MFG node id */
/* ids */
unsigned int vendor_id;
unsigned int subsystem_id;
unsigned int revision_id;
unsigned int afg_function_id;
unsigned int mfg_function_id;
unsigned int afg_unsol:1;
unsigned int mfg_unsol:1;
unsigned int power_caps; /* FG power caps */
const char *vendor_name; /* codec vendor name */
const char *chip_name; /* codec chip name */
/* verb exec op override */
int (*exec_verb)(struct hdac_device *dev, unsigned int cmd,
unsigned int flags, unsigned int *res);
/* widgets */
unsigned int num_nodes;
hda_nid_t start_nid, end_nid;
/* misc flags */
atomic_t in_pm; /* suspend/resume being performed */
/* sysfs */
struct mutex widget_lock;
struct hdac_widget_tree *widgets;
/* regmap */
struct regmap *regmap;
struct mutex regmap_lock;
struct snd_array vendor_verbs;
bool lazy_cache:1; /* don't wake up for writes */
bool caps_overwriting:1; /* caps overwrite being in process */
bool cache_coef:1; /* cache COEF read/write too */
unsigned int registered:1; /* codec was registered */
};
/* device/driver type used for matching */
enum {
HDA_DEV_CORE,
HDA_DEV_LEGACY,
HDA_DEV_ASOC,
};
enum {
SND_SKL_PCI_BIND_AUTO, /* automatic selection based on pci class */
SND_SKL_PCI_BIND_LEGACY,/* bind only with legacy driver */
SND_SKL_PCI_BIND_ASOC /* bind only with ASoC driver */
};
/* direction */
enum {
HDA_INPUT, HDA_OUTPUT
};
#define dev_to_hdac_dev(_dev) container_of(_dev, struct hdac_device, dev)
int snd_hdac_device_init(struct hdac_device *dev, struct hdac_bus *bus,
const char *name, unsigned int addr);
void snd_hdac_device_exit(struct hdac_device *dev);
int snd_hdac_device_register(struct hdac_device *codec);
void snd_hdac_device_unregister(struct hdac_device *codec);
Annotation
- Immediate include surface: `linux/device.h`, `linux/interrupt.h`, `linux/io.h`, `linux/io-64-nonatomic-lo-hi.h`, `linux/iopoll.h`, `linux/pci.h`, `linux/pm_runtime.h`, `linux/timecounter.h`.
- Detected declarations: `struct hdac_bus`, `struct hdac_stream`, `struct hdac_device`, `struct hdac_driver`, `struct hdac_widget_tree`, `struct hda_device_id`, `struct snd_array`, `struct hdac_device`, `struct hdac_driver`, `struct hdac_bus_ops`.
- Atlas domain: Driver Families / include/sound.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.