aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorWang Xingchao <xingchao.wang@intel.com>2012-08-09 04:52:18 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-08-17 04:10:04 -0400
commit9b138a83675364366388af8b6986b2e52be36bcc (patch)
tree521f4afd6ded29a23df3635588d85c54e4121cca /drivers/gpu/drm/i915/intel_display.c
parent4f07854dd7fc197d9ea2bd83c26736baabb0b981 (diff)
drm/i915: ironlake_write_eld code cleanup
Use _PIPE macro to get correct register definition for IBX/CPT, discard old variable "i" way. Signed-off-by: Wang Xingchao <xingchao.wang@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> [danvet: Added the DIP_PORT_SEL #define from a preceeding patch in the series that needs more work.] 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.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b580d949d7d2..f55e024c6df9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5078,28 +5078,24 @@ static void ironlake_write_eld(struct drm_connector *connector,
5078 int aud_config; 5078 int aud_config;
5079 int aud_cntl_st; 5079 int aud_cntl_st;
5080 int aud_cntrl_st2; 5080 int aud_cntrl_st2;
5081 int pipe = to_intel_crtc(crtc)->pipe;
5081 5082
5082 if (HAS_PCH_IBX(connector->dev)) { 5083 if (HAS_PCH_IBX(connector->dev)) {
5083 hdmiw_hdmiedid = IBX_HDMIW_HDMIEDID_A; 5084 hdmiw_hdmiedid = IBX_HDMIW_HDMIEDID(pipe);
5084 aud_config = IBX_AUD_CONFIG_A; 5085 aud_config = IBX_AUD_CFG(pipe);
5085 aud_cntl_st = IBX_AUD_CNTL_ST_A; 5086 aud_cntl_st = IBX_AUD_CNTL_ST(pipe);
5086 aud_cntrl_st2 = IBX_AUD_CNTL_ST2; 5087 aud_cntrl_st2 = IBX_AUD_CNTL_ST2;
5087 } else { 5088 } else {
5088 hdmiw_hdmiedid = CPT_HDMIW_HDMIEDID_A; 5089 hdmiw_hdmiedid = CPT_HDMIW_HDMIEDID(pipe);
5089 aud_config = CPT_AUD_CONFIG_A; 5090 aud_config = CPT_AUD_CFG(pipe);
5090 aud_cntl_st = CPT_AUD_CNTL_ST_A; 5091 aud_cntl_st = CPT_AUD_CNTL_ST(pipe);
5091 aud_cntrl_st2 = CPT_AUD_CNTRL_ST2; 5092 aud_cntrl_st2 = CPT_AUD_CNTRL_ST2;
5092 } 5093 }
5093 5094
5094 i = to_intel_crtc(crtc)->pipe; 5095 DRM_DEBUG_DRIVER("ELD on pipe %c\n", pipe_name(pipe));
5095 hdmiw_hdmiedid += i * 0x100;
5096 aud_cntl_st += i * 0x100;
5097 aud_config += i * 0x100;
5098
5099 DRM_DEBUG_DRIVER("ELD on pipe %c\n", pipe_name(i));
5100 5096
5101 i = I915_READ(aud_cntl_st); 5097 i = I915_READ(aud_cntl_st);
5102 i = (i >> 29) & 0x3; /* DIP_Port_Select, 0x1 = PortB */ 5098 i = (i >> 29) & DIP_PORT_SEL_MASK; /* DIP_Port_Select, 0x1 = PortB */
5103 if (!i) { 5099 if (!i) {
5104 DRM_DEBUG_DRIVER("Audio directed to unknown port\n"); 5100 DRM_DEBUG_DRIVER("Audio directed to unknown port\n");
5105 /* operate blindly on all ports */ 5101 /* operate blindly on all ports */