Skip to content

Commit

Permalink
ALSA: hda/realtek - Check beep whitelist before assigning in all codecs
Browse files Browse the repository at this point in the history
Some Realtek codec parsers didn't check the availability of PC beep.
Add has_cdefine_beep() check appropriately.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Aug 22, 2019
1 parent 7c0a693 commit 2722b53
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -2848,7 +2848,8 @@ static int patch_alc268(struct hda_codec *codec)
return err;

spec = codec->spec;
spec->gen.beep_nid = 0x01;
if (has_cdefine_beep(codec))
spec->gen.beep_nid = 0x01;

spec->shutup = alc_eapd_shutup;

Expand Down Expand Up @@ -8102,7 +8103,8 @@ static int patch_alc861(struct hda_codec *codec)
return err;

spec = codec->spec;
spec->gen.beep_nid = 0x23;
if (has_cdefine_beep(codec))
spec->gen.beep_nid = 0x23;

#ifdef CONFIG_PM
spec->power_hook = alc_power_eapd;
Expand Down Expand Up @@ -8203,7 +8205,8 @@ static int patch_alc861vd(struct hda_codec *codec)
return err;

spec = codec->spec;
spec->gen.beep_nid = 0x23;
if (has_cdefine_beep(codec))
spec->gen.beep_nid = 0x23;

spec->shutup = alc_eapd_shutup;

Expand Down

0 comments on commit 2722b53

Please sign in to comment.