All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabriele Mazzotta <gabriele.mzt@gmail.com>
To: alsa-devel@alsa-project.org
Subject: [PATCH] ALSA: hda - More pop noise fixes for Dell XPS 13 9333
Date: Thu, 07 Aug 2014 18:35:39 +0200	[thread overview]
Message-ID: <20698834.dnBpTPPJ84@xps13> (raw)

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 <gabriele.mzt@gmail.com>
---
 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;
+			}
+		}
 	}
 }
 
-- 
2.1.0.rc1

             reply	other threads:[~2014-08-07 16:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-07 16:35 Gabriele Mazzotta [this message]
2014-08-08  6:11 ` [PATCH] ALSA: hda - More pop noise fixes for Dell XPS 13 9333 Takashi Iwai
2014-08-08  8:49   ` Gabriele Mazzotta
2014-08-08 10:13     ` Takashi Iwai
2014-08-08 15:01       ` Gabriele Mazzotta
2014-08-08 15:06         ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20698834.dnBpTPPJ84@xps13 \
    --to=gabriele.mzt@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.