aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/hda/patch_conexant.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@linaro.org>2015-11-04 10:01:20 -0800
committerKevin Hilman <khilman@linaro.org>2015-11-04 10:01:20 -0800
commit49bd04cb11e57c4cd4d2c00feca898537dd6db1f (patch)
tree846c594b2b1d2f203c24ff32569b6c615822a5dc /sound/pci/hda/patch_conexant.c
parent260409578ecbf7ce1725b85f9c082312bff808c0 (diff)
parent12ba397b828b7e7f5d28a73e9a2ee14470b7edc7 (diff)
Merge tag 'v4.1.12-rt12' of git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel into v4.1/topic/rtv4.1/topic/rt
v4.1.12-rt12
Diffstat (limited to 'sound/pci/hda/patch_conexant.c')
-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 78b719b5b34d..06cc9d57ba3d 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