Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-05-19 09:48:33 +0200
committerTakashi Iwai <tiwai@suse.de>2019-05-19 09:48:39 +0200
commit4af2dd36b23b7469f4d96addffa7a4808f3749dc (patch)
tree8f9abe00b80458643595689c9cbe6dc1d5d588e6
parent3f5e1c0907771230b0016e3787148a1acc45c34a (diff)
ALSA: hda/realtek - Fixup headphone noise via runtime suspend
(bsc#1051510).
-rw-r--r--patches.drivers/ALSA-hda-realtek-Fixup-headphone-noise-via-runtime-s.patch113
-rw-r--r--series.conf1
2 files changed, 114 insertions, 0 deletions
diff --git a/patches.drivers/ALSA-hda-realtek-Fixup-headphone-noise-via-runtime-s.patch b/patches.drivers/ALSA-hda-realtek-Fixup-headphone-noise-via-runtime-s.patch
new file mode 100644
index 0000000000..8bb6f289b5
--- /dev/null
+++ b/patches.drivers/ALSA-hda-realtek-Fixup-headphone-noise-via-runtime-s.patch
@@ -0,0 +1,113 @@
+From dad3197da7a3817f27bb24f7fd3c135ffa707202 Mon Sep 17 00:00:00 2001
+From: Kailang Yang <kailang@realtek.com>
+Date: Fri, 10 May 2019 16:28:57 +0800
+Subject: [PATCH] ALSA: hda/realtek - Fixup headphone noise via runtime suspend
+Git-commit: dad3197da7a3817f27bb24f7fd3c135ffa707202
+Patch-mainline: v5.2-rc1
+References: bsc#1051510
+
+Dell platform with ALC298.
+system enter to runtime suspend. Headphone had noise.
+Let Headset Mic not shutup will solve this issue.
+
+[ Fixed minor coding style issues by tiwai ]
+
+Signed-off-by: Kailang Yang <kailang@realtek.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ sound/pci/hda/patch_realtek.c | 59 +++++++++++++++++++++++++------------------
+ 1 file changed, 35 insertions(+), 24 deletions(-)
+
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
+index c53ca589c930..c39f48e02ee9 100644
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -478,12 +478,45 @@ static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
+ set_eapd(codec, *p, on);
+ }
+
++static int find_ext_mic_pin(struct hda_codec *codec);
++
++static void alc_headset_mic_no_shutup(struct hda_codec *codec)
++{
++ const struct hda_pincfg *pin;
++ int mic_pin = find_ext_mic_pin(codec);
++ int i;
++
++ /* don't shut up pins when unloading the driver; otherwise it breaks
++ * the default pin setup at the next load of the driver
++ */
++ if (codec->bus->shutdown)
++ return;
++
++ snd_array_for_each(&codec->init_pins, i, pin) {
++ /* use read here for syncing after issuing each verb */
++ if (pin->nid != mic_pin)
++ snd_hda_codec_read(codec, pin->nid, 0,
++ AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
++ }
++
++ codec->pins_shutup = 1;
++}
++
+ static void alc_shutup_pins(struct hda_codec *codec)
+ {
+ struct alc_spec *spec = codec->spec;
+
+- if (!spec->no_shutup_pins)
+- snd_hda_shutup_pins(codec);
++ switch (codec->core.vendor_id) {
++ case 0x10ec0286:
++ case 0x10ec0288:
++ case 0x10ec0298:
++ alc_headset_mic_no_shutup(codec);
++ break;
++ default:
++ if (!spec->no_shutup_pins)
++ snd_hda_shutup_pins(codec);
++ break;
++ }
+ }
+
+ /* generic shutup callback;
+@@ -2924,27 +2957,6 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
+ return alc_parse_auto_config(codec, alc269_ignore, ssids);
+ }
+
+-static int find_ext_mic_pin(struct hda_codec *codec);
+-
+-static void alc286_shutup(struct hda_codec *codec)
+-{
+- const struct hda_pincfg *pin;
+- int i;
+- int mic_pin = find_ext_mic_pin(codec);
+- /* don't shut up pins when unloading the driver; otherwise it breaks
+- * the default pin setup at the next load of the driver
+- */
+- if (codec->bus->shutdown)
+- return;
+- snd_array_for_each(&codec->init_pins, i, pin) {
+- /* use read here for syncing after issuing each verb */
+- if (pin->nid != mic_pin)
+- snd_hda_codec_read(codec, pin->nid, 0,
+- AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
+- }
+- codec->pins_shutup = 1;
+-}
+-
+ static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
+ {
+ alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
+@@ -7736,7 +7748,6 @@ static int patch_alc269(struct hda_codec *codec)
+ case 0x10ec0286:
+ case 0x10ec0288:
+ spec->codec_variant = ALC269_TYPE_ALC286;
+- spec->shutup = alc286_shutup;
+ break;
+ case 0x10ec0298:
+ spec->codec_variant = ALC269_TYPE_ALC298;
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 3e65102ec3..ddf56c32c2 100644
--- a/series.conf
+++ b/series.conf
@@ -22045,6 +22045,7 @@
patches.drivers/media-atmel-atmel-isc-fix-INIT_WORK-misplacement.patch
patches.drivers/media-omap_vout-potential-buffer-overflow-in-vidioc_.patch
patches.drivers/media-davinci-vpbe-array-underflow-in-vpbe_enum_outp.patch
+ patches.drivers/ALSA-hda-realtek-Fixup-headphone-noise-via-runtime-s.patch
# dhowells/linux-fs keys-uefi
patches.suse/0001-KEYS-Allow-unrestricted-boot-time-addition-of-keys-t.patch