Loading sound/pci/hda/patch_realtek.c +42 −20 Original line number Diff line number Diff line Loading @@ -1309,11 +1309,11 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec) unsigned nid = 0; struct alc_spec *spec = codec->spec; ass = codec->subsystem_id & 0xffff; if (ass != codec->bus->pci->subsystem_device && (ass & 1)) { spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ ass = codec->subsystem_id & 0xffff; if (ass != codec->bus->pci->subsystem_device && (ass & 1)) goto do_sku; } nid = 0x1d; if (codec->vendor_id == 0x10ec0260) Loading Loading @@ -5280,8 +5280,24 @@ static void fillup_priv_adc_nids(struct hda_codec *codec, hda_nid_t *nids, #ifdef CONFIG_SND_HDA_INPUT_BEEP #define set_beep_amp(spec, nid, idx, dir) \ ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) static struct snd_pci_quirk beep_white_list[] = { SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), {} }; static inline int has_cdefine_beep(struct hda_codec *codec) { struct alc_spec *spec = codec->spec; const struct snd_pci_quirk *q; q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list); if (q) return q->value; return spec->cdefine.enable_pcbeep; } #else #define set_beep_amp(spec, nid, idx, dir) /* NOP */ #define has_cdefine_beep(codec) 0 #endif /* Loading Loading @@ -10666,11 +10682,13 @@ static int patch_alc882(struct hda_codec *codec) } } if (has_cdefine_beep(codec)) { err = snd_hda_attach_beep_device(codec, 0x1); if (err < 0) { alc_free(codec); return err; } } if (board_config != ALC882_AUTO) setup_preset(codec, &alc882_presets[board_config]); Loading Loading @@ -10719,7 +10737,7 @@ static int patch_alc882(struct hda_codec *codec) set_capture_mixer(codec); if (spec->cdefine.enable_pcbeep) if (has_cdefine_beep(codec)) set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); if (board_config == ALC882_AUTO) Loading Loading @@ -12535,7 +12553,7 @@ static int patch_alc262(struct hda_codec *codec) } } if (!spec->no_analog) { if (!spec->no_analog && has_cdefine_beep(codec)) { err = snd_hda_attach_beep_device(codec, 0x1); if (err < 0) { alc_free(codec); Loading Loading @@ -12586,7 +12604,7 @@ static int patch_alc262(struct hda_codec *codec) } if (!spec->cap_mixer && !spec->no_analog) set_capture_mixer(codec); if (!spec->no_analog && spec->cdefine.enable_pcbeep) if (!spec->no_analog && has_cdefine_beep(codec)) set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); spec->vmaster_nid = 0x0c; Loading Loading @@ -14591,11 +14609,13 @@ static int patch_alc269(struct hda_codec *codec) } } if (has_cdefine_beep(codec)) { err = snd_hda_attach_beep_device(codec, 0x1); if (err < 0) { alc_free(codec); return err; } } if (board_config != ALC269_AUTO) setup_preset(codec, &alc269_presets[board_config]); Loading Loading @@ -14631,7 +14651,7 @@ static int patch_alc269(struct hda_codec *codec) if (!spec->cap_mixer) set_capture_mixer(codec); if (spec->cdefine.enable_pcbeep) if (has_cdefine_beep(codec)) set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); if (board_config == ALC269_AUTO) Loading Loading @@ -18828,11 +18848,13 @@ static int patch_alc662(struct hda_codec *codec) } } if (has_cdefine_beep(codec)) { err = snd_hda_attach_beep_device(codec, 0x1); if (err < 0) { alc_free(codec); return err; } } if (board_config != ALC662_AUTO) setup_preset(codec, &alc662_presets[board_config]); Loading @@ -18853,7 +18875,7 @@ static int patch_alc662(struct hda_codec *codec) if (!spec->cap_mixer) set_capture_mixer(codec); if (spec->cdefine.enable_pcbeep) { if (has_cdefine_beep(codec)) { switch (codec->vendor_id) { case 0x10ec0662: set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); Loading
sound/pci/hda/patch_realtek.c +42 −20 Original line number Diff line number Diff line Loading @@ -1309,11 +1309,11 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec) unsigned nid = 0; struct alc_spec *spec = codec->spec; ass = codec->subsystem_id & 0xffff; if (ass != codec->bus->pci->subsystem_device && (ass & 1)) { spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ ass = codec->subsystem_id & 0xffff; if (ass != codec->bus->pci->subsystem_device && (ass & 1)) goto do_sku; } nid = 0x1d; if (codec->vendor_id == 0x10ec0260) Loading Loading @@ -5280,8 +5280,24 @@ static void fillup_priv_adc_nids(struct hda_codec *codec, hda_nid_t *nids, #ifdef CONFIG_SND_HDA_INPUT_BEEP #define set_beep_amp(spec, nid, idx, dir) \ ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) static struct snd_pci_quirk beep_white_list[] = { SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), {} }; static inline int has_cdefine_beep(struct hda_codec *codec) { struct alc_spec *spec = codec->spec; const struct snd_pci_quirk *q; q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list); if (q) return q->value; return spec->cdefine.enable_pcbeep; } #else #define set_beep_amp(spec, nid, idx, dir) /* NOP */ #define has_cdefine_beep(codec) 0 #endif /* Loading Loading @@ -10666,11 +10682,13 @@ static int patch_alc882(struct hda_codec *codec) } } if (has_cdefine_beep(codec)) { err = snd_hda_attach_beep_device(codec, 0x1); if (err < 0) { alc_free(codec); return err; } } if (board_config != ALC882_AUTO) setup_preset(codec, &alc882_presets[board_config]); Loading Loading @@ -10719,7 +10737,7 @@ static int patch_alc882(struct hda_codec *codec) set_capture_mixer(codec); if (spec->cdefine.enable_pcbeep) if (has_cdefine_beep(codec)) set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); if (board_config == ALC882_AUTO) Loading Loading @@ -12535,7 +12553,7 @@ static int patch_alc262(struct hda_codec *codec) } } if (!spec->no_analog) { if (!spec->no_analog && has_cdefine_beep(codec)) { err = snd_hda_attach_beep_device(codec, 0x1); if (err < 0) { alc_free(codec); Loading Loading @@ -12586,7 +12604,7 @@ static int patch_alc262(struct hda_codec *codec) } if (!spec->cap_mixer && !spec->no_analog) set_capture_mixer(codec); if (!spec->no_analog && spec->cdefine.enable_pcbeep) if (!spec->no_analog && has_cdefine_beep(codec)) set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); spec->vmaster_nid = 0x0c; Loading Loading @@ -14591,11 +14609,13 @@ static int patch_alc269(struct hda_codec *codec) } } if (has_cdefine_beep(codec)) { err = snd_hda_attach_beep_device(codec, 0x1); if (err < 0) { alc_free(codec); return err; } } if (board_config != ALC269_AUTO) setup_preset(codec, &alc269_presets[board_config]); Loading Loading @@ -14631,7 +14651,7 @@ static int patch_alc269(struct hda_codec *codec) if (!spec->cap_mixer) set_capture_mixer(codec); if (spec->cdefine.enable_pcbeep) if (has_cdefine_beep(codec)) set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); if (board_config == ALC269_AUTO) Loading Loading @@ -18828,11 +18848,13 @@ static int patch_alc662(struct hda_codec *codec) } } if (has_cdefine_beep(codec)) { err = snd_hda_attach_beep_device(codec, 0x1); if (err < 0) { alc_free(codec); return err; } } if (board_config != ALC662_AUTO) setup_preset(codec, &alc662_presets[board_config]); Loading @@ -18853,7 +18875,7 @@ static int patch_alc662(struct hda_codec *codec) if (!spec->cap_mixer) set_capture_mixer(codec); if (spec->cdefine.enable_pcbeep) { if (has_cdefine_beep(codec)) { switch (codec->vendor_id) { case 0x10ec0662: set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);