From patchwork Thu Aug 7 16:35:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriele Mazzotta X-Patchwork-Id: 4691981 X-Patchwork-Delegate: tiwai@suse.de 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CB9F7C0338 for ; Thu, 7 Aug 2014 16:36:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 006F72018A for ; Thu, 7 Aug 2014 16:36:27 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9FC6F2017D for ; Thu, 7 Aug 2014 16:36:25 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 314A12651D8; Thu, 7 Aug 2014 18:36:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org 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 0188C2651FF; Thu, 7 Aug 2014 18:36:09 +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 54E13265294; Thu, 7 Aug 2014 18:36:08 +0200 (CEST) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by alsa0.perex.cz (Postfix) with ESMTP id 4CDC2265139 for ; Thu, 7 Aug 2014 18:36:00 +0200 (CEST) Received: by mail-wi0-f172.google.com with SMTP id n3so11069306wiv.5 for ; Thu, 07 Aug 2014 09:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-transfer-encoding:content-type; bh=ujbYPKAinHYA9qg4UfDQV5tyWB8NKB/aaA8w51WYg+M=; b=dliCrdDHctiRtOcaajxOrSnkzxRSEPZoq1i/i2fPR7uqjCtWm6x4dwYBDwnO8DJWgB 7r+blWUXN7KBhc1ITIaA8GHenayFdo/QbPVirOxwJqYjc8f6Z0Q5GtUKLZtmFS0tjnF7 /+qw+K72dc09ME5r3LrlOutL0lhCG6mmkTFPyrUgR364WyV3jXZMby8I5+nYSzvqIaCF FSo53ebEWMYKKZGcPguScIGW7lvxcdS2bNL5t5ZirZO//1EQR1O7HS3JHJmxDW1/II4P eqO6kdNBErMVK6YNcxTQwQYMnL32RxFJfJ2/llxTOzkplG3L55GFw28ZiqBBJ2q/Z65z 1LxA== X-Received: by 10.194.222.230 with SMTP id qp6mr25870768wjc.23.1407429359911; Thu, 07 Aug 2014 09:35:59 -0700 (PDT) Received: from xps13.localnet (2-235-140-64.ip228.fastwebnet.it. [2.235.140.64]) by mx.google.com with ESMTPSA id 10sm10989783wjr.22.2014.08.07.09.35.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Aug 2014 09:35:58 -0700 (PDT) From: Gabriele Mazzotta To: alsa-devel@alsa-project.org Date: Thu, 07 Aug 2014 18:35:39 +0200 Message-ID: <20698834.dnBpTPPJ84@xps13> User-Agent: KMail/4.13.3 (Linux/3.16.0+; KDE/4.13.3; x86_64; ; ) MIME-Version: 1.0 Subject: [alsa-devel] [PATCH] ALSA: hda - More pop noise fixes for Dell XPS 13 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 On init, mic-in is always set as input source, indipendently on what is plugged in. Since setting/unsetting mic-in as input source causes a pop noise, make sure the internal microphone is selected as input source on boot. On shutdown, make sure the codec is not suspended as that would cause a pop noise. Signed-off-by: Gabriele Mazzotta --- sound/pci/hda/hda_codec.c | 2 ++ sound/pci/hda/hda_codec.h | 1 + sound/pci/hda/patch_realtek.c | 12 ++++++++++++ 3 files changed, 15 insertions(+) diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 4c20277..92d8292 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -5348,6 +5348,8 @@ void snd_hda_bus_reboot_notify(struct hda_bus *bus) if (!bus) return; list_for_each_entry(codec, &bus->codec_list, list) { + if (codec->resume_at_reboot) + hda_call_codec_resume(codec); if (hda_codec_is_power_on(codec) && codec->patch_ops.reboot_notify) codec->patch_ops.reboot_notify(codec); diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 5825aa1..5c3c66e 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h @@ -366,6 +366,7 @@ struct hda_codec { unsigned int cached_write:1; /* write only to caches */ unsigned int dp_mst:1; /* support DP1.2 Multi-stream transport */ unsigned int dump_coef:1; /* dump processing coefs in codec proc file */ + unsigned int resume_at_reboot:1; /* resume codec at reboot */ #ifdef CONFIG_PM unsigned int power_on :1; /* current (global) power-state */ unsigned int d3_stop_clk:1; /* support D3 operation without BCLK */ diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index b60824e..defaa2a 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -4018,8 +4018,20 @@ static void alc_fixup_dell_xps13(struct hda_codec *codec, { if (action == HDA_FIXUP_ACT_PROBE) { struct alc_spec *spec = codec->spec; + struct hda_input_mux *imux = &spec->gen.input_mux; + int i; + spec->shutup = alc_no_shutup; codec->power_filter = alc_power_filter_xps13; + codec->resume_at_reboot = 1; + + /* Make the internal mic the default input source. */ + for (i = 0; i < imux->num_items; i++) { + if (spec->gen.imux_pins[i] == 0x12) { + spec->gen.cur_mux[0] = i; + break; + } + } } }