ALSA: hda - Add some model name strings for ALC260
authorTakashi Iwai <tiwai@suse.de>
Tue, 19 Feb 2013 17:23:31 +0000 (18:23 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 7 Mar 2013 17:30:07 +0000 (18:30 +0100)
In order to let user test the known workaround more easily, give a few
known fixups for ALC260 to the model strings so that it can be passed
via the module option.

Also, move the unusual setups found in FSC S7020 fixup into a special
model, fujitsu-jwse, Jonathan Woithe Special Edition.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c

index 2d4237bc0d8e5e85059b8771bad958ae10887ff5..056990e5ffe9aeeab3009aef9d83aea5624d246a 100644 (file)
@@ -1455,6 +1455,7 @@ enum {
        ALC260_FIXUP_HP_B1900,
        ALC260_FIXUP_KN1,
        ALC260_FIXUP_FSC_S7020,
+       ALC260_FIXUP_FSC_S7020_JWSE,
 };
 
 static void alc260_gpio1_automute(struct hda_codec *codec)
@@ -1516,14 +1517,18 @@ static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
                                   const struct hda_fixup *fix, int action)
 {
        struct alc_spec *spec = codec->spec;
+       if (action == HDA_FIXUP_ACT_PROBE)
+               spec->init_amp = ALC_INIT_NONE;
+}
 
-       switch (action) {
-       case HDA_FIXUP_ACT_PRE_PROBE:
+static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
+                                  const struct hda_fixup *fix, int action)
+{
+       struct alc_spec *spec = codec->spec;
+       if (action == HDA_FIXUP_ACT_PRE_PROBE) {
                spec->gen.add_out_jack_modes = 1;
-               break;
-       case HDA_FIXUP_ACT_PROBE:
-               spec->init_amp = ALC_INIT_NONE;
-               break;
+               spec->gen.add_in_jack_modes = 1;
+               spec->gen.hp_mic = 1;
        }
 }
 
@@ -1586,6 +1591,12 @@ static const struct hda_fixup alc260_fixups[] = {
                .type = HDA_FIXUP_FUNC,
                .v.func = alc260_fixup_fsc_s7020,
        },
+       [ALC260_FIXUP_FSC_S7020_JWSE] = {
+               .type = HDA_FIXUP_FUNC,
+               .v.func = alc260_fixup_fsc_s7020_jwse,
+               .chained = true,
+               .chain_id = ALC260_FIXUP_FSC_S7020,
+       },
 };
 
 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
@@ -1602,6 +1613,14 @@ static const struct snd_pci_quirk alc260_fixup_tbl[] = {
        {}
 };
 
+static const struct hda_model_fixup alc260_fixup_models[] = {
+       {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
+       {.id = ALC260_FIXUP_COEF, .name = "coef"},
+       {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
+       {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
+       {}
+};
+
 /*
  */
 static int patch_alc260(struct hda_codec *codec)
@@ -1620,7 +1639,8 @@ static int patch_alc260(struct hda_codec *codec)
         */
        spec->gen.prefer_hp_amp = 1;
 
-       snd_hda_pick_fixup(codec, NULL, alc260_fixup_tbl, alc260_fixups);
+       snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
+                          alc260_fixups);
        snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
 
        /* automatic parse from the BIOS config */