Skip to contentSkip to conversation

ALSA: hda/realtek - Check beep whitelist before assigning in all codecs

PATCH New Takashi Iwai 1 participant 2 messages Aug 22, 2019 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ALSA: hda/realtek - Check beep whitelist before assigning in all codecs

Some Realtek codec parsers didn't check the availability of PC beep. Add has_cdefine_beep() check appropriately.

---
 sound/pci/hda/patch_realtek.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
sound/pci/hda/patch_realtek.c +6 -3
index b6ae452a1d8f..19831521bd95 100644
@@ -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;
 
@@ -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;
@@ -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;
 
Signature · 1 line
2.16.4
#1 lore raw

PATCH 2/2 ALSA: hda/realtek - Blacklist PC beep for Lenovo ThinkCentre M73/93

Lenovo ThinkCentre M73 and M93 don't seem to have a proper beep although the driver tries to probe and set up blindly. Blacklist these machines for suppressing the beep creation.

---
 sound/pci/hda/patch_realtek.c | 3 +++
 1 file changed, 3 insertions(+)
sound/pci/hda/patch_realtek.c +3 -0
index 19831521bd95..0585484a469a 100644
@@ -1065,6 +1065,9 @@ static const struct snd_pci_quirk beep_white_list[] = {
 	SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
 	SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
 	SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
+	/* blacklist -- no beep available */
+	SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
+	SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
 	{}
 };
 
Signature · 1 line
2.16.4