]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - sound/pci/hda/patch_realtek.c
ALSA: hda - Don't register beep input device when no beep is available
[net-next-2.6.git] / sound / pci / hda / patch_realtek.c
index 2bf678917e871c87986e2ca3d6a491ccfe39fe18..d7fd846e6c49361b7ecd89e6474e82e1a8e29d87 100644 (file)
@@ -1268,8 +1268,10 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec)
        struct alc_spec *spec = codec->spec;
 
        ass = codec->subsystem_id & 0xffff;
-       if (ass != codec->bus->pci->subsystem_device && (ass & 1))
+       if (ass != codec->bus->pci->subsystem_device && (ass & 1)) {
+               spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
                goto do_sku;
+       }
 
        nid = 0x1d;
        if (codec->vendor_id == 0x10ec0260)
@@ -9486,6 +9488,7 @@ static struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
        SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24),
        SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC885_IMAC91),
        SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5),
+       SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC885_MB5),
        /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2,
         * so apparently no perfect solution yet
         */
@@ -10563,10 +10566,12 @@ static int patch_alc882(struct hda_codec *codec)
                }
        }
 
-       err = snd_hda_attach_beep_device(codec, 0x1);
-       if (err < 0) {
-               alc_free(codec);
-               return err;
+       if (spec->cdefine.enable_pcbeep) {
+               err = snd_hda_attach_beep_device(codec, 0x1);
+               if (err < 0) {
+                       alc_free(codec);
+                       return err;
+               }
        }
 
        if (board_config != ALC882_AUTO)
@@ -12432,7 +12437,7 @@ static int patch_alc262(struct hda_codec *codec)
                }
        }
 
-       if (!spec->no_analog) {
+       if (!spec->no_analog && spec->cdefine.enable_pcbeep) {
                err = snd_hda_attach_beep_device(codec, 0x1);
                if (err < 0) {
                        alc_free(codec);
@@ -14455,10 +14460,12 @@ static int patch_alc269(struct hda_codec *codec)
                }
        }
 
-       err = snd_hda_attach_beep_device(codec, 0x1);
-       if (err < 0) {
-               alc_free(codec);
-               return err;
+       if (spec->cdefine.enable_pcbeep) {
+               err = snd_hda_attach_beep_device(codec, 0x1);
+               if (err < 0) {
+                       alc_free(codec);
+                       return err;
+               }
        }
 
        if (board_config != ALC269_AUTO)
@@ -18688,10 +18695,12 @@ static int patch_alc662(struct hda_codec *codec)
                }
        }
 
-       err = snd_hda_attach_beep_device(codec, 0x1);
-       if (err < 0) {
-               alc_free(codec);
-               return err;
+       if (spec->cdefine.enable_pcbeep) {
+               err = snd_hda_attach_beep_device(codec, 0x1);
+               if (err < 0) {
+                       alc_free(codec);
+                       return err;
+               }
        }
 
        if (board_config != ALC662_AUTO)