Merge branch 'topic/fix/hda' into topic/hda
authorTakashi Iwai <tiwai@suse.de>
Tue, 18 Nov 2008 09:57:07 +0000 (10:57 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 18 Nov 2008 09:57:07 +0000 (10:57 +0100)
1  2 
sound/pci/hda/patch_sigmatel.c

index 3029f5b1419ac9d0d7459442dab359a2dfe6537d,9563b5bbb272f41dda83997ceaf97bba7484af22..139efe37f3b3af1416cd29b5994a9243e116bbbb
@@@ -4653,14 -4472,23 +4657,21 @@@ again
                snd_printdd(KERN_INFO "hda_codec: Unknown model for"
                        " STAC92HD71BXX, using BIOS defaults\n");
                err = stac92xx_save_bios_config_regs(codec);
 -              if (err < 0) {
 -                      stac92xx_free(codec);
 -                      return err;
 -              }
 -              spec->pin_configs = spec->bios_pin_configs;
 -      } else {
 -              spec->pin_configs = stac92hd71bxx_brd_tbl[spec->board_config];
 -              stac92xx_set_config_regs(codec);
 +      } else
 +              err = stac_save_pin_cfgs(codec,
 +                              stac92hd71bxx_brd_tbl[spec->board_config]);
 +      if (err < 0) {
 +              stac92xx_free(codec);
 +              return err;
        }
  
+       if (spec->board_config > STAC_92HD71BXX_REF) {
+               /* GPIO0 = EAPD */
+               spec->gpio_mask = 0x01;
+               spec->gpio_dir = 0x01;
+               spec->gpio_data = 0x01;
+       }
        switch (codec->vendor_id) {
        case 0x111d76b6: /* 4 Port without Analog Mixer */
        case 0x111d76b7:
                codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
                break;
        case 0x111d7608: /* 5 Port with Analog Mixer */
-               switch (codec->subsystem_id) {
-               case 0x103c361a:
+               switch (spec->board_config) {
+               case STAC_HP_M4:
                        /* Enable VREF power saving on GPIO1 detect */
-                       snd_hda_codec_write(codec, codec->afg, 0,
+                       snd_hda_codec_write_cache(codec, codec->afg, 0,
                                AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x02);
                        snd_hda_codec_write_cache(codec, codec->afg, 0,
 -                                      AC_VERB_SET_UNSOLICITED_ENABLE,
 -                                      (AC_USRSP_EN | STAC_VREF_EVENT | 0x01));
 +                              AC_VERB_SET_UNSOLICITED_ENABLE,
 +                              (AC_USRSP_EN | STAC_VREF_EVENT | codec->afg));
 +                      err = stac92xx_add_event(spec, codec->afg, 0x02);
 +                      if (err < 0)
 +                              return err;
                        spec->gpio_mask |= 0x02;
                        break;
                }
@@@ -5069,18 -4891,15 +5073,18 @@@ static int patch_stac9205(struct hda_co
        switch (spec->board_config){
        case STAC_9205_DELL_M43:
                /* Enable SPDIF in/out */
 -              stac92xx_set_config_reg(codec, 0x1f, 0x01441030);
 -              stac92xx_set_config_reg(codec, 0x20, 0x1c410030);
 +              stac_change_pin_config(codec, 0x1f, 0x01441030);
 +              stac_change_pin_config(codec, 0x20, 0x1c410030);
  
                /* Enable unsol response for GPIO4/Dock HP connection */
-               snd_hda_codec_write(codec, codec->afg, 0,
+               snd_hda_codec_write_cache(codec, codec->afg, 0,
                        AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x10);
                snd_hda_codec_write_cache(codec, codec->afg, 0,
 -                                        AC_VERB_SET_UNSOLICITED_ENABLE,
 -                                        (AC_USRSP_EN | STAC_HP_EVENT));
 +                      AC_VERB_SET_UNSOLICITED_ENABLE,
 +                      (AC_USRSP_EN | STAC_VREF_EVENT | codec->afg));
 +              err = stac92xx_add_event(spec, codec->afg, 0x01);
 +              if (err < 0)
 +                      return err;
  
                spec->gpio_dir = 0x0b;
                spec->eapd_mask = 0x01;