sound/hda/codecs/realtek/alc269.c
Source file repositories/reference/linux-study-clean/sound/hda/codecs/realtek/alc269.c
File Facts
- System
- Linux kernel
- Corpus path
sound/hda/codecs/realtek/alc269.c- Extension
.c- Size
- 332950 bytes
- Lines
- 8913
- Domain
- Driver Families
- Bucket
- sound/hda
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/module.hrealtek.h../helpers/thinkpad.c../helpers/ideapad_hotkey_led.c../helpers/hp_x360.c../helpers/ideapad_s740.c
Detected Declarations
struct hda_alc298_mbxinitstruct alc298_samsung_amp_descstruct alc298_samsung_v2_amp_descstruct alc298_lg_gram_style_seqstruct alc298_lg_gram_style_amp_descfunction alc269_parse_auto_configfunction alc_headset_btn_callbackfunction alc_disable_headset_jack_keyfunction alc_enable_headset_jack_keyfunction alc_fixup_headset_jackfunction alc269vb_toggle_power_outputfunction alc269_shutupfunction alc282_restore_default_valuefunction alc282_initfunction alc282_shutupfunction alc283_restore_default_valuefunction alc283_initfunction alc283_shutupfunction alc256_initfunction alc256_shutupfunction alc285_hp_initfunction alc225_initfunction alc225_shutupfunction alc222_initfunction alc222_shutupfunction alc_default_initfunction alc_default_shutupfunction alc294_hp_initfunction alc294_initfunction alc5505_coef_setfunction alc5505_coef_getfunction alc5505_dsp_haltfunction alc5505_dsp_back_from_haltfunction alc5505_dsp_initfunction alc269_suspendfunction alc269_resumefunction alc233_starfighter_update_ampfunction alc233_starfighter_pcm_hookfunction alc233_fixup_starlabs_starfighterfunction alc269_fixup_pincfg_no_hp_to_lineoutfunction alc269_fixup_pincfg_U7x7_headset_micfunction alc269_fixup_hweqfunction alc271_fixup_dmicfunction alc269vb_fixup_aspire_e1_coeffunction alc269_fixup_pcm_44kfunction alc269_fixup_stereo_dmicfunction alc269_quanta_automutefunction alc269_fixup_quanta_mute
Annotated Snippet
struct hda_alc298_mbxinit {
unsigned char value_0x23;
unsigned char value_0x25;
};
static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
const struct hda_alc298_mbxinit *initval,
bool first)
{
snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
alc_write_coef_idx(codec, 0x26, 0xb000);
if (first)
snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
alc_write_coef_idx(codec, 0x26, 0xf000);
alc_write_coef_idx(codec, 0x23, initval->value_0x23);
if (initval->value_0x23 != 0x1e)
alc_write_coef_idx(codec, 0x25, initval->value_0x25);
snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
}
static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
const struct hda_fixup *fix,
int action)
{
/* Initialization magic */
static const struct hda_alc298_mbxinit dac_init[] = {
{0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
{0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
{0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
{0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
{0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
{0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
{0x2f, 0x00},
{0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
{0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
{0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
{}
};
const struct hda_alc298_mbxinit *seq;
if (action != HDA_FIXUP_ACT_INIT)
return;
/* Start */
snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
alc_write_coef_idx(codec, 0x26, 0xf000);
alc_write_coef_idx(codec, 0x22, 0x31);
alc_write_coef_idx(codec, 0x23, 0x0b);
alc_write_coef_idx(codec, 0x25, 0x00);
snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
for (seq = dac_init; seq->value_0x23; seq++)
alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
}
static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
struct alc_spec *spec = codec->spec;
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
}
}
static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
bool polarity, bool on)
{
unsigned int pinval;
if (!pin)
return;
if (polarity)
on = !on;
pinval = snd_hda_codec_get_pin_target(codec, pin);
pinval &= ~AC_PINCTL_VREFEN;
pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
/* temporarily power up/down for setting VREF */
CLASS(snd_hda_power_pm, pm)(codec);
snd_hda_set_pin_ctl_cache(codec, pin, pinval);
}
Annotation
- Immediate include surface: `linux/init.h`, `linux/module.h`, `realtek.h`, `../helpers/thinkpad.c`, `../helpers/ideapad_hotkey_led.c`, `../helpers/hp_x360.c`, `../helpers/ideapad_s740.c`.
- Detected declarations: `struct hda_alc298_mbxinit`, `struct alc298_samsung_amp_desc`, `struct alc298_samsung_v2_amp_desc`, `struct alc298_lg_gram_style_seq`, `struct alc298_lg_gram_style_amp_desc`, `function alc269_parse_auto_config`, `function alc_headset_btn_callback`, `function alc_disable_headset_jack_key`, `function alc_enable_headset_jack_key`, `function alc_fixup_headset_jack`.
- Atlas domain: Driver Families / sound/hda.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.