Commit 31395fba authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915/audio: Clean up the PCH type checks

Use explicit PCH type checks to make it more clear
which platforms use which codepaths.

Also reorder the branches in ibx_audio_regs_init()
a bit to be more in chronological order.

Cc: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Cc: Takashi Iwai <tiwai@suse.de>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230124144628.4649-14-ville.syrjala@linux.intel.com
parent 7e95cb09
...@@ -666,21 +666,21 @@ static void ibx_audio_regs_init(struct drm_i915_private *i915, ...@@ -666,21 +666,21 @@ static void ibx_audio_regs_init(struct drm_i915_private *i915,
enum pipe pipe, enum pipe pipe,
struct ibx_audio_regs *regs) struct ibx_audio_regs *regs)
{ {
if (HAS_PCH_IBX(i915)) { if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) {
regs->hdmiw_hdmiedid = IBX_HDMIW_HDMIEDID(pipe);
regs->aud_config = IBX_AUD_CFG(pipe);
regs->aud_cntl_st = IBX_AUD_CNTL_ST(pipe);
regs->aud_cntrl_st2 = IBX_AUD_CNTL_ST2;
} else if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) {
regs->hdmiw_hdmiedid = VLV_HDMIW_HDMIEDID(pipe); regs->hdmiw_hdmiedid = VLV_HDMIW_HDMIEDID(pipe);
regs->aud_config = VLV_AUD_CFG(pipe); regs->aud_config = VLV_AUD_CFG(pipe);
regs->aud_cntl_st = VLV_AUD_CNTL_ST(pipe); regs->aud_cntl_st = VLV_AUD_CNTL_ST(pipe);
regs->aud_cntrl_st2 = VLV_AUD_CNTL_ST2; regs->aud_cntrl_st2 = VLV_AUD_CNTL_ST2;
} else { } else if (HAS_PCH_CPT(i915)) {
regs->hdmiw_hdmiedid = CPT_HDMIW_HDMIEDID(pipe); regs->hdmiw_hdmiedid = CPT_HDMIW_HDMIEDID(pipe);
regs->aud_config = CPT_AUD_CFG(pipe); regs->aud_config = CPT_AUD_CFG(pipe);
regs->aud_cntl_st = CPT_AUD_CNTL_ST(pipe); regs->aud_cntl_st = CPT_AUD_CNTL_ST(pipe);
regs->aud_cntrl_st2 = CPT_AUD_CNTRL_ST2; regs->aud_cntrl_st2 = CPT_AUD_CNTRL_ST2;
} else if (HAS_PCH_IBX(i915)) {
regs->hdmiw_hdmiedid = IBX_HDMIW_HDMIEDID(pipe);
regs->aud_config = IBX_AUD_CFG(pipe);
regs->aud_cntl_st = IBX_AUD_CNTL_ST(pipe);
regs->aud_cntrl_st2 = IBX_AUD_CNTL_ST2;
} }
} }
...@@ -965,12 +965,11 @@ void intel_audio_hooks_init(struct drm_i915_private *i915) ...@@ -965,12 +965,11 @@ void intel_audio_hooks_init(struct drm_i915_private *i915)
{ {
if (IS_G4X(i915)) if (IS_G4X(i915))
i915->display.funcs.audio = &g4x_audio_funcs; i915->display.funcs.audio = &g4x_audio_funcs;
else if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) else if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915) ||
HAS_PCH_CPT(i915) || HAS_PCH_IBX(i915))
i915->display.funcs.audio = &ibx_audio_funcs; i915->display.funcs.audio = &ibx_audio_funcs;
else if (IS_HASWELL(i915) || DISPLAY_VER(i915) >= 8) else if (IS_HASWELL(i915) || DISPLAY_VER(i915) >= 8)
i915->display.funcs.audio = &hsw_audio_funcs; i915->display.funcs.audio = &hsw_audio_funcs;
else if (HAS_PCH_SPLIT(i915))
i915->display.funcs.audio = &ibx_audio_funcs;
} }
struct aud_ts_cdclk_m_n { struct aud_ts_cdclk_m_n {
......
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