Commit d838a110 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Acquire audio powerwell for HD-Audio registers

On Haswell/Broadwell, the HD-Audio block is inside the HDMI/display
power well and so the sna-hda audio codec acquires the display power
well while it is operational. However, Skylake separates the powerwells
again, but yet we still need the audio powerwell to setup the registers.
(But then the hardware uses those registers even while powered off???)

Acquiring the powerwell around setting the chicken bits when setting up
the audio channel does at least silence the WARNs from touching our
registers whilst unpowered. We silence our own test cases, but maybe
there is a latent bug in using the audio channel?

v2: Grab both rpm wakelock and audio wakelock

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96214
Fixes: 03b135ce "ALSA: hda - remove dependency on i915 power well for SKL")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Libin Yang <libin.yang@intel.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Marius Vlad <marius.c.vlad@intel.com>
Tested-by: default avatarHans de Goede <hdegoede@redhat.com>
Cc: stable@vger.kernel.org
Link: http://patchwork.freedesktop.org/patch/msgid/1470240540-29004-1-git-send-email-chris@chris-wilson.co.ukReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 65fbb4e7
...@@ -600,6 +600,8 @@ static void i915_audio_component_codec_wake_override(struct device *dev, ...@@ -600,6 +600,8 @@ static void i915_audio_component_codec_wake_override(struct device *dev,
if (!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv)) if (!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv))
return; return;
i915_audio_component_get_power(dev);
/* /*
* Enable/disable generating the codec wake signal, overriding the * Enable/disable generating the codec wake signal, overriding the
* internal logic to generate the codec wake to controller. * internal logic to generate the codec wake to controller.
...@@ -615,6 +617,8 @@ static void i915_audio_component_codec_wake_override(struct device *dev, ...@@ -615,6 +617,8 @@ static void i915_audio_component_codec_wake_override(struct device *dev,
I915_WRITE(HSW_AUD_CHICKENBIT, tmp); I915_WRITE(HSW_AUD_CHICKENBIT, tmp);
usleep_range(1000, 1500); usleep_range(1000, 1500);
} }
i915_audio_component_put_power(dev);
} }
/* Get CDCLK in kHz */ /* Get CDCLK in kHz */
...@@ -648,6 +652,7 @@ static int i915_audio_component_sync_audio_rate(struct device *dev, ...@@ -648,6 +652,7 @@ static int i915_audio_component_sync_audio_rate(struct device *dev,
!IS_HASWELL(dev_priv)) !IS_HASWELL(dev_priv))
return 0; return 0;
i915_audio_component_get_power(dev);
mutex_lock(&dev_priv->av_mutex); mutex_lock(&dev_priv->av_mutex);
/* 1. get the pipe */ /* 1. get the pipe */
intel_encoder = dev_priv->dig_port_map[port]; intel_encoder = dev_priv->dig_port_map[port];
...@@ -698,6 +703,7 @@ static int i915_audio_component_sync_audio_rate(struct device *dev, ...@@ -698,6 +703,7 @@ static int i915_audio_component_sync_audio_rate(struct device *dev,
unlock: unlock:
mutex_unlock(&dev_priv->av_mutex); mutex_unlock(&dev_priv->av_mutex);
i915_audio_component_put_power(dev);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment