From: Kailang <kailang@realtek.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: " \(alsa-devel@alsa-project.org\)" <alsa-devel@alsa-project.org>
Subject: RE: Turn on power early to avoid something
Date: Tue, 3 Jan 2023 06:51:34 +0000 [thread overview]
Message-ID: <e35d8f4fa18f4448a2315cc7d4a3715f@realtek.com> (raw)
In-Reply-To: <87cz81xnen.wl-tiwai@suse.de>
[-- Attachment #1: Type: text/plain, Size: 1696 bytes --]
Add more description.
> -----Original Message-----
> From: Takashi Iwai <tiwai@suse.de>
> Sent: Friday, December 30, 2022 5:16 PM
> To: Kailang <kailang@realtek.com>
> Cc: (alsa-devel@alsa-project.org) <alsa-devel@alsa-project.org>
> Subject: Re: Turn on power early to avoid something
>
> On Fri, 30 Dec 2022 09:14:16 +0100,
> Kailang wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Takashi Iwai <tiwai@suse.de>
> > > Sent: Friday, December 30, 2022 4:05 PM
> > > To: Kailang <kailang@realtek.com>
> > > Cc: (alsa-devel@alsa-project.org) <alsa-devel@alsa-project.org>
> > > Subject: Re: Turn on power early to avoid something
> > >
> > > On Fri, 30 Dec 2022 08:54:01 +0100,
> > > Kailang wrote:
> > > >
> > > > Hi Takashi,
> > > >
> > > > It maybe can avoid something for early power up.
> > > >
> > > > Many Thanks.
> > > > Kailang.
> > >
> > > Hmm, what is "something"? The description is way too ambiguous to
> > > judge whether the change is OK or not, unfortunately.
> > > Could you elaborate what exactly the change will fix?
> > >
> > > Also, when you submit a patch from another person, please put your
> > > own Signed-off-by line. It's a legal requirement.
> > yangyuchi66@gmail.com was my personal account.
> > Could I use this account?
>
> Ah OK, then it's fine.
>
> > Or I need use this account to mail patch to you.
>
> It's not necessary, the sign-off is fine as long as it matches with the From
> address in the patch and it's yourself.
>
> But we still need a better description of the patch text.
>
>
> thanks,
>
> Takashi
>
> ------Please consider the environment before printing this e-mail.
[-- Attachment #2: 0000-turn-on-power-early.patch --]
[-- Type: application/octet-stream, Size: 2516 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 wrong state for power relation register.
This can earlier update JD state when resume back.
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,
next prev parent reply other threads:[~2023-01-03 6:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2023-01-03 15:13 ` Takashi Iwai
2022-12-30 8:48 ` Kailang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e35d8f4fa18f4448a2315cc7d4a3715f@realtek.com \
--to=kailang@realtek.com \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.