]> xenbits.xensource.com Git - people/aperard/linux-chromebook.git/commitdiff
BACKPORT: ALSA: hda - Fix Acer Aspire models with analog mics.
authorDylan Reid <dgreid@chromium.org>
Mon, 19 Nov 2012 06:56:40 +0000 (22:56 -0800)
committerGerrit <chrome-bot@google.com>
Wed, 5 Dec 2012 23:51:32 +0000 (15:51 -0800)
The Acer Aspire AO756 has an analog built-in mic on nid 0x1b and an
external mic on nid 0x19.  The BIOS doesn't set this up.

The mic detect on this Acer Aspire netbook and Acer C7 ChromeBook is
only valid when the headphone is plugged.  The detect circuit relies on
the tip detect switch being closed on the jack.  Tell hda_jack to ignore
the mic sense unless the headphones are plugged.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 08a978db518dfceb37998bc74a7fed03540cfd08)

Conflicts:
sound/pci/hda/patch_realtek.c

[ Simple conflicts with the ZGB quirk we carry - dgreid ]

Change-Id: I6dc642e07cc9c1d50d51c56f7655c7554a2b7775
Reviewed-on: https://gerrit.chromium.org/gerrit/38487
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
sound/pci/hda/patch_realtek.c

index 45dd17de07d35bda005ce868df4b9544ea176b12..b0af2dca55a8b621818ed6a5ba8e069cb76a2f03 100644 (file)
@@ -5991,6 +5991,17 @@ static void alc269_fixup_mic2_mute(struct hda_codec *codec,
        }
 }
 
+static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
+                                   const struct alc_fixup *fix,
+                                   int action)
+{
+       struct alc_spec *spec = codec->spec;
+
+       if (action == ALC_FIXUP_ACT_PROBE)
+               snd_hda_jack_set_gating_jack(codec, spec->ext_mic_pin,
+                                            spec->autocfg.hp_pins[0]);
+}
+
 enum {
        ALC269_FIXUP_SONY_VAIO,
        ALC275_FIXUP_SONY_VAIO_GPIO2,
@@ -6010,6 +6021,8 @@ enum {
        ALC269VB_FIXUP_DMIC,
        ALC269_FIXUP_MIC2_MUTE_LED,
        ALC271_FIXUP_ACER_ZGB,
+       ALC271_FIXUP_AMIC_MIC2,
+       ALC271_FIXUP_HP_GATE_MIC_JACK,
 };
 
 static const struct alc_fixup alc269_fixups[] = {
@@ -6147,6 +6160,22 @@ static const struct alc_fixup alc269_fixups[] = {
                .chained = true,
                .chain_id = ALC271_FIXUP_DMIC,
        },
+       [ALC271_FIXUP_AMIC_MIC2] = {
+               .type = ALC_FIXUP_PINS,
+               .v.pins = (const struct alc_pincfg[]) {
+                       { 0x14, 0x99130110 }, /* speaker */
+                       { 0x19, 0x01a19c20 }, /* mic */
+                       { 0x1b, 0x99a7012f }, /* int-mic */
+                       { 0x21, 0x0121401f }, /* HP out */
+                       { }
+               },
+       },
+       [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
+               .type = ALC_FIXUP_FUNC,
+               .v.func = alc271_hp_gate_mic_jack,
+               .chained = true,
+               .chain_id = ALC271_FIXUP_AMIC_MIC2,
+       },
 };
 
 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -6164,6 +6193,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
        SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
        SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
        SND_PCI_QUIRK(0x1025, 0x047c, "ACER ZGB", ALC271_FIXUP_ACER_ZGB),
+       SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
        SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
        SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
        SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),