From patchwork Mon May 26 15:11:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriele Mazzotta X-Patchwork-Id: 4243171 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 00DA59F32B for ; Mon, 26 May 2014 15:12:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2EF7B20259 for ; Mon, 26 May 2014 15:12:53 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id F2DCC2021F for ; Mon, 26 May 2014 15:12:51 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0F00B265056; Mon, 26 May 2014 17:12:51 +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=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C926C2652CE; Mon, 26 May 2014 17:12:00 +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 0898326530B; Mon, 26 May 2014 17:12:00 +0200 (CEST) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by alsa0.perex.cz (Postfix) with ESMTP id 6E73A265056 for ; Mon, 26 May 2014 17:11:50 +0200 (CEST) Received: by mail-wi0-f173.google.com with SMTP id bs8so151630wib.6 for ; Mon, 26 May 2014 08:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:mime-version :content-transfer-encoding:content-type; bh=sYk4MAKhO3pjpRnWgUQLiNXSP0BgDceqZSwBhZrm5KY=; b=Tu24xnQIZbI43PqG7wC+fn9V6DE2M9J4zT56id4QRHmUBpz0roP/0KnenZnijdgyWl SVOtyCxk6X2tfimrOz7vMQouSE4gQBowBPL/UYgUQa+HJlHdY9Dm5+FU1o3Cz/fu7v0Y ozedz21twgHC72zqCm8RYRiTOgD1n+KL4LHU5TuYTtV/loaFsHh1PSBiuwa0q1RRlxZf gOi95NsIN6fm+QOjss+n516MNPAs1f0w47qZ6JvzjlvUvceLlE7LTgoHA0eiaV6EH05j i+y4nXryhBjK/2CNhCibfoldv1Wt/Hfcjho+8VN0vsIoi4BshQOWuBKOhiCBHk6ppF4f OdfQ== X-Received: by 10.180.73.66 with SMTP id j2mr27229728wiv.36.1401117109283; Mon, 26 May 2014 08:11:49 -0700 (PDT) Received: from xps13.localnet ([2a02:2c40:400::1:fafe]) by mx.google.com with ESMTPSA id kp5sm27527880wjb.30.2014.05.26.08.11.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 May 2014 08:11:48 -0700 (PDT) From: Gabriele Mazzotta To: alsa-devel@alsa-project.org Date: Mon, 26 May 2014 17:11:46 +0200 Message-ID: <2583453.CzVdMf61zs@xps13> User-Agent: KMail/4.12.4 (Linux/3.14-1-amd64; KDE/4.13.1; x86_64; ; ) MIME-Version: 1.0 Cc: tiwai@suse.de Subject: [alsa-devel] [PATCH] ALSA: hda - Pop noises fix for XPS13 9333 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 When headphones are plugged in, force AFG and node 0x02 ("Headphone Playback Volume") to D0 to avoid pop noises. Signed-off-by: Gabriele Mazzotta --- sound/pci/hda/patch_realtek.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index ce28dc4..b7a435c 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3726,6 +3726,29 @@ static void alc_fixup_disable_aamix(struct hda_codec *codec, } } +static unsigned int alc_power_filter_xps13(struct hda_codec *codec, + hda_nid_t nid, + unsigned int power_state) +{ + struct alc_spec *spec = codec->spec; + + /* Avoid pop noises when headphones are plugged in */ + if (spec->gen.hp_jack_present) + if (nid == codec->afg || nid == 0x02) + return AC_PWRST_D0; + return power_state; +} + +static void alc_fixup_dell_xps13(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + if (action == HDA_FIXUP_ACT_PROBE) { + struct alc_spec *spec = codec->spec; + spec->shutup = alc_no_shutup; + codec->power_filter = alc_power_filter_xps13; + } +} + static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, const struct hda_fixup *fix, int action) { @@ -5068,6 +5091,7 @@ enum { ALC662_FIXUP_BASS_1A_CHMAP, ALC668_FIXUP_AUTO_MUTE, ALC668_FIXUP_DELL_DISABLE_AAMIX, + ALC668_FIXUP_DELL_XPS13, }; static const struct hda_fixup alc662_fixups[] = { @@ -5228,6 +5252,12 @@ static const struct hda_fixup alc662_fixups[] = { .type = HDA_FIXUP_FUNC, .v.func = alc_fixup_inv_dmic_0x12, }, + [ALC668_FIXUP_DELL_XPS13] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc_fixup_dell_xps13, + .chained = true, + .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX + }, [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { .type = HDA_FIXUP_FUNC, .v.func = alc_fixup_disable_aamix, @@ -5285,7 +5315,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), - SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_DISABLE_AAMIX), + SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), SND_PCI_QUIRK(0x1028, 0x0623, "Dell", ALC668_FIXUP_AUTO_MUTE), SND_PCI_QUIRK(0x1028, 0x0624, "Dell", ALC668_FIXUP_AUTO_MUTE), SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),