From: David Henningsson <david.henningsson@canonical.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: 1487345@bugs.launchpad.net, alsa-devel@alsa-project.org
Subject: Re: [PATCH] ALSA: hda - Shutdown CX20722 on reboot/free to avoid spurious noises
Date: Fri, 21 Aug 2015 10:27:23 +0200 [thread overview]
Message-ID: <55D6E0EB.4030605@canonical.com> (raw)
In-Reply-To: <s5ha8tlujwj.wl-tiwai@suse.de>
On 2015-08-21 10:26, Takashi Iwai wrote:
> On Fri, 21 Aug 2015 09:42:35 +0200,
> David Henningsson wrote:
>>
>> On shutdown/reboot of CX20722, first shut down all EAPDs, then
>> shut down the afg node to D3.
>>
>> Failure to do so can lead to spurious noises from the internal speaker
>> directly after reboot (and before the codec is reinitialized again, i e
>> in BIOS setup or GRUB menus).
>>
>> BugLink: https://bugs.launchpad.net/bugs/1487345
>> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
>
> It's worth for stable, right?
Right, just forgot it.
>
>
> Takashi
>
>> ---
>> sound/pci/hda/patch_conexant.c | 23 ++++++++++++++++++++++-
>> 1 file changed, 22 insertions(+), 1 deletion(-)
>>
>> diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
>> index f788a91..ca03c40 100644
>> --- a/sound/pci/hda/patch_conexant.c
>> +++ b/sound/pci/hda/patch_conexant.c
>> @@ -200,12 +200,33 @@ static int cx_auto_init(struct hda_codec *codec)
>> return 0;
>> }
>>
>> -#define cx_auto_free snd_hda_gen_free
>> +static void cx_auto_reboot_notify(struct hda_codec *codec)
>> +{
>> + struct conexant_spec *spec = codec->spec;
>> +
>> + if (codec->core.vendor_id != 0x14f150f2)
>> + return;
>> +
>> + /* Turn the CX20722 codec into D3 to avoid spurious noises
>> + from the internal speaker during (and after) reboot */
>> + cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
>> +
>> + snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3);
>> + snd_hda_codec_write(codec, codec->core.afg, 0,
>> + AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
>> +}
>> +
>> +static void cx_auto_free(struct hda_codec *codec)
>> +{
>> + cx_auto_reboot_notify(codec);
>> + snd_hda_gen_free(codec);
>> +}
>>
>> static const struct hda_codec_ops cx_auto_patch_ops = {
>> .build_controls = cx_auto_build_controls,
>> .build_pcms = snd_hda_gen_build_pcms,
>> .init = cx_auto_init,
>> + .reboot_notify = cx_auto_reboot_notify,
>> .free = cx_auto_free,
>> .unsol_event = snd_hda_jack_unsol_event,
>> #ifdef CONFIG_PM
>> --
>> 1.9.1
>>
>
--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
next prev parent reply other threads:[~2015-08-21 8:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-21 7:42 [PATCH] ALSA: hda - Shutdown CX20722 on reboot/free to avoid spurious noises David Henningsson
2015-08-21 8:26 ` Takashi Iwai
2015-08-21 8:27 ` David Henningsson [this message]
2015-08-21 8:29 ` Takashi Iwai
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=55D6E0EB.4030605@canonical.com \
--to=david.henningsson@canonical.com \
--cc=1487345@bugs.launchpad.net \
--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.