Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-05-13 10:29:25 +0200
committerTakashi Iwai <tiwai@suse.de>2019-05-15 11:46:05 +0200
commit419c4a2d8560b856c64e2a2b035e5596050d402a (patch)
tree74b062339a2688ca49ae882ca85c80bac8e3f192
parentc8622f4894c0a64ffcd09783f8f7f594945e0725 (diff)
ALSA: hda/realtek - Support low power consumption for ALC256
(bsc#1051510).
-rw-r--r--patches.drivers/ALSA-hda-realtek-Support-low-power-consumption-ALC256.patch116
-rw-r--r--series.conf1
2 files changed, 117 insertions, 0 deletions
diff --git a/patches.drivers/ALSA-hda-realtek-Support-low-power-consumption-ALC256.patch b/patches.drivers/ALSA-hda-realtek-Support-low-power-consumption-ALC256.patch
new file mode 100644
index 0000000000..bc4ae08ccc
--- /dev/null
+++ b/patches.drivers/ALSA-hda-realtek-Support-low-power-consumption-ALC256.patch
@@ -0,0 +1,116 @@
+From 6447c962bc47a58c5ddb27d1c7c7dc45ca90bad0 Mon Sep 17 00:00:00 2001
+From: Kailang Yang <kailang@realtek.com>
+Date: Wed, 8 May 2019 16:27:03 +0800
+Subject: [PATCH] ALSA: hda/realtek - Support low power consumption for ALC256
+Git-commit: 6447c962bc47a58c5ddb27d1c7c7dc45ca90bad0
+Patch-mainline: v5.2-rc1
+References: bsc#1051510
+
+Remove hp_pin = 0 return. Add the default pin 0x21 as headphone.
+Supported low power consumption, it must do depop procedure when
+headset jack was plugged or unplugged.
+So, alc256_init() and alc256_shutup() must run delay when headset jack
+was plugged or unplugged.
+If depop procedure not run with delay, it will have a chance to let
+power consumption raise high.
+
+[ NOTE: this is a quite quite similar change for ALC295 by commit
+ d3ba58bb8959 ("ALSA: hda/realtek - Support low power consumption for
+ ALC295"), but applied to ALC256 codec instead -- tiwai ]
+
+Fixes: 8983eb602af5 ("ALSA: hda/realtek - Move to ACT_INIT state")
+Signed-off-by: Kailang Yang <kailang@realtek.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ sound/pci/hda/patch_realtek.c | 33 ++++++++++++++++++++++++---------
+ 1 file changed, 24 insertions(+), 9 deletions(-)
+
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
+index dacccacb5fe0..c53ca589c930 100644
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -3197,7 +3197,7 @@ static void alc256_init(struct hda_codec *codec)
+ bool hp_pin_sense;
+
+ if (!hp_pin)
+- return;
++ hp_pin = 0x21;
+
+ msleep(30);
+
+@@ -3207,17 +3207,25 @@ static void alc256_init(struct hda_codec *codec)
+ msleep(2);
+
+ alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
++ if (spec->ultra_low_power) {
++ alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
++ alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
++ alc_update_coef_idx(codec, 0x08, 7<<4, 0);
++ alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
++ alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
++ msleep(30);
++ }
+
+ snd_hda_codec_write(codec, hp_pin, 0,
+ AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
+
+- if (hp_pin_sense)
++ if (hp_pin_sense || spec->ultra_low_power)
+ msleep(85);
+
+ snd_hda_codec_write(codec, hp_pin, 0,
+ AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
+
+- if (hp_pin_sense)
++ if (hp_pin_sense || spec->ultra_low_power)
+ msleep(100);
+
+ alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
+@@ -3232,10 +3240,8 @@ static void alc256_shutup(struct hda_codec *codec)
+ hda_nid_t hp_pin = alc_get_hp_pin(spec);
+ bool hp_pin_sense;
+
+- if (!hp_pin) {
+- alc269_shutup(codec);
+- return;
+- }
++ if (!hp_pin)
++ hp_pin = 0x21;
+
+ hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
+
+@@ -3245,7 +3251,7 @@ static void alc256_shutup(struct hda_codec *codec)
+ snd_hda_codec_write(codec, hp_pin, 0,
+ AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
+
+- if (hp_pin_sense)
++ if (hp_pin_sense || spec->ultra_low_power)
+ msleep(85);
+
+ /* 3k pull low control for Headset jack. */
+@@ -3256,11 +3262,20 @@ static void alc256_shutup(struct hda_codec *codec)
+ snd_hda_codec_write(codec, hp_pin, 0,
+ AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
+
+- if (hp_pin_sense)
++ if (hp_pin_sense || spec->ultra_low_power)
+ msleep(100);
+
+ alc_auto_setup_eapd(codec, false);
+ alc_shutup_pins(codec);
++ if (spec->ultra_low_power) {
++ msleep(50);
++ alc_update_coef_idx(codec, 0x03, 1<<1, 0);
++ alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
++ alc_update_coef_idx(codec, 0x08, 3<<2, 0);
++ alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
++ alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
++ msleep(30);
++ }
+ }
+
+ static void alc225_init(struct hda_codec *codec)
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index f6b636c498..8697bf6d26 100644
--- a/series.conf
+++ b/series.conf
@@ -45662,6 +45662,7 @@
patches.drivers/tty-pty-Fix-race-condition-between-release_one_tty-a.patch
patches.drivers/ipmi-ssif-compare-block-number-correctly-for-multi-p.patch
patches.drivers/ALSA-hda-realtek-Support-low-power-consumption-for-A.patch
+ patches.drivers/ALSA-hda-realtek-Support-low-power-consumption-ALC256.patch
# davem/net-next
patches.drivers/ibmvnic-Report-actual-backing-device-speed-and-duple.patch