Commit 1033f92e authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Use cached cdclk value in i915_audio_component_get_cdclk_freq()

No point in reading the cdclk out from the hardware every single time
since we have it cached already. Just return the cached value to the
audio driver.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1461689194-6079-3-git-send-email-ville.syrjala@linux.intel.comReviewed-by: default avatarMika Kahola <mika.kahola@intel.com>
parent 7f1052a8
...@@ -624,17 +624,11 @@ static void i915_audio_component_codec_wake_override(struct device *dev, ...@@ -624,17 +624,11 @@ static void i915_audio_component_codec_wake_override(struct device *dev,
static int i915_audio_component_get_cdclk_freq(struct device *dev) static int i915_audio_component_get_cdclk_freq(struct device *dev)
{ {
struct drm_i915_private *dev_priv = dev_to_i915(dev); struct drm_i915_private *dev_priv = dev_to_i915(dev);
int ret;
if (WARN_ON_ONCE(!HAS_DDI(dev_priv))) if (WARN_ON_ONCE(!HAS_DDI(dev_priv)))
return -ENODEV; return -ENODEV;
intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO); return dev_priv->cdclk_freq;
ret = dev_priv->display.get_display_clock_speed(dev_priv->dev);
intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO);
return ret;
} }
static int i915_audio_component_sync_audio_rate(struct device *dev, static int i915_audio_component_sync_audio_rate(struct device *dev,
......
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