Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-12 22:18:26 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-12 22:21:16 +0100
commit8afdb154f56f1bda71c3e1c7c9844f674dfab8be (patch)
tree28f6d11ad1d5cc0653027f7f274efe496e2fefb0
parent85e1096205e3c7b4545560e28f1dd6ea14f71cc2 (diff)
ALSA: hda/realtek - Fix lose hp_pins for disable auto mute
-rw-r--r--patches.kernel.org/4.20.8-308-ALSA-hda-realtek-Fix-lose-hp_pins-for-disable-.patch140
-rw-r--r--series.conf1
2 files changed, 141 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.8-308-ALSA-hda-realtek-Fix-lose-hp_pins-for-disable-.patch b/patches.kernel.org/4.20.8-308-ALSA-hda-realtek-Fix-lose-hp_pins-for-disable-.patch
new file mode 100644
index 0000000000..610daea378
--- /dev/null
+++ b/patches.kernel.org/4.20.8-308-ALSA-hda-realtek-Fix-lose-hp_pins-for-disable-.patch
@@ -0,0 +1,140 @@
+From: Kailang Yang <kailang@realtek.com>
+Date: Fri, 1 Feb 2019 16:51:10 +0800
+Subject: [PATCH] ALSA: hda/realtek - Fix lose hp_pins for disable auto mute
+References: bnc#1012628
+Patch-mainline: 4.20.8
+Git-commit: d561aa0a70bb2e1dd85fde98b6a5561e4175ac3e
+
+commit d561aa0a70bb2e1dd85fde98b6a5561e4175ac3e upstream.
+
+When auto_mute = no or spec->suppress_auto_mute = 1, cfg->hp_pins will
+lose value.
+
+Add this patch to find hp_pins value.
+I add fixed for ALC282 ALC225 ALC256 ALC294 and alc_default_init()
+alc_default_shutup().
+
+Signed-off-by: Kailang Yang <kailang@realtek.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ sound/pci/hda/patch_realtek.c | 45 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 45 insertions(+)
+
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
+index 0bfd78b7e0ca..ef6ea87728a0 100644
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -2963,6 +2963,11 @@ static void alc282_init(struct hda_codec *codec)
+ bool hp_pin_sense;
+ int coef78;
+
++ if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
++ if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
++ hp_pin = spec->gen.autocfg.line_out_pins[0];
++ }
++
+ alc282_restore_default_value(codec);
+
+ if (!hp_pin)
+@@ -3000,6 +3005,11 @@ static void alc282_shutup(struct hda_codec *codec)
+ bool hp_pin_sense;
+ int coef78;
+
++ if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
++ if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
++ hp_pin = spec->gen.autocfg.line_out_pins[0];
++ }
++
+ if (!hp_pin) {
+ alc269_shutup(codec);
+ return;
+@@ -3159,6 +3169,11 @@ static void alc256_init(struct hda_codec *codec)
+ hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
+ bool hp_pin_sense;
+
++ if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
++ if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
++ hp_pin = spec->gen.autocfg.line_out_pins[0];
++ }
++
+ if (!hp_pin)
+ return;
+
+@@ -3195,6 +3210,11 @@ static void alc256_shutup(struct hda_codec *codec)
+ hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
+ bool hp_pin_sense;
+
++ if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
++ if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
++ hp_pin = spec->gen.autocfg.line_out_pins[0];
++ }
++
+ if (!hp_pin) {
+ alc269_shutup(codec);
+ return;
+@@ -3231,6 +3251,11 @@ static void alc225_init(struct hda_codec *codec)
+ hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
+ bool hp1_pin_sense, hp2_pin_sense;
+
++ if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
++ if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
++ hp_pin = spec->gen.autocfg.line_out_pins[0];
++ }
++
+ if (!hp_pin)
+ return;
+
+@@ -3274,6 +3299,11 @@ static void alc225_shutup(struct hda_codec *codec)
+ hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
+ bool hp1_pin_sense, hp2_pin_sense;
+
++ if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
++ if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
++ hp_pin = spec->gen.autocfg.line_out_pins[0];
++ }
++
+ if (!hp_pin) {
+ alc269_shutup(codec);
+ return;
+@@ -3318,6 +3348,11 @@ static void alc_default_init(struct hda_codec *codec)
+ hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
+ bool hp_pin_sense;
+
++ if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
++ if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
++ hp_pin = spec->gen.autocfg.line_out_pins[0];
++ }
++
+ if (!hp_pin)
+ return;
+
+@@ -3347,6 +3382,11 @@ static void alc_default_shutup(struct hda_codec *codec)
+ hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
+ bool hp_pin_sense;
+
++ if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
++ if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
++ hp_pin = spec->gen.autocfg.line_out_pins[0];
++ }
++
+ if (!hp_pin) {
+ alc269_shutup(codec);
+ return;
+@@ -3379,6 +3419,11 @@ static void alc294_hp_init(struct hda_codec *codec)
+ hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
+ int i, val;
+
++ if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
++ if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
++ hp_pin = spec->gen.autocfg.line_out_pins[0];
++ }
++
+ if (!hp_pin)
+ return;
+
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index a6b9d7617f..72e498f889 100644
--- a/series.conf
+++ b/series.conf
@@ -1044,6 +1044,7 @@
patches.kernel.org/4.20.8-305-ALSA-compress-Fix-stop-handling-on-compressed-.patch
patches.kernel.org/4.20.8-306-ALSA-usb-audio-Add-support-for-new-T-A-USB-DAC.patch
patches.kernel.org/4.20.8-307-ALSA-hda-Serialize-codec-registrations.patch
+ patches.kernel.org/4.20.8-308-ALSA-hda-realtek-Fix-lose-hp_pins-for-disable-.patch
########################################################
# Build fixes that apply to the vanilla kernel too.