ALSA: hda - Improved MacBook 3,1 support
[pandora-kernel.git] / sound / pci / hda / patch_realtek.c
index 51954ba..b942019 100644 (file)
@@ -240,6 +240,7 @@ enum {
        ALC883_3ST_6ch_INTEL,
        ALC888_ASUS_M90V,
        ALC888_ASUS_EEE1601,
+       ALC889A_MB31,
        ALC1200_ASUS_P5Q,
        ALC883_AUTO,
        ALC883_MODEL_LAST,
@@ -277,13 +278,13 @@ struct alc_spec {
                                                 */
        unsigned int num_init_verbs;
 
-       char *stream_name_analog;       /* analog PCM stream */
+       char stream_name_analog[16];    /* analog PCM stream */
        struct hda_pcm_stream *stream_analog_playback;
        struct hda_pcm_stream *stream_analog_capture;
        struct hda_pcm_stream *stream_analog_alt_playback;
        struct hda_pcm_stream *stream_analog_alt_capture;
 
-       char *stream_name_digital;      /* digital PCM stream */
+       char stream_name_digital[16];   /* digital PCM stream */
        struct hda_pcm_stream *stream_digital_playback;
        struct hda_pcm_stream *stream_digital_capture;
 
@@ -3169,7 +3170,10 @@ static int alc_build_pcms(struct hda_codec *codec)
        if (spec->no_analog)
                goto skip_analog;
 
+       snprintf(spec->stream_name_analog, sizeof(spec->stream_name_analog),
+                "%s Analog", codec->chip_name);
        info->name = spec->stream_name_analog;
+       
        if (spec->stream_analog_playback) {
                if (snd_BUG_ON(!spec->multiout.dac_nids))
                        return -EINVAL;
@@ -3195,6 +3199,9 @@ static int alc_build_pcms(struct hda_codec *codec)
  skip_analog:
        /* SPDIF for stream index #1 */
        if (spec->multiout.dig_out_nid || spec->dig_in_nid) {
+               snprintf(spec->stream_name_digital,
+                        sizeof(spec->stream_name_digital),
+                        "%s Digital", codec->chip_name);
                codec->num_pcms = 2;
                codec->slave_dig_outs = spec->multiout.slave_dig_outs;
                info = spec->pcm_rec + 1;
@@ -4404,8 +4411,8 @@ static int patch_alc880(struct hda_codec *codec)
                                                  alc880_models,
                                                  alc880_cfg_tbl);
        if (board_config < 0) {
-               printk(KERN_INFO "hda_codec: Unknown model for ALC880, "
-                      "trying auto-probe from BIOS...\n");
+               printk(KERN_INFO "hda_codec: Unknown model for %s, "
+                      "trying auto-probe from BIOS...\n", codec->chip_name);
                board_config = ALC880_AUTO;
        }
 
@@ -4432,12 +4439,10 @@ static int patch_alc880(struct hda_codec *codec)
        if (board_config != ALC880_AUTO)
                setup_preset(spec, &alc880_presets[board_config]);
 
-       spec->stream_name_analog = "ALC880 Analog";
        spec->stream_analog_playback = &alc880_pcm_analog_playback;
        spec->stream_analog_capture = &alc880_pcm_analog_capture;
        spec->stream_analog_alt_capture = &alc880_pcm_analog_alt_capture;
 
-       spec->stream_name_digital = "ALC880 Digital";
        spec->stream_digital_playback = &alc880_pcm_digital_playback;
        spec->stream_digital_capture = &alc880_pcm_digital_capture;
 
@@ -6050,8 +6055,9 @@ static int patch_alc260(struct hda_codec *codec)
                                                  alc260_models,
                                                  alc260_cfg_tbl);
        if (board_config < 0) {
-               snd_printd(KERN_INFO "hda_codec: Unknown model for ALC260, "
-                          "trying auto-probe from BIOS...\n");
+               snd_printd(KERN_INFO "hda_codec: Unknown model for %s, "
+                          "trying auto-probe from BIOS...\n",
+                          codec->chip_name);
                board_config = ALC260_AUTO;
        }
 
@@ -6078,11 +6084,9 @@ static int patch_alc260(struct hda_codec *codec)
        if (board_config != ALC260_AUTO)
                setup_preset(spec, &alc260_presets[board_config]);
 
-       spec->stream_name_analog = "ALC260 Analog";
        spec->stream_analog_playback = &alc260_pcm_analog_playback;
        spec->stream_analog_capture = &alc260_pcm_analog_capture;
 
-       spec->stream_name_digital = "ALC260 Digital";
        spec->stream_digital_playback = &alc260_pcm_digital_playback;
        spec->stream_digital_capture = &alc260_pcm_digital_capture;
 
@@ -7288,11 +7292,15 @@ static int patch_alc882(struct hda_codec *codec)
                case 0x106b00a1: /* Macbook (might be wrong - PCI SSID?) */
                case 0x106b00a4: /* MacbookPro4,1 */
                case 0x106b2c00: /* Macbook Pro rev3 */
-               case 0x106b3600: /* Macbook 3.1 */
+               /* Macbook 3.1 (0x106b3600) is handled by patch_alc883() */
                case 0x106b3800: /* MacbookPro4,1 - latter revision */
                        board_config = ALC885_MBP3;
                        break;
                case 0x106b3f00: /* Macbook 5,1 */
+               case 0x106b4000: /* Macbook Pro 5,1 - FIXME: HP jack sense
+                                 *   seems not working, so apparently
+                                 *   no perfect solution yet
+                                 */
                        board_config = ALC885_MB5;
                        break;
                default:
@@ -7302,8 +7310,9 @@ static int patch_alc882(struct hda_codec *codec)
                                alc_free(codec);
                                return patch_alc883(codec);
                        }
-                       printk(KERN_INFO "hda_codec: Unknown model for ALC882, "
-                                        "trying auto-probe from BIOS...\n");
+                       printk(KERN_INFO "hda_codec: Unknown model for %s, "
+                              "trying auto-probe from BIOS...\n",
+                              codec->chip_name);
                        board_config = ALC882_AUTO;
                }
        }
@@ -7333,14 +7342,6 @@ static int patch_alc882(struct hda_codec *codec)
        if (board_config != ALC882_AUTO)
                setup_preset(spec, &alc882_presets[board_config]);
 
-       if (codec->vendor_id == 0x10ec0885) {
-               spec->stream_name_analog = "ALC885 Analog";
-               spec->stream_name_digital = "ALC885 Digital";
-       } else {
-               spec->stream_name_analog = "ALC882 Analog";
-               spec->stream_name_digital = "ALC882 Digital";
-       }
-
        spec->stream_analog_playback = &alc882_pcm_analog_playback;
        spec->stream_analog_capture = &alc882_pcm_analog_capture;
        /* FIXME: setup DAC5 */
@@ -7493,6 +7494,17 @@ static struct hda_input_mux alc883_asus_eee1601_capture_source = {
        },
 };
 
+static struct hda_input_mux alc889A_mb31_capture_source = {
+       .num_items = 2,
+       .items = {
+               { "Mic", 0x0 },
+               /* Front Mic (0x01) unused */
+               { "Line", 0x2 },
+               /* Line 2 (0x03) unused */
+               /* CD (0x04) unsused? */
+       },
+};
+
 /*
  * 2ch mode
  */
@@ -7611,6 +7623,49 @@ static struct hda_channel_mode alc883_sixstack_modes[2] = {
        { 8, alc883_sixstack_ch8_init },
 };
 
+/* 2ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:front) */
+static struct hda_verb alc889A_mb31_ch2_init[] = {
+       {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},             /* HP as front */
+       {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Subwoofer on */
+       {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},    /* Line as input */
+       {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},   /* Line off */
+       { } /* end */
+};
+
+/* 4ch mode (Speaker:front, Subwoofer:CLFE, Line:CLFE, Headphones:front) */
+static struct hda_verb alc889A_mb31_ch4_init[] = {
+       {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},             /* HP as front */
+       {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Subwoofer on */
+       {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},   /* Line as output */
+       {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Line on */
+       { } /* end */
+};
+
+/* 5ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:rear) */
+static struct hda_verb alc889A_mb31_ch5_init[] = {
+       {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},             /* HP as rear */
+       {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Subwoofer on */
+       {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},    /* Line as input */
+       {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},   /* Line off */
+       { } /* end */
+};
+
+/* 6ch mode (Speaker:front, Subwoofer:off, Line:CLFE, Headphones:Rear) */
+static struct hda_verb alc889A_mb31_ch6_init[] = {
+       {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},             /* HP as front */
+       {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},   /* Subwoofer off */
+       {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},   /* Line as output */
+       {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Line on */
+       { } /* end */
+};
+
+static struct hda_channel_mode alc889A_mb31_6ch_modes[4] = {
+       { 2, alc889A_mb31_ch2_init },
+       { 4, alc889A_mb31_ch4_init },
+       { 5, alc889A_mb31_ch5_init },
+       { 6, alc889A_mb31_ch6_init },
+};
+
 static struct hda_verb alc883_medion_eapd_verbs[] = {
         /* eanable EAPD on medion laptop */
        {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
@@ -7889,6 +7944,32 @@ static struct snd_kcontrol_new alc888_lenovo_sky_mixer[] = {
        { } /* end */
 };
 
+static struct snd_kcontrol_new alc889A_mb31_mixer[] = {
+       /* Output mixers */
+       HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
+       HDA_BIND_MUTE("Front Playback Switch", 0x0c, 0x02, HDA_INPUT),
+       HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
+       HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT),
+       HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x00,
+               HDA_OUTPUT),
+       HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x02, HDA_INPUT),
+       HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x00, HDA_OUTPUT),
+       HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x02, HDA_INPUT),
+       /* Output switches */
+       HDA_CODEC_MUTE("Enable Speaker", 0x14, 0x00, HDA_OUTPUT),
+       HDA_CODEC_MUTE("Enable Headphones", 0x15, 0x00, HDA_OUTPUT),
+       HDA_CODEC_MUTE_MONO("Enable LFE", 0x16, 2, 0x00, HDA_OUTPUT),
+       /* Boost mixers */
+       HDA_CODEC_VOLUME("Mic Boost", 0x18, 0x00, HDA_INPUT),
+       HDA_CODEC_VOLUME("Line Boost", 0x1a, 0x00, HDA_INPUT),
+       /* Input mixers */
+       HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT),
+       HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT),
+       HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
+       HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
+       { } /* end */
+};
+
 static struct hda_bind_ctls alc883_bind_cap_vol = {
        .ops = &snd_hda_bind_vol,
        .values = {
@@ -8561,6 +8642,42 @@ static void alc883_eee1601_inithook(struct hda_codec *codec)
        alc_automute_pin(codec);
 }
 
+static struct hda_verb alc889A_mb31_verbs[] = {
+       /* Init rear pin (used as headphone output) */
+       {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4},    /* Apple Headphones */
+       {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},           /* Connect to front */
+       {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
+       /* Init line pin (used as output in 4ch and 6ch mode) */
+       {0x1a, AC_VERB_SET_CONNECT_SEL, 0x02},           /* Connect to CLFE */
+       /* Init line 2 pin (used as headphone out by default) */
+       {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},  /* Use as input */
+       {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Mute output */
+       { } /* end */
+};
+
+/* Mute speakers according to the headphone jack state */
+static void alc889A_mb31_automute(struct hda_codec *codec)
+{
+       unsigned int present;
+
+       /* Mute only in 2ch or 4ch mode */
+       if (snd_hda_codec_read(codec, 0x15, 0, AC_VERB_GET_CONNECT_SEL, 0)
+           == 0x00) {
+               present = snd_hda_codec_read(codec, 0x15, 0,
+                       AC_VERB_GET_PIN_SENSE, 0) & AC_PINSENSE_PRESENCE;
+               snd_hda_codec_amp_stereo(codec, 0x14,  HDA_OUTPUT, 0,
+                       HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
+               snd_hda_codec_amp_stereo(codec, 0x16, HDA_OUTPUT, 0,
+                       HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
+       }
+}
+
+static void alc889A_mb31_unsol_event(struct hda_codec *codec, unsigned int res)
+{
+       if ((res >> 26) == ALC880_HP_EVENT)
+               alc889A_mb31_automute(codec);
+}
+
 #ifdef CONFIG_SND_HDA_POWER_SAVE
 #define alc883_loopbacks       alc880_loopbacks
 #endif
@@ -8601,6 +8718,7 @@ static const char *alc883_models[ALC883_MODEL_LAST] = {
        [ALC888_FUJITSU_XA3530] = "fujitsu-xa3530",
        [ALC883_3ST_6ch_INTEL]  = "3stack-6ch-intel",
        [ALC1200_ASUS_P5Q]      = "asus-p5q",
+       [ALC889A_MB31]          = "mb31",
        [ALC883_AUTO]           = "auto",
 };
 
@@ -9052,6 +9170,21 @@ static struct alc_config_preset alc883_presets[] = {
                .channel_mode = alc883_sixstack_modes,
                .input_mux = &alc883_capture_source,
        },
+       [ALC889A_MB31] = {
+               .mixers = { alc889A_mb31_mixer, alc883_chmode_mixer},
+               .init_verbs = { alc883_init_verbs, alc889A_mb31_verbs,
+                       alc880_gpio1_init_verbs },
+               .adc_nids = alc883_adc_nids,
+               .num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
+               .dac_nids = alc883_dac_nids,
+               .num_dacs = ARRAY_SIZE(alc883_dac_nids),
+               .channel_mode = alc889A_mb31_6ch_modes,
+               .num_channel_mode = ARRAY_SIZE(alc889A_mb31_6ch_modes),
+               .input_mux = &alc889A_mb31_capture_source,
+               .dig_out_nid = ALC883_DIGOUT_NID,
+               .unsol_event = alc889A_mb31_unsol_event,
+               .init_hook = alc889A_mb31_automute,
+       },
 };
 
 
@@ -9197,10 +9330,18 @@ static int patch_alc883(struct hda_codec *codec)
        board_config = snd_hda_check_board_config(codec, ALC883_MODEL_LAST,
                                                  alc883_models,
                                                  alc883_cfg_tbl);
-       if (board_config < 0) {
-               printk(KERN_INFO "hda_codec: Unknown model for ALC883, "
-                      "trying auto-probe from BIOS...\n");
-               board_config = ALC883_AUTO;
+       if (board_config < 0 || board_config >= ALC883_MODEL_LAST) {
+               /* Pick up systems that don't supply PCI SSID */
+               switch (codec->subsystem_id) {
+               case 0x106b3600: /* Macbook 3.1 */
+                       board_config = ALC889A_MB31;
+                       break;
+               default:
+                       printk(KERN_INFO
+                               "hda_codec: Unknown model for %s, trying "
+                               "auto-probe from BIOS...\n", codec->chip_name);
+                       board_config = ALC883_AUTO;
+               }
        }
 
        if (board_config == ALC883_AUTO) {
@@ -9228,13 +9369,6 @@ static int patch_alc883(struct hda_codec *codec)
 
        switch (codec->vendor_id) {
        case 0x10ec0888:
-               if (codec->revision_id == 0x100101) {
-                       spec->stream_name_analog = "ALC1200 Analog";
-                       spec->stream_name_digital = "ALC1200 Digital";
-               } else {
-                       spec->stream_name_analog = "ALC888 Analog";
-                       spec->stream_name_digital = "ALC888 Digital";
-               }
                if (!spec->num_adc_nids) {
                        spec->num_adc_nids = ARRAY_SIZE(alc883_adc_nids);
                        spec->adc_nids = alc883_adc_nids;
@@ -9245,8 +9379,6 @@ static int patch_alc883(struct hda_codec *codec)
                spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */
                break;
        case 0x10ec0889:
-               spec->stream_name_analog = "ALC889 Analog";
-               spec->stream_name_digital = "ALC889 Digital";
                if (!spec->num_adc_nids) {
                        spec->num_adc_nids = ARRAY_SIZE(alc889_adc_nids);
                        spec->adc_nids = alc889_adc_nids;
@@ -9257,8 +9389,6 @@ static int patch_alc883(struct hda_codec *codec)
                                                        capture */
                break;
        default:
-               spec->stream_name_analog = "ALC883 Analog";
-               spec->stream_name_digital = "ALC883 Digital";
                if (!spec->num_adc_nids) {
                        spec->num_adc_nids = ARRAY_SIZE(alc883_adc_nids);
                        spec->adc_nids = alc883_adc_nids;
@@ -11053,8 +11183,8 @@ static int patch_alc262(struct hda_codec *codec)
                                                  alc262_cfg_tbl);
 
        if (board_config < 0) {
-               printk(KERN_INFO "hda_codec: Unknown model for ALC262, "
-                      "trying auto-probe from BIOS...\n");
+               printk(KERN_INFO "hda_codec: Unknown model for %s, "
+                      "trying auto-probe from BIOS...\n", codec->chip_name);
                board_config = ALC262_AUTO;
        }
 
@@ -11083,11 +11213,9 @@ static int patch_alc262(struct hda_codec *codec)
        if (board_config != ALC262_AUTO)
                setup_preset(spec, &alc262_presets[board_config]);
 
-       spec->stream_name_analog = "ALC262 Analog";
        spec->stream_analog_playback = &alc262_pcm_analog_playback;
        spec->stream_analog_capture = &alc262_pcm_analog_capture;
 
-       spec->stream_name_digital = "ALC262 Digital";
        spec->stream_digital_playback = &alc262_pcm_digital_playback;
        spec->stream_digital_capture = &alc262_pcm_digital_capture;
 
@@ -12091,8 +12219,8 @@ static int patch_alc268(struct hda_codec *codec)
                                                  alc268_cfg_tbl);
 
        if (board_config < 0 || board_config >= ALC268_MODEL_LAST) {
-               printk(KERN_INFO "hda_codec: Unknown model for ALC268, "
-                      "trying auto-probe from BIOS...\n");
+               printk(KERN_INFO "hda_codec: Unknown model for %s, "
+                      "trying auto-probe from BIOS...\n", codec->chip_name);
                board_config = ALC268_AUTO;
        }
 
@@ -12113,14 +12241,6 @@ static int patch_alc268(struct hda_codec *codec)
        if (board_config != ALC268_AUTO)
                setup_preset(spec, &alc268_presets[board_config]);
 
-       if (codec->vendor_id == 0x10ec0267) {
-               spec->stream_name_analog = "ALC267 Analog";
-               spec->stream_name_digital = "ALC267 Digital";
-       } else {
-               spec->stream_name_analog = "ALC268 Analog";
-               spec->stream_name_digital = "ALC268 Digital";
-       }
-
        spec->stream_analog_playback = &alc268_pcm_analog_playback;
        spec->stream_analog_capture = &alc268_pcm_analog_capture;
        spec->stream_analog_alt_capture = &alc268_pcm_analog_alt_capture;
@@ -12947,8 +13067,8 @@ static int patch_alc269(struct hda_codec *codec)
                                                  alc269_cfg_tbl);
 
        if (board_config < 0) {
-               printk(KERN_INFO "hda_codec: Unknown model for ALC269, "
-                      "trying auto-probe from BIOS...\n");
+               printk(KERN_INFO "hda_codec: Unknown model for %s, "
+                      "trying auto-probe from BIOS...\n", codec->chip_name);
                board_config = ALC269_AUTO;
        }
 
@@ -12975,7 +13095,6 @@ static int patch_alc269(struct hda_codec *codec)
        if (board_config != ALC269_AUTO)
                setup_preset(spec, &alc269_presets[board_config]);
 
-       spec->stream_name_analog = "ALC269 Analog";
        if (codec->subsystem_id == 0x17aa3bf8) {
                /* Due to a hardware problem on Lenovo Ideadpad, we need to
                 * fix the sample rate of analog I/O to 44.1kHz
@@ -12986,7 +13105,6 @@ static int patch_alc269(struct hda_codec *codec)
                spec->stream_analog_playback = &alc269_pcm_analog_playback;
                spec->stream_analog_capture = &alc269_pcm_analog_capture;
        }
-       spec->stream_name_digital = "ALC269 Digital";
        spec->stream_digital_playback = &alc269_pcm_digital_playback;
        spec->stream_digital_capture = &alc269_pcm_digital_capture;
 
@@ -14048,8 +14166,8 @@ static int patch_alc861(struct hda_codec *codec)
                                                  alc861_cfg_tbl);
 
        if (board_config < 0) {
-               printk(KERN_INFO "hda_codec: Unknown model for ALC861, "
-                      "trying auto-probe from BIOS...\n");
+               printk(KERN_INFO "hda_codec: Unknown model for %s, "
+                      "trying auto-probe from BIOS...\n", codec->chip_name);
                board_config = ALC861_AUTO;
        }
 
@@ -14076,11 +14194,9 @@ static int patch_alc861(struct hda_codec *codec)
        if (board_config != ALC861_AUTO)
                setup_preset(spec, &alc861_presets[board_config]);
 
-       spec->stream_name_analog = "ALC861 Analog";
        spec->stream_analog_playback = &alc861_pcm_analog_playback;
        spec->stream_analog_capture = &alc861_pcm_analog_capture;
 
-       spec->stream_name_digital = "ALC861 Digital";
        spec->stream_digital_playback = &alc861_pcm_digital_playback;
        spec->stream_digital_capture = &alc861_pcm_digital_capture;
 
@@ -14974,8 +15090,8 @@ static int patch_alc861vd(struct hda_codec *codec)
                                                  alc861vd_cfg_tbl);
 
        if (board_config < 0 || board_config >= ALC861VD_MODEL_LAST) {
-               printk(KERN_INFO "hda_codec: Unknown model for ALC660VD/"
-                       "ALC861VD, trying auto-probe from BIOS...\n");
+               printk(KERN_INFO "hda_codec: Unknown model for %s, "
+                      "trying auto-probe from BIOS...\n", codec->chip_name);
                board_config = ALC861VD_AUTO;
        }
 
@@ -15003,13 +15119,8 @@ static int patch_alc861vd(struct hda_codec *codec)
                setup_preset(spec, &alc861vd_presets[board_config]);
 
        if (codec->vendor_id == 0x10ec0660) {
-               spec->stream_name_analog = "ALC660-VD Analog";
-               spec->stream_name_digital = "ALC660-VD Digital";
                /* always turn on EAPD */
                add_verb(spec, alc660vd_eapd_verbs);
-       } else {
-               spec->stream_name_analog = "ALC861VD Analog";
-               spec->stream_name_digital = "ALC861VD Digital";
        }
 
        spec->stream_analog_playback = &alc861vd_pcm_analog_playback;
@@ -16904,8 +17015,8 @@ static int patch_alc662(struct hda_codec *codec)
                                                  alc662_models,
                                                  alc662_cfg_tbl);
        if (board_config < 0) {
-               printk(KERN_INFO "hda_codec: Unknown model for ALC662, "
-                      "trying auto-probe from BIOS...\n");
+               printk(KERN_INFO "hda_codec: Unknown model for %s, "
+                      "trying auto-probe from BIOS...\n", codec->chip_name);
                board_config = ALC662_AUTO;
        }
 
@@ -16932,17 +17043,6 @@ static int patch_alc662(struct hda_codec *codec)
        if (board_config != ALC662_AUTO)
                setup_preset(spec, &alc662_presets[board_config]);
 
-       if (codec->vendor_id == 0x10ec0663) {
-               spec->stream_name_analog = "ALC663 Analog";
-               spec->stream_name_digital = "ALC663 Digital";
-       } else if (codec->vendor_id == 0x10ec0272) {
-               spec->stream_name_analog = "ALC272 Analog";
-               spec->stream_name_digital = "ALC272 Digital";
-       } else {
-               spec->stream_name_analog = "ALC662 Analog";
-               spec->stream_name_digital = "ALC662 Digital";
-       }
-
        spec->stream_analog_playback = &alc662_pcm_analog_playback;
        spec->stream_analog_capture = &alc662_pcm_analog_capture;