mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Mario 'BitKoenig' Holbe" <Mario.Holbe@TU-Ilmenau.DE>
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org
Subject: Re: [alsa-devel] Regression 2.6.35-rc6: ALSA Intel HDA/Realtek: missing	Beep
Date: Thu, 29 Jul 2010 11:42:44 +0200	[thread overview]
Message-ID: <s5hlj8utyi3.wl%tiwai@suse.de> (raw)
In-Reply-To: <20100729091517.GA8902@darkside.kls.lan>

At Thu, 29 Jul 2010 11:15:17 +0200,
Mario 'BitKoenig' Holbe wrote:
> 
> On Thu, Jul 29, 2010 at 10:52:36AM +0200, Takashi Iwai wrote:
> > Usually the codec SSID isn't checked in other places, so passing a
> > bogus value should be OK.  Pass a value like 2:
> 
> Mh, 1 probably :)
> 
> $ cat /etc/modprobe.d/local-alsa.conf 
> options snd-hda-intel model=asus-p5q
> install snd-hda-intel /sbin/modprobe --ignore-install snd-hda-intel $CMDLINE_OPTS && { cd /sys/class/sound/hwC0D0; echo -n 1 > subsystem_id; echo -n 1 > reconfig; : ; }
> 
> Yep, Beep is back :)
> 
> Btw...
> 
> On Thu, Jul 29, 2010 at 10:26:22AM +0200, Takashi Iwai wrote:
> > So, the fix is likely to override SSID value, or create a special
> > quirk rule to enable PC-beep for known white-list, supposing BIOS
> > won't be fixed in any future...
> 
> Well, the Board is from 2007, the last BIOS is from Aug 2009. I don't
> think Asus will provide an update just for that :)

OK, then try the patch below (over my previous two patches).  It
enables PC-beep for your device forcibly.


Takashi

---
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 1744d4d..439d6e7 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -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
 
 /*
@@ -10666,7 +10682,7 @@ static int patch_alc882(struct hda_codec *codec)
 		}
 	}
 
-	if (spec->cdefine.enable_pcbeep) {
+	if (has_cdefine_beep(codec)) {
 		err = snd_hda_attach_beep_device(codec, 0x1);
 		if (err < 0) {
 			alc_free(codec);
@@ -10721,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)
@@ -12537,7 +12553,7 @@ static int patch_alc262(struct hda_codec *codec)
 		}
 	}
 
-	if (!spec->no_analog && spec->cdefine.enable_pcbeep) {
+	if (!spec->no_analog && has_cdefine_beep(codec)) {
 		err = snd_hda_attach_beep_device(codec, 0x1);
 		if (err < 0) {
 			alc_free(codec);
@@ -12588,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;
@@ -14593,7 +14609,7 @@ static int patch_alc269(struct hda_codec *codec)
 		}
 	}
 
-	if (spec->cdefine.enable_pcbeep) {
+	if (has_cdefine_beep(codec)) {
 		err = snd_hda_attach_beep_device(codec, 0x1);
 		if (err < 0) {
 			alc_free(codec);
@@ -14635,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)
@@ -18832,7 +18848,7 @@ static int patch_alc662(struct hda_codec *codec)
 		}
 	}
 
-	if (spec->cdefine.enable_pcbeep) {
+	if (has_cdefine_beep(codec)) {
 		err = snd_hda_attach_beep_device(codec, 0x1);
 		if (err < 0) {
 			alc_free(codec);
@@ -18859,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);

  reply	other threads:[~2010-07-29  9:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-28 14:49 Mario 'BitKoenig' Holbe
2010-07-28 15:35 ` [alsa-devel] " Takashi Iwai
2010-07-28 16:03   ` Takashi Iwai
2010-07-28 21:27     ` Mario 'BitKoenig' Holbe
2010-07-29  5:44       ` Takashi Iwai
2010-07-29  8:09         ` Mario 'BitKoenig' Holbe
2010-07-29  8:26           ` Takashi Iwai
2010-07-29  8:41             ` Mario 'BitKoenig' Holbe
2010-07-29  8:52               ` Takashi Iwai
2010-07-29  9:15                 ` Mario 'BitKoenig' Holbe
2010-07-29  9:42                   ` Takashi Iwai [this message]
2010-07-29 13:25                     ` Mario 'BitKoenig' Holbe
2010-07-29 13:33                       ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hlj8utyi3.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=Mario.Holbe@TU-Ilmenau.DE \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®