Skip to content

Commit 87c1694

Browse files
kv2019ijnikula
authored andcommitted
drm/i915: save AUD_FREQ_CNTRL state at audio domain suspend
When audio power domain is suspended, the display driver must save state of AUD_FREQ_CNTRL on Tiger Lake and Ice Lake systems. The initial value of the register is set by BIOS and is read by driver during the audio component init sequence. Cc: Jani Nikula <[email protected]> Cc: Imre Deak <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5dd85e7 commit 87c1694

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

drivers/gpu/drm/i915/display/intel_audio.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,10 +852,17 @@ static unsigned long i915_audio_component_get_power(struct device *kdev)
852852

853853
ret = intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO);
854854

855-
/* Force CDCLK to 2*BCLK as long as we need audio to be powered. */
856-
if (dev_priv->audio_power_refcount++ == 0)
855+
if (dev_priv->audio_power_refcount++ == 0) {
856+
if (IS_TIGERLAKE(dev_priv) || IS_ICELAKE(dev_priv)) {
857+
I915_WRITE(AUD_FREQ_CNTRL, dev_priv->audio_freq_cntrl);
858+
DRM_DEBUG_KMS("restored AUD_FREQ_CNTRL to 0x%x\n",
859+
dev_priv->audio_freq_cntrl);
860+
}
861+
862+
/* Force CDCLK to 2*BCLK as long as we need audio powered. */
857863
if (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv))
858864
glk_force_audio_cdclk(dev_priv, true);
865+
}
859866

860867
return ret;
861868
}
@@ -1116,6 +1123,12 @@ static void i915_audio_component_init(struct drm_i915_private *dev_priv)
11161123
return;
11171124
}
11181125

1126+
if (IS_TIGERLAKE(dev_priv) || IS_ICELAKE(dev_priv)) {
1127+
dev_priv->audio_freq_cntrl = I915_READ(AUD_FREQ_CNTRL);
1128+
DRM_DEBUG_KMS("init value of AUD_FREQ_CNTRL of 0x%x\n",
1129+
dev_priv->audio_freq_cntrl);
1130+
}
1131+
11191132
dev_priv->audio_component_registered = true;
11201133
}
11211134

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,7 @@ struct drm_i915_private {
15411541
*/
15421542
struct mutex av_mutex;
15431543
int audio_power_refcount;
1544+
u32 audio_freq_cntrl;
15441545

15451546
struct {
15461547
struct mutex mutex;

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9127,6 +9127,8 @@ enum {
91279127
#define HSW_AUD_CHICKENBIT _MMIO(0x65f10)
91289128
#define SKL_AUD_CODEC_WAKE_SIGNAL (1 << 15)
91299129

9130+
#define AUD_FREQ_CNTRL _MMIO(0x65900)
9131+
91309132
/*
91319133
* HSW - ICL power wells
91329134
*

0 commit comments

Comments
 (0)