diff options
author | Lu, Han <han.lu@intel.com> | 2015-05-05 03:05:48 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-05-05 14:44:36 +0200 |
commit | 0a67352153505f3ef2cdd155bfcbf7e43186bd82 (patch) | |
tree | 0c06a05b42b20b4c92537e255d0ff1dc849ccb2e /sound/pci/hda/hda_i915.c | |
parent | drm/i915/audio: add codec wakeup override enabled/disable callback (diff) | |
download | linux-0a67352153505f3ef2cdd155bfcbf7e43186bd82.tar.xz linux-0a67352153505f3ef2cdd155bfcbf7e43186bd82.zip |
ALSA: hda - reset display codec when power on
In SKL, HDMI/DP codec and PCH HD Audio Controller are in different power wells,
so it's necessary to reset display audio codecs when power well on, otherwise
display audio codecs will disappear when resume from low power state.
Reset steps when power on:
enable codec wakeup -> azx_init_chip() -> disable codec wakeup
The callback for codec wakeup enable/disable is in drivers/gpu/drm/i915/.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_i915.c')
-rw-r--r-- | sound/pci/hda/hda_i915.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_i915.c b/sound/pci/hda/hda_i915.c index d9d079330e55..852170258266 100644 --- a/sound/pci/hda/hda_i915.c +++ b/sound/pci/hda/hda_i915.c @@ -33,6 +33,27 @@ #define AZX_REG_EM4 0x100c #define AZX_REG_EM5 0x1010 +int hda_set_codec_wakeup(struct hda_intel *hda, bool enable) +{ + struct i915_audio_component *acomp = &hda->audio_component; + + if (!acomp->ops) + return -ENODEV; + + if (!acomp->ops->codec_wake_override) { + dev_warn(&hda->chip.pci->dev, + "Invalid codec wake callback\n"); + return 0; + } + + dev_dbg(&hda->chip.pci->dev, "%s codec wakeup\n", + enable ? "enable" : "disable"); + + acomp->ops->codec_wake_override(acomp->dev, enable); + + return 0; +} + int hda_display_power(struct hda_intel *hda, bool enable) { struct i915_audio_component *acomp = &hda->audio_component; |