[alsa-devel] [PATCH v2- ALSA 3/3] HDA - add headset-sonicmaster and headset-multi-sonicmaster models

Raymond Yau superquad.vortex2 at gmail.com
Wed Sep 23 04:40:51 CEST 2015


add headset only model for ALC668 with Sonic Master Subwoofer

add 625ms delay after headset is plugged for correct detection of headset
type for ALC668

add headset multi model with Sonice Master Subwoofer

update HD-Audio-Models.txt

Signed-off-by: Raymond Yau <superquad.vortex2 at gmail.com>

diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt
b/Documentation/sound/alsa/HD-Audio-Models.txt
index ec099d4..8baddac 100644
--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -55,7 +55,12 @@ ALC66x/67x/892
   asus-mode7        ASUS
   asus-mode8        ASUS
   inv-dmic        Inverted internal mic workaround
+
+ALC668
+======
   dell-headset-multi    Headset jack, which can also be used as mic-in
+  headset-sonicmaster   Headset jack and SonicMaster Subwoofer
+  headset-multi-sonicmaster    Headset, HP or Mic and SonicMaster Subwoofer

 ALC680
 ======
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index a75b561..91de00c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4029,7 +4029,13 @@ static void alc_update_headset_mode(struct hda_codec
*codec)
                           PIN_VREFHIZ);
     }
     spec->current_headset_mode = new_headset_mode;
-
+    if (codec->core.vendor_id == 0x10ec0668) {
+        if (spec->gen.hs_mic_use_hp_sense && spec->gen.auto_mic) {
+            if (new_headset_mode == ALC_HEADSET_MODE_HEADPHONE)
+                msleep(625);
+            snd_hda_gen_mic_autoswitch(codec, NULL);
+        };
+    }
     snd_hda_gen_update_outputs(codec);
 }

@@ -6071,6 +6077,42 @@ static void alc662_fixup_led_gpio1(struct hda_codec
*codec,
     }
 }

+static void alc668_fixup_asus_headset_only(struct hda_codec *codec,
+                    const struct hda_fixup *fix, int action)
+{
+    const struct hda_pintbl hs_mic_pin[] = {
+        { 0x1b, 0x03a1113c }, /* headset mic */
+        { }
+    };
+    struct alc_spec *spec = codec->spec;
+
+    switch (action) {
+    case HDA_FIXUP_ACT_PRE_PROBE:
+        snd_hda_apply_pincfgs(codec, hs_mic_pin);
+        spec->gen.hs_mic_use_hp_sense = 1;
+        alc_fixup_disable_aamix(codec, fix, action);
+        break;
+    }
+}
+
+static void alc668_fixup_sonicmaster(struct hda_codec *codec,
+                    const struct hda_fixup *fix, int action)
+{
+    const struct hda_pintbl bass_pin[] = {
+        { 0x1a, 0x04110011 }, /* external subwoofer */
+        { }
+    };
+
+    switch (action) {
+    case HDA_FIXUP_ACT_PRE_PROBE:
+        snd_hda_apply_pincfgs(codec, bass_pin);
+        break;
+    case HDA_FIXUP_ACT_BUILD:
+        alc_fixup_bass_chmap(codec, fix, action);
+        break;
+    }
+}
+
 static struct coef_fw alc668_coefs[] = {
     WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa),
WRITE_COEF(0x03,    0x0),
     WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06,    0x0), WRITE_COEF(0x07,
0x0f80),
@@ -6130,6 +6172,9 @@ enum {
     ALC668_FIXUP_AUTO_MUTE,
     ALC668_FIXUP_DELL_DISABLE_AAMIX,
     ALC668_FIXUP_DELL_XPS13,
+    ALC668_FIXUP_HEADSET_ONLY,
+    ALC668_FIXUP_HEADSET_SONICMASTER,
+    ALC668_FIXUP_HEADSET_MULTI_SONICMASTER,
 };

 static const struct hda_fixup alc662_fixups[] = {
@@ -6370,6 +6415,24 @@ static const struct hda_fixup alc662_fixups[] = {
         .type = HDA_FIXUP_FUNC,
         .v.func = alc_fixup_bass_chmap,
     },
+    [ALC668_FIXUP_HEADSET_ONLY] = {
+        .type = HDA_FIXUP_FUNC,
+        .v.func = alc668_fixup_asus_headset_only,
+        .chained = true,
+        .chain_id = ALC668_FIXUP_HEADSET_MODE,
+    },
+    [ALC668_FIXUP_HEADSET_SONICMASTER] = {
+        .type = HDA_FIXUP_FUNC,
+        .v.func = alc668_fixup_sonicmaster,
+        .chained = true,
+        .chain_id = ALC668_FIXUP_HEADSET_ONLY,
+    },
+    [ALC668_FIXUP_HEADSET_MULTI_SONICMASTER] = {
+        .type = HDA_FIXUP_FUNC,
+        .v.func = alc668_fixup_sonicmaster,
+        .chained = true,
+        .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX,
+    },
 };

 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
@@ -6476,6 +6539,9 @@ static const struct hda_model_fixup
alc662_fixup_models[] = {
     {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
     {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
     {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name =
"dell-headset-multi"},
+    {.id = ALC668_FIXUP_HEADSET_SONICMASTER, .name =
"headset-sonicmaster"},
+    {.id = ALC668_FIXUP_HEADSET_MULTI_SONICMASTER,
+        .name = "headset-multi-sonicmaster"},
     {}
 };

-- 
2.5.0


More information about the Alsa-devel mailing list