ALSA: hda - Fix Oops due to STAC/IDT auto-mic changes
[pandora-kernel.git] / sound / pci / hda / patch_sigmatel.c
index b3c53f7..2760730 100644 (file)
@@ -1906,6 +1906,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
                      "HP mini 1000", STAC_HP_M4),
        SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361b,
                      "HP HDX", STAC_HP_HDX),  /* HDX16 */
+       SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x7010,
+                     "HP", STAC_HP_DV5),
        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
                                "unknown Dell", STAC_DELL_M4_1),
        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0234,
@@ -3669,7 +3671,7 @@ static int set_mic_route(struct hda_codec *codec,
                if (i < 0)
                        return -1;
                mic->mux_idx = i;
-       }  else {
+       }  else if (spec->dmux_nids) {
                /* digital pin */
                mic->mux_idx = 0;
                i = get_connection_index(codec, spec->dmux_nids[0], pin);
@@ -4350,8 +4352,8 @@ static int stac92xx_init(struct hda_codec *codec)
                }
                if (cfg->line_out_type == AUTO_PIN_LINE_OUT) {
                        /* enable pin-detect for line-outs as well */
-                       for (i = 0; i < cfg->hp_outs; i++) {
-                               hda_nid_t nid = cfg->hp_pins[i];
+                       for (i = 0; i < cfg->line_outs; i++) {
+                               hda_nid_t nid = cfg->line_out_pins[i];
                                enable_pin_detect(codec, nid, STAC_LO_EVENT);
                        }
                }
@@ -4371,7 +4373,8 @@ static int stac92xx_init(struct hda_codec *codec)
        }
        if (spec->auto_mic) {
                /* initialize connection to analog input */
-               snd_hda_codec_write_cache(codec, spec->dmux_nids[0], 0,
+               if (spec->dmux_nids)
+                       snd_hda_codec_write_cache(codec, spec->dmux_nids[0], 0,
                                          AC_VERB_SET_CONNECT_SEL, 0);
                if (enable_pin_detect(codec, spec->ext_mic.pin, STAC_MIC_EVENT))
                        stac_issue_unsol_event(codec, spec->ext_mic.pin);
@@ -4782,10 +4785,8 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
 
        switch (event->type) {
        case STAC_HP_EVENT:
-               stac92xx_hp_detect(codec);
-               break;
        case STAC_LO_EVENT:
-               stac92xx_line_out_detect(codec, 0);
+               stac92xx_hp_detect(codec);
                break;
        case STAC_MIC_EVENT:
                stac92xx_mic_detect(codec);