ALSA: hda - No analog mix input source as default for IDT92HD71bxx
[pandora-kernel.git] / sound / pci / hda / patch_sigmatel.c
index f39dc98..883e2aa 100644 (file)
@@ -997,19 +997,6 @@ static struct hda_verb stac92hd71bxx_core_init[] = {
        {}
 };
 
-#define HD_DISABLE_PORTF 1
-static struct hda_verb stac92hd71bxx_analog_core_init[] = {
-       /* start of config #1 */
-
-       /* connect port 0f to audio mixer */
-       { 0x0f, AC_VERB_SET_CONNECT_SEL, 0x2},
-       /* start of config #2 */
-
-       /* set master volume and direct control */
-       { 0x28, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
-       {}
-};
-
 static struct hda_verb stac92hd71bxx_unmute_core_init[] = {
        /* unmute right and left channels for nodes 0x0f, 0xa, 0x0d */
        { 0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
@@ -4372,6 +4359,9 @@ static int stac92xx_init(struct hda_codec *codec)
                        stac_toggle_power_map(codec, cfg->hp_pins[i], 1);
        }
        if (spec->auto_mic) {
+               /* initialize connection to analog input */
+               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);
        }
@@ -5491,8 +5481,6 @@ again:
                }
                break;
        case 0x111d7608: /* 5 Port with Analog Mixer */
-               memcpy(&spec->private_dimux, &stac92hd71bxx_dmux_amixer,
-                      sizeof(stac92hd71bxx_dmux_amixer));
                spec->private_dimux.num_items--;
                switch (spec->board_config) {
                case STAC_HP_M4:
@@ -5515,11 +5503,17 @@ again:
 
                /* no output amps */
                spec->num_pwrs = 0;
-               if (snd_hda_get_bool_hint(codec, "analog_mixer") == 1)
+               if (snd_hda_get_bool_hint(codec, "analog_mixer") == 1) {
                        spec->mixer = stac92hd71bxx_analog_mixer;
-
+                       memcpy(&spec->private_dimux, &stac92hd71bxx_dmux_amixer,
+                              sizeof(stac92hd71bxx_dmux_amixer));
+               } else {
+                       memcpy(&spec->private_dimux,
+                              &stac92hd71bxx_dmux_nomixer,
+                              sizeof(stac92hd71bxx_dmux_nomixer));
+               }
                /* disable VSW */
-               spec->init = &stac92hd71bxx_analog_core_init[HD_DISABLE_PORTF];
+               spec->init = stac92hd71bxx_core_init;
                unmute_init++;
                snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0);
                snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3);
@@ -5541,11 +5535,16 @@ again:
                spec->num_pwrs = 0;
                /* fallthru */
        default:
-               memcpy(&spec->private_dimux, &stac92hd71bxx_dmux_amixer,
-                      sizeof(stac92hd71bxx_dmux_amixer));
-               if (snd_hda_get_bool_hint(codec, "analog_mixer") == 1)
+               if (snd_hda_get_bool_hint(codec, "analog_mixer") == 1) {
                        spec->mixer = stac92hd71bxx_analog_mixer;
-               spec->init = stac92hd71bxx_analog_core_init;
+                       memcpy(&spec->private_dimux, &stac92hd71bxx_dmux_amixer,
+                              sizeof(stac92hd71bxx_dmux_amixer));
+               } else {
+                       memcpy(&spec->private_dimux,
+                              &stac92hd71bxx_dmux_nomixer,
+                              sizeof(stac92hd71bxx_dmux_nomixer));
+               }
+               spec->init = stac92hd71bxx_core_init;
                codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
                spec->num_dmics = stac92hd71bxx_connected_ports(codec,
                                        stac92hd71bxx_dmic_nids,