sound/pci/ac97/ac97_codec.c
Source file repositories/reference/linux-study-clean/sound/pci/ac97/ac97_codec.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/ac97/ac97_codec.c- Extension
.c- Size
- 95323 bytes
- Lines
- 2997
- Domain
- Driver Families
- Bucket
- sound/pci
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/init.hlinux/slab.hlinux/pci.hlinux/module.hlinux/mutex.hsound/core.hsound/pcm.hsound/tlv.hsound/ac97_codec.hsound/asoundef.hsound/initval.hac97_id.hac97_patch.c
Detected Declarations
struct ac97_codec_idstruct ac97_power_regstruct quirk_tablefunction snd_ac97_valid_regfunction snd_ac97_writefunction snd_ac97_readfunction snd_ac97_read_cachefunction snd_ac97_write_cachefunction snd_ac97_updatefunction snd_ac97_update_bitsfunction snd_ac97_update_bits_nolockfunction snd_ac97_ad18xx_update_pcm_bitsfunction snd_ac97_info_enum_doublefunction snd_ac97_get_enum_doublefunction snd_ac97_put_enum_doublefunction snd_ac97_page_savefunction snd_ac97_page_restorefunction snd_ac97_info_volswfunction snd_ac97_get_volswfunction snd_ac97_put_volswfunction set_inv_eapdfunction snd_ac97_spdif_mask_infofunction snd_ac97_spdif_cmask_getfunction snd_ac97_spdif_pmask_getfunction snd_ac97_spdif_default_getfunction snd_ac97_spdif_default_putfunction snd_ac97_put_spsafunction snd_ac97_ad18xx_pcm_info_bitsfunction snd_ac97_ad18xx_pcm_get_bitsfunction snd_ac97_ad18xx_pcm_put_bitsfunction snd_ac97_ad18xx_pcm_info_volumefunction snd_ac97_ad18xx_pcm_get_volumefunction snd_ac97_ad18xx_pcm_put_volumefunction snd_ac97_bus_freefunction snd_ac97_bus_dev_freefunction snd_ac97_freefunction snd_ac97_dev_freefunction snd_ac97_try_volume_mixfunction check_volume_resolutionfunction snd_ac97_try_bitfunction snd_ac97_change_volume_params2function printablefunction set_tlv_db_scalefunction snd_ac97_cvol_newfunction snd_ac97_cmix_new_stereofunction snd_ac97_mixer_buildfunction snd_ac97_try_volume_mixfunction snd_ac97_modem_build
Annotated Snippet
struct ac97_codec_id {
unsigned int id;
unsigned int mask;
const char *name;
int (*patch)(struct snd_ac97 *ac97);
int (*mpatch)(struct snd_ac97 *ac97);
unsigned int flags;
};
static const struct ac97_codec_id snd_ac97_codec_id_vendors[] = {
{ 0x41445300, 0xffffff00, "Analog Devices", NULL, NULL },
{ 0x414b4d00, 0xffffff00, "Asahi Kasei", NULL, NULL },
{ 0x414c4300, 0xffffff00, "Realtek", NULL, NULL },
{ 0x414c4700, 0xffffff00, "Realtek", NULL, NULL },
/*
* This is an _inofficial_ Aztech Labs entry
* (value might differ from unknown official Aztech ID),
* currently used by the AC97 emulation of the almost-AC97 PCI168 card.
*/
{ 0x415a5400, 0xffffff00, "Aztech Labs (emulated)", NULL, NULL },
{ 0x434d4900, 0xffffff00, "C-Media Electronics", NULL, NULL },
{ 0x43525900, 0xffffff00, "Cirrus Logic", NULL, NULL },
{ 0x43585400, 0xffffff00, "Conexant", NULL, NULL },
{ 0x44543000, 0xffffff00, "Diamond Technology", NULL, NULL },
{ 0x454d4300, 0xffffff00, "eMicro", NULL, NULL },
{ 0x45838300, 0xffffff00, "ESS Technology", NULL, NULL },
{ 0x48525300, 0xffffff00, "Intersil", NULL, NULL },
{ 0x49434500, 0xffffff00, "ICEnsemble", NULL, NULL },
{ 0x49544500, 0xffffff00, "ITE Tech.Inc", NULL, NULL },
{ 0x4e534300, 0xffffff00, "National Semiconductor", NULL, NULL },
{ 0x50534300, 0xffffff00, "Philips", NULL, NULL },
{ 0x53494c00, 0xffffff00, "Silicon Laboratory", NULL, NULL },
{ 0x53544d00, 0xffffff00, "STMicroelectronics", NULL, NULL },
{ 0x54524100, 0xffffff00, "TriTech", NULL, NULL },
{ 0x54584e00, 0xffffff00, "Texas Instruments", NULL, NULL },
{ 0x56494100, 0xffffff00, "VIA Technologies", NULL, NULL },
{ 0x57454300, 0xffffff00, "Winbond", NULL, NULL },
{ 0x574d4c00, 0xffffff00, "Wolfson", NULL, NULL },
{ 0x594d4800, 0xffffff00, "Yamaha", NULL, NULL },
{ 0x83847600, 0xffffff00, "SigmaTel", NULL, NULL },
{ 0, 0, NULL, NULL, NULL }
};
static const struct ac97_codec_id snd_ac97_codec_ids[] = {
{ 0x41445303, 0xffffffff, "AD1819", patch_ad1819, NULL },
{ 0x41445340, 0xffffffff, "AD1881", patch_ad1881, NULL },
{ 0x41445348, 0xffffffff, "AD1881A", patch_ad1881, NULL },
{ 0x41445360, 0xffffffff, "AD1885", patch_ad1885, NULL },
{ 0x41445361, 0xffffffff, "AD1886", patch_ad1886, NULL },
{ 0x41445362, 0xffffffff, "AD1887", patch_ad1881, NULL },
{ 0x41445363, 0xffffffff, "AD1886A", patch_ad1881, NULL },
{ 0x41445368, 0xffffffff, "AD1888", patch_ad1888, NULL },
{ 0x41445370, 0xffffffff, "AD1980", patch_ad1980, NULL },
{ 0x41445372, 0xffffffff, "AD1981A", patch_ad1981a, NULL },
{ 0x41445374, 0xffffffff, "AD1981B", patch_ad1981b, NULL },
{ 0x41445375, 0xffffffff, "AD1985", patch_ad1985, NULL },
{ 0x41445378, 0xffffffff, "AD1986", patch_ad1986, NULL },
{ 0x414b4d00, 0xffffffff, "AK4540", NULL, NULL },
{ 0x414b4d01, 0xffffffff, "AK4542", NULL, NULL },
{ 0x414b4d02, 0xffffffff, "AK4543", NULL, NULL },
{ 0x414b4d06, 0xffffffff, "AK4544A", NULL, NULL },
{ 0x414b4d07, 0xffffffff, "AK4545", NULL, NULL },
{ 0x414c4300, 0xffffff00, "ALC100,100P", NULL, NULL },
{ 0x414c4710, 0xfffffff0, "ALC200,200P", NULL, NULL },
{ 0x414c4721, 0xffffffff, "ALC650D", NULL, NULL }, /* already patched */
{ 0x414c4722, 0xffffffff, "ALC650E", NULL, NULL }, /* already patched */
{ 0x414c4723, 0xffffffff, "ALC650F", NULL, NULL }, /* already patched */
{ 0x414c4720, 0xfffffff0, "ALC650", patch_alc650, NULL },
{ 0x414c4730, 0xffffffff, "ALC101", NULL, NULL },
{ 0x414c4740, 0xfffffff0, "ALC202", NULL, NULL },
{ 0x414c4750, 0xfffffff0, "ALC250", NULL, NULL },
{ 0x414c4760, 0xfffffff0, "ALC655", patch_alc655, NULL },
{ 0x414c4770, 0xfffffff0, "ALC203", patch_alc203, NULL },
{ 0x414c4781, 0xffffffff, "ALC658D", NULL, NULL }, /* already patched */
{ 0x414c4780, 0xfffffff0, "ALC658", patch_alc655, NULL },
{ 0x414c4790, 0xfffffff0, "ALC850", patch_alc850, NULL },
{ 0x415a5401, 0xffffffff, "AZF3328", patch_aztech_azf3328, NULL },
{ 0x434d4941, 0xffffffff, "CMI9738", patch_cm9738, NULL },
{ 0x434d4961, 0xffffffff, "CMI9739", patch_cm9739, NULL },
{ 0x434d4969, 0xffffffff, "CMI9780", patch_cm9780, NULL },
{ 0x434d4978, 0xffffffff, "CMI9761A", patch_cm9761, NULL },
{ 0x434d4982, 0xffffffff, "CMI9761B", patch_cm9761, NULL },
{ 0x434d4983, 0xffffffff, "CMI9761A+", patch_cm9761, NULL },
{ 0x43525900, 0xfffffff8, "CS4297", NULL, NULL },
{ 0x43525910, 0xfffffff8, "CS4297A", patch_cirrus_spdif, NULL },
{ 0x43525920, 0xfffffff8, "CS4298", patch_cirrus_spdif, NULL },
{ 0x43525928, 0xfffffff8, "CS4294", NULL, NULL },
{ 0x43525930, 0xfffffff8, "CS4299", patch_cirrus_cs4299, NULL },
{ 0x43525948, 0xfffffff8, "CS4201", NULL, NULL },
{ 0x43525958, 0xfffffff8, "CS4205", patch_cirrus_spdif, NULL },
Annotation
- Immediate include surface: `linux/delay.h`, `linux/init.h`, `linux/slab.h`, `linux/pci.h`, `linux/module.h`, `linux/mutex.h`, `sound/core.h`, `sound/pcm.h`.
- Detected declarations: `struct ac97_codec_id`, `struct ac97_power_reg`, `struct quirk_table`, `function snd_ac97_valid_reg`, `function snd_ac97_write`, `function snd_ac97_read`, `function snd_ac97_read_cache`, `function snd_ac97_write_cache`, `function snd_ac97_update`, `function snd_ac97_update_bits`.
- Atlas domain: Driver Families / sound/pci.
- Implementation status: integration 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.