diff options
author | Mengdong Lin <mengdong.lin@intel.com> | 2013-11-01 00:17:03 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-11-05 01:57:26 -0500 |
commit | 9ca2fe731b3f12afbc97cf0050dfa4184bd2234c (patch) | |
tree | 141d726d7eb6cf7e5a9b80d1594d4cfc8d009c3b /drivers/gpu/drm/i915/intel_display.c | |
parent | 48f34e10169dbb3dd7a19af64e328492b7f54af4 (diff) |
drm/i915/vlv: enable HDA display audio for Valleyview2
This patch defines HD-Audio configuration registers and enables display audio
from HDA controller for Valleyview2.
v2: fix missing offset VLV_DISPLAY_BASE
v3: rename patch from 'enable HDMI audio' to 'enable HDA display audio', since
it's for both HDMI and DP audio
v4: use enc_to_dig_port() to get port number, instead of using Haswell specific
function intel_ddi_get_encoder_port()
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index f34252d134b6..e31a740e1663 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -6989,6 +6989,11 @@ static void ironlake_write_eld(struct drm_connector *connector, | |||
6989 | aud_config = IBX_AUD_CFG(pipe); | 6989 | aud_config = IBX_AUD_CFG(pipe); |
6990 | aud_cntl_st = IBX_AUD_CNTL_ST(pipe); | 6990 | aud_cntl_st = IBX_AUD_CNTL_ST(pipe); |
6991 | aud_cntrl_st2 = IBX_AUD_CNTL_ST2; | 6991 | aud_cntrl_st2 = IBX_AUD_CNTL_ST2; |
6992 | } else if (IS_VALLEYVIEW(connector->dev)) { | ||
6993 | hdmiw_hdmiedid = VLV_HDMIW_HDMIEDID(pipe); | ||
6994 | aud_config = VLV_AUD_CFG(pipe); | ||
6995 | aud_cntl_st = VLV_AUD_CNTL_ST(pipe); | ||
6996 | aud_cntrl_st2 = VLV_AUD_CNTL_ST2; | ||
6992 | } else { | 6997 | } else { |
6993 | hdmiw_hdmiedid = CPT_HDMIW_HDMIEDID(pipe); | 6998 | hdmiw_hdmiedid = CPT_HDMIW_HDMIEDID(pipe); |
6994 | aud_config = CPT_AUD_CFG(pipe); | 6999 | aud_config = CPT_AUD_CFG(pipe); |
@@ -6998,8 +7003,19 @@ static void ironlake_write_eld(struct drm_connector *connector, | |||
6998 | 7003 | ||
6999 | DRM_DEBUG_DRIVER("ELD on pipe %c\n", pipe_name(pipe)); | 7004 | DRM_DEBUG_DRIVER("ELD on pipe %c\n", pipe_name(pipe)); |
7000 | 7005 | ||
7001 | i = I915_READ(aud_cntl_st); | 7006 | if (IS_VALLEYVIEW(connector->dev)) { |
7002 | i = (i >> 29) & DIP_PORT_SEL_MASK; /* DIP_Port_Select, 0x1 = PortB */ | 7007 | struct intel_encoder *intel_encoder; |
7008 | struct intel_digital_port *intel_dig_port; | ||
7009 | |||
7010 | intel_encoder = intel_attached_encoder(connector); | ||
7011 | intel_dig_port = enc_to_dig_port(&intel_encoder->base); | ||
7012 | i = intel_dig_port->port; | ||
7013 | } else { | ||
7014 | i = I915_READ(aud_cntl_st); | ||
7015 | i = (i >> 29) & DIP_PORT_SEL_MASK; | ||
7016 | /* DIP_Port_Select, 0x1 = PortB */ | ||
7017 | } | ||
7018 | |||
7003 | if (!i) { | 7019 | if (!i) { |
7004 | DRM_DEBUG_DRIVER("Audio directed to unknown port\n"); | 7020 | DRM_DEBUG_DRIVER("Audio directed to unknown port\n"); |
7005 | /* operate blindly on all ports */ | 7021 | /* operate blindly on all ports */ |
@@ -10317,7 +10333,8 @@ static void intel_init_display(struct drm_device *dev) | |||
10317 | } | 10333 | } |
10318 | } else if (IS_G4X(dev)) { | 10334 | } else if (IS_G4X(dev)) { |
10319 | dev_priv->display.write_eld = g4x_write_eld; | 10335 | dev_priv->display.write_eld = g4x_write_eld; |
10320 | } | 10336 | } else if (IS_VALLEYVIEW(dev)) |
10337 | dev_priv->display.write_eld = ironlake_write_eld; | ||
10321 | 10338 | ||
10322 | /* Default just returns -ENODEV to indicate unsupported */ | 10339 | /* Default just returns -ENODEV to indicate unsupported */ |
10323 | dev_priv->display.queue_flip = intel_default_queue_flip; | 10340 | dev_priv->display.queue_flip = intel_default_queue_flip; |