ALSA: HDA: Add new revision for ALC662
[linux-2.6-microblaze.git] / sound / pci / hda / patch_realtek.c
index cc861c1..4fab23f 100644 (file)
@@ -197,6 +197,7 @@ struct alc_spec {
        /* for PLL fix */
        hda_nid_t pll_nid;
        unsigned int pll_coef_idx, pll_coef_bit;
+       unsigned int coef0;
 
        /* fix-up list */
        int fixup_id;
@@ -1554,6 +1555,15 @@ static void alc_write_coef_idx(struct hda_codec *codec, unsigned int coef_idx,
                            coef_val);
 }
 
+/* a special bypass for COEF 0; read the cached value at the second time */
+static unsigned int alc_get_coef0(struct hda_codec *codec)
+{
+       struct alc_spec *spec = codec->spec;
+       if (!spec->coef0)
+               spec->coef0 = alc_read_coef_idx(codec, 0);
+       return spec->coef0;
+}
+
 /*
  * Digital I/O handling
  */
@@ -2479,6 +2489,47 @@ static int alc_codec_rename(struct hda_codec *codec, const char *name)
        return 0;
 }
 
+/*
+ * Rename codecs appropriately from COEF value
+ */
+struct alc_codec_rename_table {
+       unsigned int vendor_id;
+       unsigned short coef_mask;
+       unsigned short coef_bits;
+       const char *name;
+};
+
+static struct alc_codec_rename_table rename_tbl[] = {
+       { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
+       { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
+       { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
+       { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
+       { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
+       { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
+       { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
+       { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
+       { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
+       { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
+       { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
+       { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
+       { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
+       { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
+       { } /* terminator */
+};
+
+static int alc_codec_rename_from_preset(struct hda_codec *codec)
+{
+       const struct alc_codec_rename_table *p;
+
+       for (p = rename_tbl; p->vendor_id; p++) {
+               if (p->vendor_id != codec->vendor_id)
+                       continue;
+               if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
+                       return alc_codec_rename(codec, p->name);
+       }
+       return 0;
+}
+
 /*
  * Automatic parse of I/O pins from the BIOS configuration
  */
@@ -2945,9 +2996,11 @@ static int alc_auto_fill_dac_nids(struct hda_codec *codec)
                }
        }
 
-       alc_auto_fill_extra_dacs(codec, cfg->hp_outs, cfg->hp_pins,
+       if (cfg->line_out_type != AUTO_PIN_HP_OUT)
+               alc_auto_fill_extra_dacs(codec, cfg->hp_outs, cfg->hp_pins,
                                 spec->multiout.hp_out_nid);
-       alc_auto_fill_extra_dacs(codec, cfg->speaker_outs, cfg->speaker_pins,
+       if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT)
+               alc_auto_fill_extra_dacs(codec, cfg->speaker_outs, cfg->speaker_pins,
                                 spec->multiout.extra_out_nid);
 
        return 0;
@@ -3264,6 +3317,8 @@ static void alc_auto_init_extra_out(struct hda_codec *codec)
        hda_nid_t pin, dac;
 
        for (i = 0; i < spec->autocfg.hp_outs; i++) {
+               if (spec->autocfg.line_out_type == AUTO_PIN_HP_OUT)
+                       break;
                pin = spec->autocfg.hp_pins[i];
                if (!pin)
                        break;
@@ -3277,6 +3332,8 @@ static void alc_auto_init_extra_out(struct hda_codec *codec)
                alc_auto_set_output_and_unmute(codec, pin, PIN_HP, dac);
        }
        for (i = 0; i < spec->autocfg.speaker_outs; i++) {
+               if (spec->autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT)
+                       break;
                pin = spec->autocfg.speaker_pins[i];
                if (!pin)
                        break;
@@ -3853,10 +3910,8 @@ static int patch_alc880(struct hda_codec *codec)
        if (board_config == ALC_MODEL_AUTO) {
                /* automatic parse from the BIOS config */
                err = alc880_parse_auto_config(codec);
-               if (err < 0) {
-                       alc_free(codec);
-                       return err;
-               }
+               if (err < 0)
+                       goto error;
 #ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS
                else if (!err) {
                        printk(KERN_INFO
@@ -3881,10 +3936,8 @@ static int patch_alc880(struct hda_codec *codec)
 
        if (!spec->no_analog) {
                err = snd_hda_attach_beep_device(codec, 0x1);
-               if (err < 0) {
-                       alc_free(codec);
-                       return err;
-               }
+               if (err < 0)
+                       goto error;
                set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
        }
 
@@ -3899,6 +3952,10 @@ static int patch_alc880(struct hda_codec *codec)
 #endif
 
        return 0;
+
+ error:
+       alc_free(codec);
+       return err;
 }
 
 
@@ -3980,10 +4037,8 @@ static int patch_alc260(struct hda_codec *codec)
        if (board_config == ALC_MODEL_AUTO) {
                /* automatic parse from the BIOS config */
                err = alc260_parse_auto_config(codec);
-               if (err < 0) {
-                       alc_free(codec);
-                       return err;
-               }
+               if (err < 0)
+                       goto error;
 #ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS
                else if (!err) {
                        printk(KERN_INFO
@@ -4008,10 +4063,8 @@ static int patch_alc260(struct hda_codec *codec)
 
        if (!spec->no_analog) {
                err = snd_hda_attach_beep_device(codec, 0x1);
-               if (err < 0) {
-                       alc_free(codec);
-                       return err;
-               }
+               if (err < 0)
+                       goto error;
                set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
        }
 
@@ -4029,6 +4082,10 @@ static int patch_alc260(struct hda_codec *codec)
 #endif
 
        return 0;
+
+ error:
+       alc_free(codec);
+       return err;
 }
 
 
@@ -4136,6 +4193,10 @@ static int patch_alc882(struct hda_codec *codec)
                break;
        }
 
+       err = alc_codec_rename_from_preset(codec);
+       if (err < 0)
+               goto error;
+
        board_config = alc_board_config(codec, ALC882_MODEL_LAST,
                                        alc882_models, alc882_cfg_tbl);
 
@@ -4159,10 +4220,8 @@ static int patch_alc882(struct hda_codec *codec)
        if (board_config == ALC_MODEL_AUTO) {
                /* automatic parse from the BIOS config */
                err = alc882_parse_auto_config(codec);
-               if (err < 0) {
-                       alc_free(codec);
-                       return err;
-               }
+               if (err < 0)
+                       goto error;
 #ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS
                else if (!err) {
                        printk(KERN_INFO
@@ -4187,10 +4246,8 @@ static int patch_alc882(struct hda_codec *codec)
 
        if (!spec->no_analog && has_cdefine_beep(codec)) {
                err = snd_hda_attach_beep_device(codec, 0x1);
-               if (err < 0) {
-                       alc_free(codec);
-                       return err;
-               }
+               if (err < 0)
+                       goto error;
                set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
        }
 
@@ -4209,6 +4266,10 @@ static int patch_alc882(struct hda_codec *codec)
 #endif
 
        return 0;
+
+ error:
+       alc_free(codec);
+       return err;
 }
 
 
@@ -4313,10 +4374,8 @@ static int patch_alc262(struct hda_codec *codec)
        if (board_config == ALC_MODEL_AUTO) {
                /* automatic parse from the BIOS config */
                err = alc262_parse_auto_config(codec);
-               if (err < 0) {
-                       alc_free(codec);
-                       return err;
-               }
+               if (err < 0)
+                       goto error;
 #ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS
                else if (!err) {
                        printk(KERN_INFO
@@ -4341,10 +4400,8 @@ static int patch_alc262(struct hda_codec *codec)
 
        if (!spec->no_analog && has_cdefine_beep(codec)) {
                err = snd_hda_attach_beep_device(codec, 0x1);
-               if (err < 0) {
-                       alc_free(codec);
-                       return err;
-               }
+               if (err < 0)
+                       goto error;
                set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
        }
 
@@ -4364,6 +4421,10 @@ static int patch_alc262(struct hda_codec *codec)
 #endif
 
        return 0;
+
+ error:
+       alc_free(codec);
+       return err;
 }
 
 /*
@@ -4427,10 +4488,8 @@ static int patch_alc268(struct hda_codec *codec)
 
        /* automatic parse from the BIOS config */
        err = alc268_parse_auto_config(codec);
-       if (err < 0) {
-               alc_free(codec);
-               return err;
-       }
+       if (err < 0)
+               goto error;
 
        has_beep = 0;
        for (i = 0; i < spec->num_mixers; i++) {
@@ -4442,10 +4501,8 @@ static int patch_alc268(struct hda_codec *codec)
 
        if (has_beep) {
                err = snd_hda_attach_beep_device(codec, 0x1);
-               if (err < 0) {
-                       alc_free(codec);
-                       return err;
-               }
+               if (err < 0)
+                       goto error;
                if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
                        /* override the amp caps for beep generator */
                        snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
@@ -4473,6 +4530,10 @@ static int patch_alc268(struct hda_codec *codec)
        alc_init_jacks(codec);
 
        return 0;
+
+ error:
+       alc_free(codec);
+       return err;
 }
 
 /*
@@ -4566,9 +4627,9 @@ static void alc269_toggle_power_output(struct hda_codec *codec, int power_up)
 
 static void alc269_shutup(struct hda_codec *codec)
 {
-       if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x017)
+       if ((alc_get_coef0(codec) & 0x00ff) == 0x017)
                alc269_toggle_power_output(codec, 0);
-       if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x018) {
+       if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
                alc269_toggle_power_output(codec, 0);
                msleep(150);
        }
@@ -4577,19 +4638,19 @@ static void alc269_shutup(struct hda_codec *codec)
 #ifdef CONFIG_PM
 static int alc269_resume(struct hda_codec *codec)
 {
-       if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x018) {
+       if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
                alc269_toggle_power_output(codec, 0);
                msleep(150);
        }
 
        codec->patch_ops.init(codec);
 
-       if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x017) {
+       if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
                alc269_toggle_power_output(codec, 1);
                msleep(200);
        }
 
-       if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x018)
+       if ((alc_get_coef0(codec) & 0x00ff) == 0x018)
                alc269_toggle_power_output(codec, 1);
 
        snd_hda_codec_resume_amp(codec);
@@ -4907,23 +4968,23 @@ static int alc269_fill_coef(struct hda_codec *codec)
 {
        int val;
 
-       if ((alc_read_coef_idx(codec, 0) & 0x00ff) < 0x015) {
+       if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
                alc_write_coef_idx(codec, 0xf, 0x960b);
                alc_write_coef_idx(codec, 0xe, 0x8817);
        }
 
-       if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x016) {
+       if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
                alc_write_coef_idx(codec, 0xf, 0x960b);
                alc_write_coef_idx(codec, 0xe, 0x8814);
        }
 
-       if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x017) {
+       if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
                val = alc_read_coef_idx(codec, 0x04);
                /* Power up output pin */
                alc_write_coef_idx(codec, 0x04, val | (1<<11));
        }
 
-       if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x018) {
+       if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
                val = alc_read_coef_idx(codec, 0xd);
                if ((val & 0x0c00) >> 10 != 0x1) {
                        /* Capless ramp up clock control */
@@ -4962,41 +5023,30 @@ static int patch_alc269(struct hda_codec *codec)
 
        alc_auto_parse_customize_define(codec);
 
+       err = alc_codec_rename_from_preset(codec);
+       if (err < 0)
+               goto error;
+
        if (codec->vendor_id == 0x10ec0269) {
-               unsigned int coef;
                spec->codec_variant = ALC269_TYPE_ALC269VA;
-               coef = alc_read_coef_idx(codec, 0);
-               if ((coef & 0x00f0) == 0x0010) {
+               switch (alc_get_coef0(codec) & 0x00f0) {
+               case 0x0010:
                        if (codec->bus->pci->subsystem_vendor == 0x1025 &&
-                           spec->cdefine.platform_type == 1) {
+                           spec->cdefine.platform_type == 1)
                                err = alc_codec_rename(codec, "ALC271X");
-                       } else if ((coef & 0xf000) == 0x2000) {
-                               err = alc_codec_rename(codec, "ALC259");
-                       } else if ((coef & 0xf000) == 0x3000) {
-                               err = alc_codec_rename(codec, "ALC258");
-                       } else if ((coef & 0xfff0) == 0x3010) {
-                               err = alc_codec_rename(codec, "ALC277");
-                       } else {
-                               err = alc_codec_rename(codec, "ALC269VB");
-                       }
                        spec->codec_variant = ALC269_TYPE_ALC269VB;
-               } else if ((coef & 0x00f0) == 0x0020) {
-                       if (coef == 0xa023)
-                               err = alc_codec_rename(codec, "ALC259");
-                       else if (coef == 0x6023)
-                               err = alc_codec_rename(codec, "ALC281X");
-                       else if (codec->bus->pci->subsystem_vendor == 0x17aa &&
-                                codec->bus->pci->subsystem_device == 0x21f3)
+                       break;
+               case 0x0020:
+                       if (codec->bus->pci->subsystem_vendor == 0x17aa &&
+                           codec->bus->pci->subsystem_device == 0x21f3)
                                err = alc_codec_rename(codec, "ALC3202");
-                       else
-                               err = alc_codec_rename(codec, "ALC269VC");
                        spec->codec_variant = ALC269_TYPE_ALC269VC;
-               } else
+                       break;
+               default:
                        alc_fix_pll_init(codec, 0x20, 0x04, 15);
-               if (err < 0) {
-                       alc_free(codec);
-                       return err;
                }
+               if (err < 0)
+                       goto error;
                alc269_fill_coef(codec);
        }
 
@@ -5006,10 +5056,8 @@ static int patch_alc269(struct hda_codec *codec)
 
        /* automatic parse from the BIOS config */
        err = alc269_parse_auto_config(codec);
-       if (err < 0) {
-               alc_free(codec);
-               return err;
-       }
+       if (err < 0)
+               goto error;
 
        if (!spec->no_analog && !spec->adc_nids) {
                alc_auto_fill_adc_caps(codec);
@@ -5022,10 +5070,8 @@ static int patch_alc269(struct hda_codec *codec)
 
        if (!spec->no_analog && has_cdefine_beep(codec)) {
                err = snd_hda_attach_beep_device(codec, 0x1);
-               if (err < 0) {
-                       alc_free(codec);
-                       return err;
-               }
+               if (err < 0)
+                       goto error;
                set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
        }
 
@@ -5049,6 +5095,10 @@ static int patch_alc269(struct hda_codec *codec)
 #endif
 
        return 0;
+
+ error:
+       alc_free(codec);
+       return err;
 }
 
 /*
@@ -5114,10 +5164,8 @@ static int patch_alc861(struct hda_codec *codec)
 
        /* automatic parse from the BIOS config */
        err = alc861_parse_auto_config(codec);
-       if (err < 0) {
-               alc_free(codec);
-               return err;
-       }
+       if (err < 0)
+               goto error;
 
        if (!spec->no_analog && !spec->adc_nids) {
                alc_auto_fill_adc_caps(codec);
@@ -5130,10 +5178,8 @@ static int patch_alc861(struct hda_codec *codec)
 
        if (!spec->no_analog) {
                err = snd_hda_attach_beep_device(codec, 0x23);
-               if (err < 0) {
-                       alc_free(codec);
-                       return err;
-               }
+               if (err < 0)
+                       goto error;
                set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
        }
 
@@ -5150,6 +5196,10 @@ static int patch_alc861(struct hda_codec *codec)
 #endif
 
        return 0;
+
+ error:
+       alc_free(codec);
+       return err;
 }
 
 /*
@@ -5235,10 +5285,8 @@ static int patch_alc861vd(struct hda_codec *codec)
 
        /* automatic parse from the BIOS config */
        err = alc861vd_parse_auto_config(codec);
-       if (err < 0) {
-               alc_free(codec);
-               return err;
-       }
+       if (err < 0)
+               goto error;
 
        if (codec->vendor_id == 0x10ec0660) {
                /* always turn on EAPD */
@@ -5256,10 +5304,8 @@ static int patch_alc861vd(struct hda_codec *codec)
 
        if (!spec->no_analog) {
                err = snd_hda_attach_beep_device(codec, 0x23);
-               if (err < 0) {
-                       alc_free(codec);
-                       return err;
-               }
+               if (err < 0)
+                       goto error;
                set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
        }
 
@@ -5277,6 +5323,10 @@ static int patch_alc861vd(struct hda_codec *codec)
 #endif
 
        return 0;
+
+ error:
+       alc_free(codec);
+       return err;
 }
 
 /*
@@ -5581,7 +5631,6 @@ static int patch_alc662(struct hda_codec *codec)
 {
        struct alc_spec *spec;
        int err = 0;
-       int coef;
 
        spec = kzalloc(sizeof(*spec), GFP_KERNEL);
        if (!spec)
@@ -5598,18 +5647,15 @@ static int patch_alc662(struct hda_codec *codec)
 
        alc_fix_pll_init(codec, 0x20, 0x04, 15);
 
-       coef = alc_read_coef_idx(codec, 0);
-       if (coef == 0x8020 || coef == 0x8011)
-               err = alc_codec_rename(codec, "ALC661");
-       else if (coef & (1 << 14) &&
-               codec->bus->pci->subsystem_vendor == 0x1025 &&
-               spec->cdefine.platform_type == 1)
-               err = alc_codec_rename(codec, "ALC272X");
-       else if (coef == 0x4011)
-               err = alc_codec_rename(codec, "ALC656");
-       if (err < 0) {
-               alc_free(codec);
-               return err;
+       err = alc_codec_rename_from_preset(codec);
+       if (err < 0)
+               goto error;
+
+       if ((alc_get_coef0(codec) & (1 << 14)) &&
+           codec->bus->pci->subsystem_vendor == 0x1025 &&
+           spec->cdefine.platform_type == 1) {
+               if (alc_codec_rename(codec, "ALC272X") < 0)
+                       goto error;
        }
 
        alc_pick_fixup(codec, alc662_fixup_models,
@@ -5617,10 +5663,8 @@ static int patch_alc662(struct hda_codec *codec)
        alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
        /* automatic parse from the BIOS config */
        err = alc662_parse_auto_config(codec);
-       if (err < 0) {
-               alc_free(codec);
-               return err;
-       }
+       if (err < 0)
+               goto error;
 
        if (!spec->no_analog && !spec->adc_nids) {
                alc_auto_fill_adc_caps(codec);
@@ -5633,10 +5677,8 @@ static int patch_alc662(struct hda_codec *codec)
 
        if (!spec->no_analog && has_cdefine_beep(codec)) {
                err = snd_hda_attach_beep_device(codec, 0x1);
-               if (err < 0) {
-                       alc_free(codec);
-                       return err;
-               }
+               if (err < 0)
+                       goto error;
                switch (codec->vendor_id) {
                case 0x10ec0662:
                        set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
@@ -5667,49 +5709,10 @@ static int patch_alc662(struct hda_codec *codec)
 #endif
 
        return 0;
-}
-
-static int patch_alc888(struct hda_codec *codec)
-{
-       int coef;
 
-       coef = alc_read_coef_idx(codec, 0);
-       /* For ALC887-VD ALC888S-VD */
-       if ((coef & 0x00f0) == 0x0030) {
-               kfree(codec->chip_name);
-               if (codec->vendor_id == 0x10ec0887)
-                       err = alc_codec_rename(codec, "ALC887-VD");
-               else
-                       err = alc_codec_rename(codec, "ALC888-VD");
-               if (err < 0) {
-                       alc_free(codec);
-                       return -ENOMEM;
-               }
-               return patch_alc662(codec);
-       }
-
-       /* For ALC888S-VC */
-       if (codec->vendor_id == 0x10ec0888) {
-               if ((coef & 0xf0f0) == 0x3020) {
-                       err = alc_codec_rename(codec, "ALC886");
-                       if (err < 0) {
-                               alc_free(codec);
-                               return -ENOMEM;
-                       }
-               }
-       }
-       return patch_alc882(codec);
-}
-
-static int patch_alc899(struct hda_codec *codec)
-{
-       if ((alc_read_coef_idx(codec, 0) & 0x2000) != 0x2000) {
-               if (alc_codec_rename(codec, "ALC898") < 0) {
-                       alc_free(codec);
-                       return -ENOMEM;
-               }
-       }
-       return patch_alc882(codec);
+ error:
+       alc_free(codec);
+       return err;
 }
 
 /*
@@ -5777,6 +5780,8 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = {
          .patch = patch_alc882 },
        { .id = 0x10ec0662, .rev = 0x100101, .name = "ALC662 rev1",
          .patch = patch_alc662 },
+       { .id = 0x10ec0662, .rev = 0x100300, .name = "ALC662 rev3",
+         .patch = patch_alc662 },
        { .id = 0x10ec0663, .name = "ALC663", .patch = patch_alc662 },
        { .id = 0x10ec0665, .name = "ALC665", .patch = patch_alc662 },
        { .id = 0x10ec0670, .name = "ALC670", .patch = patch_alc662 },
@@ -5789,13 +5794,13 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = {
        { .id = 0x10ec0885, .rev = 0x100103, .name = "ALC889A",
          .patch = patch_alc882 },
        { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 },
-       { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc888 },
+       { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc882 },
        { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200",
          .patch = patch_alc882 },
-       { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc888 },
+       { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc882 },
        { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc882 },
        { .id = 0x10ec0892, .name = "ALC892", .patch = patch_alc662 },
-       { .id = 0x10ec0899, .name = "ALC899", .patch = patch_alc899 },
+       { .id = 0x10ec0899, .name = "ALC898", .patch = patch_alc882 },
        {} /* terminator */
 };