]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/hda/patch_sigmatel.c
ALSA: hda: removed unneeded hp_nid references
[linux-2.6-omap-h63xx.git] / sound / pci / hda / patch_sigmatel.c
index fac6b3ca5fe25b680dc7ff49cc0eede7158a5b9d..4da53689618adf45d52f035026e75944d3b59bfe 100644 (file)
@@ -145,6 +145,9 @@ struct sigmatel_spec {
        unsigned int gpio_data;
        unsigned int gpio_mute;
 
+       /* stream */
+       unsigned int stream_delay;
+
        /* analog loopback */
        unsigned char aloopback_mask;
        unsigned char aloopback_shift;
@@ -170,6 +173,9 @@ struct sigmatel_spec {
        unsigned int num_dmics;
        hda_nid_t *dmux_nids;
        unsigned int num_dmuxes;
+       hda_nid_t *smux_nids;
+       unsigned int num_smuxes;
+
        hda_nid_t dig_in_nid;
        hda_nid_t mono_nid;
        hda_nid_t anabeep_nid;
@@ -190,6 +196,9 @@ struct sigmatel_spec {
        unsigned int cur_dmux[2];
        struct hda_input_mux *input_mux;
        unsigned int cur_mux[3];
+       struct hda_input_mux *sinput_mux;
+       unsigned int cur_smux[2];
+       unsigned int powerdown_adcs;
 
        /* i/o switches */
        unsigned int io_switch[2];
@@ -205,6 +214,7 @@ struct sigmatel_spec {
        struct snd_kcontrol_new *kctl_alloc;
        struct hda_input_mux private_dimux;
        struct hda_input_mux private_imux;
+       struct hda_input_mux private_smux;
        struct hda_input_mux private_mono_mux;
 };
 
@@ -247,6 +257,10 @@ static hda_nid_t stac92hd73xx_dmux_nids[2] = {
        0x20, 0x21,
 };
 
+static hda_nid_t stac92hd73xx_smux_nids[2] = {
+       0x22, 0x23,
+};
+
 #define STAC92HD83XXX_NUM_DMICS        2
 static hda_nid_t stac92hd83xxx_dmic_nids[STAC92HD83XXX_NUM_DMICS + 1] = {
        0x11, 0x12, 0
@@ -290,6 +304,10 @@ static hda_nid_t stac92hd71bxx_dmux_nids[1] = {
        0x1c,
 };
 
+static hda_nid_t stac92hd71bxx_smux_nids[2] = {
+       0x24, 0x25,
+};
+
 static hda_nid_t stac92hd71bxx_dac_nids[1] = {
        0x10, /*0x11, */
 };
@@ -336,6 +354,10 @@ static hda_nid_t stac927x_mux_nids[3] = {
         0x15, 0x16, 0x17
 };
 
+static hda_nid_t stac927x_smux_nids[1] = {
+       0x21,
+};
+
 static hda_nid_t stac927x_dac_nids[6] = {
        0x02, 0x03, 0x04, 0x05, 0x06, 0
 };
@@ -361,6 +383,10 @@ static hda_nid_t stac9205_dmux_nids[1] = {
        0x1d,
 };
 
+static hda_nid_t stac9205_smux_nids[1] = {
+       0x21,
+};
+
 #define STAC9205_NUM_DMICS     2
 static hda_nid_t stac9205_dmic_nids[STAC9205_NUM_DMICS + 1] = {
         0x17, 0x18, 0
@@ -384,7 +410,7 @@ static hda_nid_t stac922x_pin_nids[10] = {
 static hda_nid_t stac92hd73xx_pin_nids[13] = {
        0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
        0x0f, 0x10, 0x11, 0x12, 0x13,
-       0x14, 0x1e, 0x22
+       0x14, 0x22, 0x23
 };
 
 static hda_nid_t stac92hd83xxx_pin_nids[14] = {
@@ -439,6 +465,36 @@ static int stac92xx_dmux_enum_put(struct snd_kcontrol *kcontrol,
                        spec->dmux_nids[dmux_idx], &spec->cur_dmux[dmux_idx]);
 }
 
+static int stac92xx_smux_enum_info(struct snd_kcontrol *kcontrol,
+                                  struct snd_ctl_elem_info *uinfo)
+{
+       struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct sigmatel_spec *spec = codec->spec;
+       return snd_hda_input_mux_info(spec->sinput_mux, uinfo);
+}
+
+static int stac92xx_smux_enum_get(struct snd_kcontrol *kcontrol,
+                                 struct snd_ctl_elem_value *ucontrol)
+{
+       struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct sigmatel_spec *spec = codec->spec;
+       unsigned int smux_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
+
+       ucontrol->value.enumerated.item[0] = spec->cur_smux[smux_idx];
+       return 0;
+}
+
+static int stac92xx_smux_enum_put(struct snd_kcontrol *kcontrol,
+                                 struct snd_ctl_elem_value *ucontrol)
+{
+       struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct sigmatel_spec *spec = codec->spec;
+       unsigned int smux_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
+
+       return snd_hda_input_mux_put(codec, spec->sinput_mux, ucontrol,
+                       spec->smux_nids[smux_idx], &spec->cur_smux[smux_idx]);
+}
+
 static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
 {
        struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
@@ -795,7 +851,6 @@ static struct snd_kcontrol_new stac9200_mixer[] = {
        STAC_INPUT_SOURCE(1),
        HDA_CODEC_VOLUME("Capture Volume", 0x0a, 0, HDA_OUTPUT),
        HDA_CODEC_MUTE("Capture Switch", 0x0a, 0, HDA_OUTPUT),
-       HDA_CODEC_VOLUME("Capture Mux Volume", 0x0c, 0, HDA_OUTPUT),
        { } /* end */
 };
 
@@ -909,12 +964,9 @@ static struct snd_kcontrol_new stac92hd71bxx_analog_mixer[] = {
 
        HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x1c, 0x0, HDA_OUTPUT),
        HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x1c, 0x0, HDA_OUTPUT),
-       HDA_CODEC_VOLUME_IDX("Capture Mux Volume", 0x0, 0x1a, 0x0, HDA_OUTPUT),
 
        HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x1d, 0x0, HDA_OUTPUT),
        HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x1d, 0x0, HDA_OUTPUT),
-       HDA_CODEC_VOLUME_IDX("Capture Mux Volume", 0x1, 0x1b, 0x0, HDA_OUTPUT),
-
        /* analog pc-beep replaced with digital beep support */
        /*
        HDA_CODEC_VOLUME("PC Beep Volume", 0x17, 0x2, HDA_INPUT),
@@ -932,11 +984,9 @@ static struct snd_kcontrol_new stac92hd71bxx_mixer[] = {
 
        HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x1c, 0x0, HDA_OUTPUT),
        HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x1c, 0x0, HDA_OUTPUT),
-       HDA_CODEC_VOLUME_IDX("Capture Mux Volume", 0x0, 0x1a, 0x0, HDA_OUTPUT),
 
        HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x1d, 0x0, HDA_OUTPUT),
        HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x1d, 0x0, HDA_OUTPUT),
-       HDA_CODEC_VOLUME_IDX("Capture Mux Volume", 0x1, 0x1b, 0x0, HDA_OUTPUT),
        { } /* end */
 };
 
@@ -944,7 +994,6 @@ static struct snd_kcontrol_new stac925x_mixer[] = {
        STAC_INPUT_SOURCE(1),
        HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT),
        HDA_CODEC_MUTE("Capture Switch", 0x14, 0, HDA_OUTPUT),
-       HDA_CODEC_VOLUME("Capture Mux Volume", 0x0f, 0, HDA_OUTPUT),
        { } /* end */
 };
 
@@ -954,12 +1003,9 @@ static struct snd_kcontrol_new stac9205_mixer[] = {
 
        HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x1b, 0x0, HDA_INPUT),
        HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x1d, 0x0, HDA_OUTPUT),
-       HDA_CODEC_VOLUME_IDX("Mux Capture Volume", 0x0, 0x19, 0x0, HDA_OUTPUT),
 
        HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x1c, 0x0, HDA_INPUT),
        HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x1e, 0x0, HDA_OUTPUT),
-       HDA_CODEC_VOLUME_IDX("Mux Capture Volume", 0x1, 0x1A, 0x0, HDA_OUTPUT),
-
        { } /* end */
 };
 
@@ -968,11 +1014,9 @@ static struct snd_kcontrol_new stac922x_mixer[] = {
        STAC_INPUT_SOURCE(2),
        HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x17, 0x0, HDA_INPUT),
        HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x17, 0x0, HDA_INPUT),
-       HDA_CODEC_VOLUME_IDX("Mux Capture Volume", 0x0, 0x12, 0x0, HDA_OUTPUT),
 
        HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x18, 0x0, HDA_INPUT),
        HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x18, 0x0, HDA_INPUT),
-       HDA_CODEC_VOLUME_IDX("Mux Capture Volume", 0x1, 0x13, 0x0, HDA_OUTPUT),
        { } /* end */
 };
 
@@ -983,15 +1027,12 @@ static struct snd_kcontrol_new stac927x_mixer[] = {
 
        HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x18, 0x0, HDA_INPUT),
        HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x1b, 0x0, HDA_OUTPUT),
-       HDA_CODEC_VOLUME_IDX("Mux Capture Volume", 0x0, 0x15, 0x0, HDA_OUTPUT),
 
        HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x19, 0x0, HDA_INPUT),
        HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x1c, 0x0, HDA_OUTPUT),
-       HDA_CODEC_VOLUME_IDX("Mux Capture Volume", 0x1, 0x16, 0x0, HDA_OUTPUT),
 
        HDA_CODEC_VOLUME_IDX("Capture Volume", 0x2, 0x1A, 0x0, HDA_INPUT),
        HDA_CODEC_MUTE_IDX("Capture Switch", 0x2, 0x1d, 0x0, HDA_OUTPUT),
-       HDA_CODEC_VOLUME_IDX("Mux Capture Volume", 0x2, 0x17, 0x0, HDA_OUTPUT),
        { } /* end */
 };
 
@@ -1004,6 +1045,15 @@ static struct snd_kcontrol_new stac_dmux_mixer = {
        .put = stac92xx_dmux_enum_put,
 };
 
+static struct snd_kcontrol_new stac_smux_mixer = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "IEC958 Mux",
+       /* count set later */
+       .info = stac92xx_smux_enum_info,
+       .get = stac92xx_smux_enum_get,
+       .put = stac92xx_smux_enum_put,
+};
+
 static const char *slave_vols[] = {
        "Front Playback Volume",
        "Surround Playback Volume",
@@ -1055,6 +1105,13 @@ static int stac92xx_build_controls(struct hda_codec *codec)
                if (err < 0)
                        return err;
        }
+       if (spec->num_smuxes > 0) {
+               stac_smux_mixer.count = spec->num_smuxes;
+               err = snd_ctl_add(codec->bus->card,
+                                 snd_ctl_new1(&stac_smux_mixer, codec));
+               if (err < 0)
+                       return err;
+       }
 
        if (spec->multiout.dig_out_nid) {
                err = snd_hda_create_spdif_out_ctls(codec, spec->multiout.dig_out_nid);
@@ -2011,6 +2068,8 @@ static int stac92xx_playback_pcm_open(struct hda_pcm_stream *hinfo,
                                      struct snd_pcm_substream *substream)
 {
        struct sigmatel_spec *spec = codec->spec;
+       if (spec->stream_delay)
+               msleep(spec->stream_delay);
        return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream,
                                             hinfo);
 }
@@ -2074,9 +2133,14 @@ static int stac92xx_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
                                        struct snd_pcm_substream *substream)
 {
        struct sigmatel_spec *spec = codec->spec;
+       hda_nid_t nid = spec->adc_nids[substream->number];
 
-       snd_hda_codec_setup_stream(codec, spec->adc_nids[substream->number],
-                                   stream_tag, 0, format);
+       if (spec->powerdown_adcs) {
+               msleep(40);
+               snd_hda_codec_write_cache(codec, nid, 0,
+                       AC_VERB_SET_POWER_STATE, AC_PWRST_D0);
+       }
+       snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format);
        return 0;
 }
 
@@ -2085,8 +2149,12 @@ static int stac92xx_capture_pcm_cleanup(struct hda_pcm_stream *hinfo,
                                        struct snd_pcm_substream *substream)
 {
        struct sigmatel_spec *spec = codec->spec;
+       hda_nid_t nid = spec->adc_nids[substream->number];
 
-       snd_hda_codec_cleanup_stream(codec, spec->adc_nids[substream->number]);
+       snd_hda_codec_cleanup_stream(codec, nid);
+       if (spec->powerdown_adcs)
+               snd_hda_codec_write_cache(codec, nid, 0,
+                       AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
        return 0;
 }
 
@@ -2352,7 +2420,8 @@ static struct snd_kcontrol_new stac92xx_control_templates[] = {
 };
 
 /* add dynamic controls */
-static int stac92xx_add_control(struct sigmatel_spec *spec, int type, const char *name, unsigned long val)
+static int stac92xx_add_control_idx(struct sigmatel_spec *spec, int type,
+               int idx, const char *name, unsigned long val)
 {
        struct snd_kcontrol_new *knew;
 
@@ -2372,6 +2441,7 @@ static int stac92xx_add_control(struct sigmatel_spec *spec, int type, const char
 
        knew = &spec->kctl_alloc[spec->num_kctl_used];
        *knew = stac92xx_control_templates[type];
+       knew->index = idx;
        knew->name = kstrdup(name, GFP_KERNEL);
        if (! knew->name)
                return -ENOMEM;
@@ -2380,6 +2450,14 @@ static int stac92xx_add_control(struct sigmatel_spec *spec, int type, const char
        return 0;
 }
 
+
+/* add dynamic controls */
+static int stac92xx_add_control(struct sigmatel_spec *spec, int type,
+               const char *name, unsigned long val)
+{
+       return stac92xx_add_control_idx(spec, type, 0, name, val);
+}
+
 /* flag inputs as additional dynamic lineouts */
 static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cfg *cfg)
 {
@@ -2781,6 +2859,54 @@ static int stac92xx_auto_create_beep_ctls(struct hda_codec *codec,
        return 0;
 }
 
+static int stac92xx_auto_create_mux_input_ctls(struct hda_codec *codec)
+{
+       struct sigmatel_spec *spec = codec->spec;
+       int wcaps, nid, i, err = 0;
+
+       for (i = 0; i < spec->num_muxes; i++) {
+               nid = spec->mux_nids[i];
+               wcaps = get_wcaps(codec, nid);
+
+               if (wcaps & AC_WCAP_OUT_AMP) {
+                       err = stac92xx_add_control_idx(spec,
+                               STAC_CTL_WIDGET_VOL, i, "Mux Capture Volume",
+                               HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT));
+                       if (err < 0)
+                               return err;
+               }
+       }
+       return 0;
+};
+
+static const char *stac92xx_spdif_labels[3] = {
+       "Digital Playback", "Analog Mux 1", "Analog Mux 2"
+};
+
+static int stac92xx_auto_create_spdif_mux_ctls(struct hda_codec *codec)
+{
+       struct sigmatel_spec *spec = codec->spec;
+       struct hda_input_mux *spdif_mux = &spec->private_smux;
+       int i, num_cons;
+       hda_nid_t con_lst[ARRAY_SIZE(stac92xx_spdif_labels)];
+
+       num_cons = snd_hda_get_connections(codec,
+                               spec->smux_nids[0],
+                               con_lst,
+                               HDA_MAX_NUM_INPUTS);
+       if (!num_cons || num_cons > ARRAY_SIZE(stac92xx_spdif_labels))
+               return -EINVAL;
+
+       for (i = 0; i < num_cons; i++) {
+               spdif_mux->items[spdif_mux->num_items].label =
+                                       stac92xx_spdif_labels[i];
+               spdif_mux->items[spdif_mux->num_items].index = i;
+               spdif_mux->num_items++;
+       }
+
+       return 0;
+}
+
 /* labels for dmic mux inputs */
 static const char *stac92xx_dmic_labels[5] = {
        "Analog Inputs", "Digital Mic 1", "Digital Mic 2",
@@ -3079,6 +3205,16 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
                if ((err = stac92xx_auto_create_dmic_input_ctls(codec,
                                                &spec->autocfg)) < 0)
                        return err;
+       if (spec->num_muxes > 0) {
+               err = stac92xx_auto_create_mux_input_ctls(codec);
+               if (err < 0)
+                       return err;
+       }
+       if (spec->num_smuxes > 0) {
+               err = stac92xx_auto_create_spdif_mux_ctls(codec);
+               if (err < 0)
+                       return err;
+       }
 
        spec->multiout.max_channels = spec->multiout.num_dacs * 2;
        if (spec->multiout.max_channels > 2)
@@ -3095,6 +3231,7 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
        spec->input_mux = &spec->private_imux;
        if (!spec->dinput_mux)
                spec->dinput_mux = &spec->private_dimux;
+       spec->sinput_mux = &spec->private_smux;
        spec->mono_mux = &spec->private_mono_mux;
 
        return 1;
@@ -3276,6 +3413,12 @@ static int stac92xx_init(struct hda_codec *codec)
 
        snd_hda_sequence_write(codec, spec->init);
 
+       /* power down adcs initially */
+       if (spec->powerdown_adcs)
+               for (i = 0; i < spec->num_adcs; i++)
+                       snd_hda_codec_write_cache(codec,
+                               spec->adc_nids[i], 0,
+                               AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
        /* set up pins */
        if (spec->hp_detect) {
                /* Enable unsolicited responses on the HP widget */
@@ -3735,17 +3878,14 @@ again:
 
        switch (spec->multiout.num_dacs) {
        case 0x3: /* 6 Channel */
-               spec->multiout.hp_nid = 0x17;
                spec->mixer = stac92hd73xx_6ch_mixer;
                spec->init = stac92hd73xx_6ch_core_init;
                break;
        case 0x4: /* 8 Channel */
-               spec->multiout.hp_nid = 0x18;
                spec->mixer = stac92hd73xx_8ch_mixer;
                spec->init = stac92hd73xx_8ch_core_init;
                break;
        case 0x5: /* 10 Channel */
-               spec->multiout.hp_nid = 0x19;
                spec->mixer = stac92hd73xx_10ch_mixer;
                spec->init = stac92hd73xx_10ch_core_init;
        };
@@ -3759,10 +3899,12 @@ again:
        spec->adc_nids = stac92hd73xx_adc_nids;
        spec->dmic_nids = stac92hd73xx_dmic_nids;
        spec->dmux_nids = stac92hd73xx_dmux_nids;
+       spec->smux_nids = stac92hd73xx_smux_nids;
 
        spec->num_muxes = ARRAY_SIZE(stac92hd73xx_mux_nids);
        spec->num_adcs = ARRAY_SIZE(stac92hd73xx_adc_nids);
        spec->num_dmuxes = ARRAY_SIZE(stac92hd73xx_dmux_nids);
+       spec->num_smuxes = ARRAY_SIZE(stac92hd73xx_smux_nids);
        spec->dinput_mux = &stac92hd73xx_dmux;
        /* GPIO0 High = Enable EAPD */
        spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1;
@@ -3801,7 +3943,7 @@ again:
        spec->num_pwrs = ARRAY_SIZE(stac92hd73xx_pwr_nids);
        spec->pwr_nids = stac92hd73xx_pwr_nids;
 
-       err = stac92xx_parse_auto_config(codec, 0x22, 0x24);
+       err = stac92xx_parse_auto_config(codec, 0x25, 0x27);
 
        if (!err) {
                if (spec->board_config < 0) {
@@ -3910,6 +4052,47 @@ again:
        return 0;
 }
 
+#ifdef SND_HDA_NEEDS_RESUME
+static void stac92hd71xx_set_power_state(struct hda_codec *codec, int pwr)
+{
+       struct sigmatel_spec *spec = codec->spec;
+       int i;
+       snd_hda_codec_write_cache(codec, codec->afg, 0,
+               AC_VERB_SET_POWER_STATE, pwr);
+
+       msleep(1);
+       for (i = 0; i < spec->num_adcs; i++) {
+               snd_hda_codec_write_cache(codec,
+                       spec->adc_nids[i], 0,
+                       AC_VERB_SET_POWER_STATE, pwr);
+       }
+};
+
+static int stac92hd71xx_resume(struct hda_codec *codec)
+{
+       stac92hd71xx_set_power_state(codec, AC_PWRST_D0);
+       return stac92xx_resume(codec);
+}
+
+static int stac92hd71xx_suspend(struct hda_codec *codec, pm_message_t state)
+{
+       stac92hd71xx_set_power_state(codec, AC_PWRST_D3);
+       return 0;
+};
+
+#endif
+
+static struct hda_codec_ops stac92hd71bxx_patch_ops = {
+       .build_controls = stac92xx_build_controls,
+       .build_pcms = stac92xx_build_pcms,
+       .init = stac92xx_init,
+       .free = stac92xx_free,
+       .unsol_event = stac92xx_unsol_event,
+#ifdef SND_HDA_NEEDS_RESUME
+       .resume = stac92hd71xx_resume,
+       .suspend = stac92hd71xx_suspend,
+#endif
+};
 
 static int patch_stac92hd71bxx(struct hda_codec *codec)
 {
@@ -3921,6 +4104,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)
                return -ENOMEM;
 
        codec->spec = spec;
+       codec->patch_ops = stac92xx_patch_ops;
        spec->num_pins = ARRAY_SIZE(stac92hd71bxx_pin_nids);
        spec->num_pwrs = ARRAY_SIZE(stac92hd71bxx_pwr_nids);
        spec->pin_nids = stac92hd71bxx_pin_nids;
@@ -3952,6 +4136,14 @@ again:
                spec->init = stac92hd71bxx_core_init;
                break;
        case 0x111d7608: /* 5 Port with Analog Mixer */
+               if ((codec->revision_id & 0xf) == 0 ||
+                               (codec->revision_id & 0xf) == 1) {
+#ifdef SND_HDA_NEEDS_RESUME
+                       codec->patch_ops = stac92hd71bxx_patch_ops;
+#endif
+                       spec->stream_delay = 40; /* 40 milliseconds */
+               }
+
                /* no output amps */
                spec->num_pwrs = 0;
                spec->mixer = stac92hd71bxx_analog_mixer;
@@ -3961,6 +4153,13 @@ again:
                stac92xx_set_config_reg(codec, 0xf, 0x40f000f0);
                break;
        case 0x111d7603: /* 6 Port with Analog Mixer */
+               if ((codec->revision_id & 0xf) == 1) {
+#ifdef SND_HDA_NEEDS_RESUME
+                       codec->patch_ops = stac92hd71bxx_patch_ops;
+#endif
+                       spec->stream_delay = 40; /* 40 milliseconds */
+               }
+
                /* no output amps */
                spec->num_pwrs = 0;
                /* fallthru */
@@ -3977,16 +4176,19 @@ again:
        spec->gpio_dir = 0x01;
        spec->gpio_data = 0x01;
 
+       spec->powerdown_adcs = 1;
        spec->digbeep_nid = 0x26;
        spec->mux_nids = stac92hd71bxx_mux_nids;
        spec->adc_nids = stac92hd71bxx_adc_nids;
        spec->dmic_nids = stac92hd71bxx_dmic_nids;
        spec->dmux_nids = stac92hd71bxx_dmux_nids;
+       spec->smux_nids = stac92hd71bxx_smux_nids;
        spec->pwr_nids = stac92hd71bxx_pwr_nids;
 
        spec->num_muxes = ARRAY_SIZE(stac92hd71bxx_mux_nids);
        spec->num_adcs = ARRAY_SIZE(stac92hd71bxx_adc_nids);
        spec->num_dmics = STAC92HD71BXX_NUM_DMICS;
+       spec->num_smuxes = ARRAY_SIZE(stac92hd71bxx_smux_nids);
        spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids);
 
        spec->multiout.num_dacs = 1;
@@ -4009,8 +4211,6 @@ again:
                return err;
        }
 
-       codec->patch_ops = stac92xx_patch_ops;
-
        return 0;
 };
 
@@ -4157,6 +4357,8 @@ static int patch_stac927x(struct hda_codec *codec)
        spec->num_adcs = ARRAY_SIZE(stac927x_adc_nids);
        spec->mux_nids = stac927x_mux_nids;
        spec->num_muxes = ARRAY_SIZE(stac927x_mux_nids);
+       spec->smux_nids = stac927x_smux_nids;
+       spec->num_smuxes = ARRAY_SIZE(stac927x_smux_nids);
        spec->dac_list = stac927x_dac_nids;
        spec->multiout.dac_nids = spec->dac_nids;
 
@@ -4278,6 +4480,8 @@ static int patch_stac9205(struct hda_codec *codec)
        spec->num_adcs = ARRAY_SIZE(stac9205_adc_nids);
        spec->mux_nids = stac9205_mux_nids;
        spec->num_muxes = ARRAY_SIZE(stac9205_mux_nids);
+       spec->smux_nids = stac9205_smux_nids;
+       spec->num_smuxes = ARRAY_SIZE(stac9205_smux_nids);
        spec->dmic_nids = stac9205_dmic_nids;
        spec->num_dmics = STAC9205_NUM_DMICS;
        spec->dmux_nids = stac9205_dmux_nids;