From patchwork Wed Sep 23 02:40:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Yau X-Patchwork-Id: 7247051 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E6BBBBEEC1 for ; Wed, 23 Sep 2015 02:41:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F41B620A81 for ; Wed, 23 Sep 2015 02:41:56 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id AF7EE2089F for ; Wed, 23 Sep 2015 02:41:55 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4A4CF2652C5; Wed, 23 Sep 2015 04:41:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id ABE0026518B; Wed, 23 Sep 2015 04:41:02 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id DF2252651B2; Wed, 23 Sep 2015 04:41:00 +0200 (CEST) Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by alsa0.perex.cz (Postfix) with ESMTP id 46333265152 for ; Wed, 23 Sep 2015 04:40:52 +0200 (CEST) Received: by obbzf10 with SMTP id zf10so23209313obb.2 for ; Tue, 22 Sep 2015 19:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=u2Ln7C4e25sjpY0hVqRbL+4Paj8ts0P2ZH1OST0mSgc=; b=eYwNcm2Sllu+xw66ZSy78QHZtWYfaXctt0Ql7coARV2/7PdWZLffmccq/S0JUeF1mH RkSLmxspCa6wGymKDZz1tYxYXz8gWOtsYPsWMBG33IrGM/ICRz9iIvhFxceU9zMxRykl yjr8XnHTV8QNQ8NS4SJxQvNqc4ePDIFhF98HfBy60IRuSz8zFOSszrTCSsp6AtQb7Nbu m2gF38HnifNFBkb5Lvbr14nyWJ1vM73emZTAsHWy+5baqcl6Gm8Q2VwnPy/8B9O9gdun E4u2fpoigdWpx2oTIgaYSRvXA10j18RtmM6KhNn3y/5N/lrRtXkegeDgkHNwXOJU4Q09 iiRA== MIME-Version: 1.0 X-Received: by 10.60.156.196 with SMTP id wg4mr18630809oeb.9.1442976051418; Tue, 22 Sep 2015 19:40:51 -0700 (PDT) Received: by 10.202.209.22 with HTTP; Tue, 22 Sep 2015 19:40:51 -0700 (PDT) Date: Wed, 23 Sep 2015 10:40:51 +0800 Message-ID: From: Raymond Yau To: ALSA Development Mailing List , tiwai@suse.de, arthurborsboom@gmail.com X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Subject: [alsa-devel] [PATCH v2- ALSA 3/3] HDA - add headset-sonicmaster and headset-multi-sonicmaster models X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 @@ -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"}, {} }; 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); }