sound/hda/codecs/realtek/realtek.c
Source file repositories/reference/linux-study-clean/sound/hda/codecs/realtek/realtek.c
File Facts
- System
- Linux kernel
- Corpus path
sound/hda/codecs/realtek/realtek.c- Extension
.c- Size
- 62370 bytes
- Lines
- 2258
- Domain
- Driver Families
- Bucket
- sound/hda
- 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.
- 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/init.hlinux/module.hrealtek.h
Detected Declarations
struct alc_codec_rename_tablestruct alc_codec_rename_pci_tablefunction __alc_read_coefex_idxfunction alc_read_coefex_idxfunction __alc_write_coefex_idxfunction alc_write_coefex_idxfunction __alc_update_coefex_idxfunction alc_update_coefex_idxfunction alc_get_coef0function alc_process_coef_fwfunction alc_setup_gpiofunction alc_update_gpio_datafunction alc_write_gpiofunction alc_fixup_gpiofunction alc_fixup_gpio1function alc_fixup_gpio2function alc_fixup_gpio3function alc_fixup_gpio4function alc_fixup_micmute_ledfunction alc_fix_pllfunction alc_fix_pll_initfunction alc_update_knob_masterfunction alc_fill_eapd_coeffunction set_eapdfunction alc_auto_setup_eapdfunction alc_find_ext_mic_pinfunction alc_headset_mic_no_shutupfunction snd_array_for_eachfunction alc_shutup_pinsfunction alc_eapd_shutupfunction alc888_coef_initfunction alc_auto_init_ampfunction alc_get_hp_pinfunction alc_fixup_sku_ignorefunction alc_fixup_no_depop_delayfunction alc_auto_parse_customize_definefunction find_idx_in_nid_listfunction found_in_nid_listfunction alc_subsystem_idfunction alc_ssid_checkfunction alc_fixup_inv_dmicfunction alc_build_controlsfunction alc_initfunction alc_shutupfunction alc_power_eapdfunction alc_suspendfunction alc_resumefunction alc_codec_rename_from_preset
Annotated Snippet
struct alc_codec_rename_table {
unsigned int vendor_id;
unsigned short coef_mask;
unsigned short coef_bits;
const char *name;
};
struct alc_codec_rename_pci_table {
unsigned int codec_vendor_id;
unsigned short pci_subvendor;
unsigned short pci_subdevice;
const char *name;
};
static const struct alc_codec_rename_table rename_tbl[] = {
{ 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
{ 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
{ 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
{ 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
{ 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
{ 0x10ec0269, 0xffff, 0xa023, "ALC259" },
{ 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
{ 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
{ 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
{ 0x10ec0662, 0xffff, 0x4020, "ALC656" },
{ 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
{ 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
{ 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
{ 0x10ec0899, 0x2000, 0x2000, "ALC899" },
{ 0x10ec0892, 0xffff, 0x8020, "ALC661" },
{ 0x10ec0892, 0xffff, 0x8011, "ALC661" },
{ 0x10ec0892, 0xffff, 0x4011, "ALC656" },
{ } /* terminator */
};
static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
{ 0x10ec0280, 0x1028, 0, "ALC3220" },
{ 0x10ec0282, 0x1028, 0, "ALC3221" },
{ 0x10ec0283, 0x1028, 0, "ALC3223" },
{ 0x10ec0288, 0x1028, 0, "ALC3263" },
{ 0x10ec0292, 0x1028, 0, "ALC3226" },
{ 0x10ec0293, 0x1028, 0, "ALC3235" },
{ 0x10ec0255, 0x1028, 0, "ALC3234" },
{ 0x10ec0668, 0x1028, 0, "ALC3661" },
{ 0x10ec0275, 0x1028, 0, "ALC3260" },
{ 0x10ec0899, 0x1028, 0, "ALC3861" },
{ 0x10ec0298, 0x1028, 0, "ALC3266" },
{ 0x10ec0236, 0x1028, 0, "ALC3204" },
{ 0x10ec0256, 0x1028, 0, "ALC3246" },
{ 0x10ec0225, 0x1028, 0, "ALC3253" },
{ 0x10ec0295, 0x1028, 0, "ALC3254" },
{ 0x10ec0299, 0x1028, 0, "ALC3271" },
{ 0x10ec0670, 0x1025, 0, "ALC669X" },
{ 0x10ec0676, 0x1025, 0, "ALC679X" },
{ 0x10ec0282, 0x1043, 0, "ALC3229" },
{ 0x10ec0233, 0x1043, 0, "ALC3236" },
{ 0x10ec0280, 0x103c, 0, "ALC3228" },
{ 0x10ec0282, 0x103c, 0, "ALC3227" },
{ 0x10ec0286, 0x103c, 0, "ALC3242" },
{ 0x10ec0290, 0x103c, 0, "ALC3241" },
{ 0x10ec0668, 0x103c, 0, "ALC3662" },
{ 0x10ec0283, 0x17aa, 0, "ALC3239" },
{ 0x10ec0292, 0x17aa, 0, "ALC3232" },
{ 0x10ec0257, 0x12f0, 0, "ALC3328" },
{ } /* terminator */
};
static int alc_codec_rename_from_preset(struct hda_codec *codec)
{
const struct alc_codec_rename_table *p;
const struct alc_codec_rename_pci_table *q;
for (p = rename_tbl; p->vendor_id; p++) {
if (p->vendor_id != codec->core.vendor_id)
continue;
if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
return alc_codec_rename(codec, p->name);
}
if (!codec->bus->pci)
return 0;
for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
if (q->codec_vendor_id != codec->core.vendor_id)
continue;
if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
continue;
if (!q->pci_subdevice ||
q->pci_subdevice == codec->bus->pci->subsystem_device)
return alc_codec_rename(codec, q->name);
}
Annotation
- Immediate include surface: `linux/init.h`, `linux/module.h`, `realtek.h`.
- Detected declarations: `struct alc_codec_rename_table`, `struct alc_codec_rename_pci_table`, `function __alc_read_coefex_idx`, `function alc_read_coefex_idx`, `function __alc_write_coefex_idx`, `function alc_write_coefex_idx`, `function __alc_update_coefex_idx`, `function alc_update_coefex_idx`, `function alc_get_coef0`, `function alc_process_coef_fw`.
- Atlas domain: Driver Families / sound/hda.
- Implementation status: integration 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.