Skip to content

Commit f6b28e4

Browse files
David Henningssontiwai
authored andcommitted
ALSA: hda - Shutdown CX20722 on reboot/free to avoid spurious noises
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> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 9544f8b commit f6b28e4

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

sound/pci/hda/patch_conexant.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,33 @@ static int cx_auto_init(struct hda_codec *codec)
200200
return 0;
201201
}
202202

203-
#define cx_auto_free snd_hda_gen_free
203+
static void cx_auto_reboot_notify(struct hda_codec *codec)
204+
{
205+
struct conexant_spec *spec = codec->spec;
206+
207+
if (codec->core.vendor_id != 0x14f150f2)
208+
return;
209+
210+
/* Turn the CX20722 codec into D3 to avoid spurious noises
211+
from the internal speaker during (and after) reboot */
212+
cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
213+
214+
snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3);
215+
snd_hda_codec_write(codec, codec->core.afg, 0,
216+
AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
217+
}
218+
219+
static void cx_auto_free(struct hda_codec *codec)
220+
{
221+
cx_auto_reboot_notify(codec);
222+
snd_hda_gen_free(codec);
223+
}
204224

205225
static const struct hda_codec_ops cx_auto_patch_ops = {
206226
.build_controls = cx_auto_build_controls,
207227
.build_pcms = snd_hda_gen_build_pcms,
208228
.init = cx_auto_init,
229+
.reboot_notify = cx_auto_reboot_notify,
209230
.free = cx_auto_free,
210231
.unsol_event = snd_hda_jack_unsol_event,
211232
#ifdef CONFIG_PM

0 commit comments

Comments
 (0)