aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2015-08-21 03:42:35 -0400
committerTakashi Iwai <tiwai@suse.de>2015-08-21 04:28:00 -0400
commitf6b28e4ded45bb91bc4cd115d55e35badedfce5f (patch)
treec7204412afc5ac5e269f1b55ae9b4d8fca1c94ca
parent9544f8b6e2ee9ed02d2322ff018837b185f51d45 (diff)
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>
-rw-r--r--sound/pci/hda/patch_conexant.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index f788a91b544a..ca03c40609fc 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)
200 return 0; 200 return 0;
201} 201}
202 202
203#define cx_auto_free snd_hda_gen_free 203static 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
219static void cx_auto_free(struct hda_codec *codec)
220{
221 cx_auto_reboot_notify(codec);
222 snd_hda_gen_free(codec);
223}
204 224
205static const struct hda_codec_ops cx_auto_patch_ops = { 225static const struct hda_codec_ops cx_auto_patch_ops = {
206 .build_controls = cx_auto_build_controls, 226 .build_controls = cx_auto_build_controls,
207 .build_pcms = snd_hda_gen_build_pcms, 227 .build_pcms = snd_hda_gen_build_pcms,
208 .init = cx_auto_init, 228 .init = cx_auto_init,
229 .reboot_notify = cx_auto_reboot_notify,
209 .free = cx_auto_free, 230 .free = cx_auto_free,
210 .unsol_event = snd_hda_jack_unsol_event, 231 .unsol_event = snd_hda_jack_unsol_event,
211#ifdef CONFIG_PM 232#ifdef CONFIG_PM