Skip to content

Commit c149dcb

Browse files
jnikulatiwai
authored andcommitted
drm/i915: provide interface for audio driver to query cdclk
For Haswell and Broadwell, if the display power well has been disabled, the display audio controller divider values EM4 M VALUE and EM5 N VALUE will have been lost. The CDCLK frequency is required for reprogramming them to generate 24MHz HD-A link BCLK. So provide a private interface for the audio driver to query CDCLK. This is a stopgap solution until a more generic interface between audio and display drivers has been implemented. Signed-off-by: Jani Nikula <[email protected]> Reviewed-by: Damien Lespiau <[email protected]> Signed-off-by: Mengdong Lin <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent a12137e commit c149dcb

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6053,6 +6053,27 @@ int i915_release_power_well(void)
60536053
}
60546054
EXPORT_SYMBOL_GPL(i915_release_power_well);
60556055

6056+
/*
6057+
* Private interface for the audio driver to get CDCLK in kHz.
6058+
*
6059+
* Caller must request power well using i915_request_power_well() prior to
6060+
* making the call.
6061+
*/
6062+
int i915_get_cdclk_freq(void)
6063+
{
6064+
struct drm_i915_private *dev_priv;
6065+
6066+
if (!hsw_pwr)
6067+
return -ENODEV;
6068+
6069+
dev_priv = container_of(hsw_pwr, struct drm_i915_private,
6070+
power_domains);
6071+
6072+
return intel_ddi_get_cdclk_freq(dev_priv);
6073+
}
6074+
EXPORT_SYMBOL_GPL(i915_get_cdclk_freq);
6075+
6076+
60566077
#define POWER_DOMAIN_MASK (BIT(POWER_DOMAIN_NUM) - 1)
60576078

60586079
#define HSW_ALWAYS_ON_POWER_DOMAINS ( \

include/drm/i915_powerwell.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@
3232
/* For use by hda_i915 driver */
3333
extern int i915_request_power_well(void);
3434
extern int i915_release_power_well(void);
35+
extern int i915_get_cdclk_freq(void);
3536

3637
#endif /* _I915_POWERWELL_H_ */

0 commit comments

Comments
 (0)