All of lore.kernel.org
 help / color / mirror / Atom feed
* Turn on power early to avoid something
@ 2022-12-30  7:54 Kailang
  2022-12-30  8:04 ` Takashi Iwai
  0 siblings, 1 reply; 7+ messages in thread
From: Kailang @ 2022-12-30  7:54 UTC (permalink / raw)
  To: Takashi Iwai (tiwai@suse.de); +Cc:  (alsa-devel@alsa-project.org)

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

Hi Takashi,

It maybe can avoid something for early power up.

Many Thanks.
Kailang.

[-- Attachment #2: 0000-turn-on-power-early.patch --]
[-- Type: application/octet-stream, Size: 2435 bytes --]

From c26a3e5c625b3d6af8bb90b450b817ba55d2cc11 Mon Sep 17 00:00:00 2001
From: Yuchi Yang <yangyuchi66@gmail.com>
Date: Fri, 30 Dec 2022 15:22:25 +0800
Subject: [PATCH]ALSA: hda/realtek - Turn on power early

Turn on power early to avoid something.

Signed-off-by: Yuchi Yang <yangyuchi66@gmail.com>

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 8a3e2fe42106..1184b7b53eec 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3463,6 +3463,15 @@ static void alc256_init(struct hda_codec *codec)
 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
 	bool hp_pin_sense;
 
+	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);
+	}
+
 	if (!hp_pin)
 		hp_pin = 0x21;
 
@@ -3474,14 +3483,6 @@ 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);
@@ -3612,6 +3613,13 @@ static void alc225_init(struct hda_codec *codec)
 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
 	bool hp1_pin_sense, hp2_pin_sense;
 
+	if (spec->ultra_low_power) {
+		alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
+		alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
+		alc_update_coef_idx(codec, 0x33, 1<<11, 0);
+		msleep(30);
+	}
+
 	if (spec->codec_variant != ALC269_TYPE_ALC287)
 		/* required only at boot or S3 and S4 resume time */
 		if (!spec->done_hp_init ||
@@ -3632,12 +3640,6 @@ static void alc225_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, 0x08, 0x0f << 2, 3<<2);
-		alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
-		alc_update_coef_idx(codec, 0x33, 1<<11, 0);
-		msleep(30);
-	}
 
 	if (hp1_pin_sense || spec->ultra_low_power)
 		snd_hda_codec_write(codec, hp_pin, 0,

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

end of thread, other threads:[~2023-01-03 15:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-30  7:54 Turn on power early to avoid something Kailang
2022-12-30  8:04 ` Takashi Iwai
2022-12-30  8:14   ` Kailang
2022-12-30  9:15     ` Takashi Iwai
2023-01-03  6:51       ` Kailang
2023-01-03 15:13         ` Takashi Iwai
2022-12-30  8:48   ` Kailang

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.