ALSA: hda/realtek - Avoid superfluous COEF EAPD setups
authorTakashi Iwai <tiwai@suse.de>
Fri, 10 May 2019 09:01:43 +0000 (11:01 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 10 May 2019 09:01:43 +0000 (11:01 +0200)
commitc9af753f26bdf80291eb2c2279b9de1989fbc591
tree71aa2bf5608c2b30c3623064707c6df61a17888a
parentdad3197da7a3817f27bb24f7fd3c135ffa707202
ALSA: hda/realtek - Avoid superfluous COEF EAPD setups

Realtek codec driver applied the COEF setups to change the EAPD
control to the default mode (i.e. control by EPAD verbs) at the init
callback.  It works, but this is too excessive at the same time, since
it's called at each runtime PM resume.  That is, the initialization
should be done only once after the probe.  One may think that moving
this to the probe should be OK, but no -- there is a catch; when a
system resumes from S4 (hibernation), we need to re-initialize this
again manually, because it's out of regcache restoration.

This patch addresses the issue by introducing alc_pre_init() function
that performs such a task.  This is called from each codec probe
function, and it's called from the resume callback conditionally only
from S4 resume.

Reported-and-tested-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c