]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ALSA: hda - Check "beep" hint
authorTakashi Iwai <tiwai@suse.de>
Mon, 29 Jun 2009 06:34:06 +0000 (08:34 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 29 Jun 2009 06:37:00 +0000 (08:37 +0200)
Check the hint "beep" in snd_hda_attach_beep_device() to avoid the beep
device creation if user doesn't want.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_beep.c

index 29272f2e95a07945cf805e6c75867f0f1e2cb762..08fe6592ad44cfa138d59ba9fb21c7123d86074f 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/workqueue.h>
 #include <sound/core.h>
 #include "hda_beep.h"
+#include "hda_local.h"
 
 enum {
        DIGBEEP_HZ_STEP = 46875,        /* 46.875 Hz */
@@ -115,6 +116,9 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
        struct hda_beep *beep;
        int err;
 
+       if (!snd_hda_get_bool_hint(codec, "beep"))
+               return 0; /* disabled explicitly */
+
        beep = kzalloc(sizeof(*beep), GFP_KERNEL);
        if (beep == NULL)
                return -ENOMEM;