Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Set eapd to follow stream on or off
@ 2014-05-20  7:15 Kailang
  2014-05-20  7:46 ` Takashi Iwai
  0 siblings, 1 reply; 19+ messages in thread
From: Kailang @ 2014-05-20  7:15 UTC (permalink / raw)
  To: Kailang, Takashi Iwai; +Cc: ALSA Development Mailing List

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

Hi Takashi,

HP machine had pop noise via speaker.
If EAPD on or off, speaker will have pop noise.
So, they want to set eapd to follow with stream on or off.

Many Thanks.

BR,
Kailang

[-- Attachment #2: 0000-set-eapd-follow-stream-on-off.patch --]
[-- Type: application/octet-stream, Size: 3304 bytes --]

>From 8af68c6454203361cce2128df2144afe88e5842a Mon Sep 17 00:00:00 2001
From: Kailang Yang <kailang@realtek.com>
Date: Tue, 20 May 2014 15:00:19 +0800
Subject: [PATCH] ALSA: hda/realtek - Set EAPD to follow stream on or off

HP machine has pop noise via speaker.
Set EAPD on when system open stream.
Set EAPD off when system close stream.

Signed-off-by: Kailang Yang <kailang@realtek.com>

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 35acbd0..67dd06c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4175,6 +4175,37 @@ static void alc290_fixup_mono_speakers(struct hda_codec *codec,
 	}
 }
 
+/*
+ * ALC290 PCM hooks
+ */
+static void ALC290_playback_pcm_hook(struct hda_pcm_stream *hinfo,
+				   struct hda_codec *codec,
+				   struct snd_pcm_substream *substream,
+				   int action)
+{
+	struct sigmatel_spec *spec = codec->spec;
+
+	switch (action) {
+	case HDA_GEN_PCM_ACT_OPEN:
+		set_eapd(codec, 0x14, true);
+		break;
+	case HDA_GEN_PCM_ACT_CLOSE:
+		set_eapd(codec, 0x14, false);
+		break;
+	}
+}
+
+static void alc290_fixup_pop_noise(struct hda_codec *codec,
+				       const struct hda_fixup *fix, int action)
+{
+	struct alc_spec *spec = codec->spec;
+
+	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
+		set_eapd(codec, 0x14, false);
+		spec->gen.pcm_playback_hook = ALC290_playback_pcm_hook;
+	}
+}
+
 /* for hda_fixup_thinkpad_acpi() */
 #include "thinkpad_helper.c"
 
@@ -4237,6 +4268,7 @@ enum {
 	ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
 	ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
 	ALC292_FIXUP_TPT440_DOCK,
+	ALC290_FIXUP_HP_DEPOP,
 };
 
 static const struct hda_fixup alc269_fixups[] = {
@@ -4650,6 +4682,12 @@ static const struct hda_fixup alc269_fixups[] = {
 		.chained = true,
 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
 	},
+	[ALC290_FIXUP_HP_DEPOP] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc290_fixup_pop_noise,
+		.chained = true,
+		.chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
+	},
 };
 
 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -4772,12 +4810,14 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x103c, 0x2280, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x2281, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x2289, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
+	SND_PCI_QUIRK(0x103c, 0x2289, "HP", ALC290_FIXUP_HP_DEPOP),
 	SND_PCI_QUIRK(0x103c, 0x228a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x228c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
+	SND_PCI_QUIRK(0x103c, 0x228c, "HP", ALC290_FIXUP_HP_DEPOP),
 	SND_PCI_QUIRK(0x103c, 0x228d, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
+	SND_PCI_QUIRK(0x103c, 0x228f, "HP", ALC290_FIXUP_HP_DEPOP),
+	SND_PCI_QUIRK(0x103c, 0x22a8, "HP", ALC290_FIXUP_HP_DEPOP),
 	SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x22c6, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2014-05-22  7:26 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-20  7:15 Set eapd to follow stream on or off Kailang
2014-05-20  7:46 ` Takashi Iwai
2014-05-20  8:52   ` Kailang
2014-05-20  9:03     ` Takashi Iwai
2014-05-20  9:20       ` Kailang
2014-05-20  9:35         ` Takashi Iwai
2014-05-20 10:05           ` Kailang
2014-05-20 10:10             ` Takashi Iwai
2014-05-21  5:58               ` Kailang
2014-05-21  6:07                 ` Takashi Iwai
2014-05-21  6:28                   ` Kailang
2014-05-21  9:10                     ` Takashi Iwai
2014-05-21  9:24                       ` Kailang
2014-05-21  9:50                         ` Takashi Iwai
2014-05-22  6:26                           ` Kailang
2014-05-22  6:59                             ` Takashi Iwai
2014-05-22  7:26                               ` Kailang
2014-05-21  8:55                   ` Add support headset mode for alc233 Kailang
2014-05-21  9:13                     ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox