All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: set AUD_CONFIG N_value_index for DisplayPort
@ 2012-01-09 13:17 ` Wu Fengguang
  0 siblings, 0 replies; 25+ messages in thread
From: Wu Fengguang @ 2012-01-09 13:17 UTC (permalink / raw)
  To: Keith Packard
  Cc: LKML, Takashi Iwai, Michal Marek, intel-gfx@lists.freedesktop...

It should be programmed to "0" for HDMI or "1" for DisplayPort.

This enables DisplayPort audio for

- HP EliteBook 8460p
  (whose BIOS does not set the N_value_index bit for us)

- DisplayPort monitor hot plugged after boot
  (otherwise most BIOS will fill the N_value_index bit for us)

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |    5 +++++
 2 files changed, 8 insertions(+)

--- linux.orig/drivers/gpu/drm/i915/i915_reg.h	2012-01-06 15:00:55.000000000 +0800
+++ linux/drivers/gpu/drm/i915/i915_reg.h	2012-01-06 15:04:10.000000000 +0800
@@ -3582,4 +3582,7 @@
 #define CPT_AUD_CNTL_ST_A		0xE50B4
 #define CPT_AUD_CNTRL_ST2		0xE50C0
 
+#define IBX_AUD_CONFIG_A		0xe2000
+#define CPT_AUD_CONFIG_A		0xe5000
+
 #endif /* _I915_REG_H_ */
--- linux.orig/drivers/gpu/drm/i915/intel_display.c	2012-01-06 15:05:47.000000000 +0800
+++ linux/drivers/gpu/drm/i915/intel_display.c	2012-01-06 16:07:59.000000000 +0800
@@ -5908,15 +5908,18 @@ static void ironlake_write_eld(struct dr
 	uint32_t i;
 	int len;
 	int hdmiw_hdmiedid;
+	int aud_config;
 	int aud_cntl_st;
 	int aud_cntrl_st2;
 
 	if (HAS_PCH_IBX(connector->dev)) {
 		hdmiw_hdmiedid = IBX_HDMIW_HDMIEDID_A;
+		aud_config = IBX_AUD_CONFIG_A;
 		aud_cntl_st = IBX_AUD_CNTL_ST_A;
 		aud_cntrl_st2 = IBX_AUD_CNTL_ST2;
 	} else {
 		hdmiw_hdmiedid = CPT_HDMIW_HDMIEDID_A;
+		aud_config = CPT_AUD_CONFIG_A;
 		aud_cntl_st = CPT_AUD_CNTL_ST_A;
 		aud_cntrl_st2 = CPT_AUD_CNTRL_ST2;
 	}
@@ -5924,6 +5927,7 @@ static void ironlake_write_eld(struct dr
 	i = to_intel_crtc(crtc)->pipe;
 	hdmiw_hdmiedid += i * 0x100;
 	aud_cntl_st += i * 0x100;
+	aud_config += i * 0x100;
 
 	DRM_DEBUG_DRIVER("ELD on pipe %c\n", pipe_name(i));
 
@@ -5943,6 +5947,7 @@ static void ironlake_write_eld(struct dr
 	if (intel_pipe_has_type(crtc, INTEL_OUTPUT_DISPLAYPORT)) {
 		DRM_DEBUG_DRIVER("ELD: DisplayPort detected\n");
 		eld[5] |= (1 << 2);	/* Conn_Type, 0x1 = DisplayPort */
+		I915_WRITE(aud_config, 1 << 29); /* N value index, 0x1 = DP */
 	}
 
 	if (intel_eld_uptodate(connector,

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2012-01-29 15:14 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-09 13:17 [PATCH] drm/i915: set AUD_CONFIG N_value_index for DisplayPort Wu Fengguang
2012-01-09 13:17 ` Wu Fengguang
2012-01-09 17:22 ` Keith Packard
2012-01-09 17:22   ` Keith Packard
2012-01-10  5:45   ` Wu Fengguang
2012-01-12 17:33     ` Keith Packard
2012-01-12 17:33       ` Keith Packard
2012-01-16  8:02       ` Wu Fengguang
2012-01-16  8:02         ` Wu Fengguang
2012-01-16 20:26         ` [Intel-gfx] " Daniel Vetter
2012-01-16 20:26           ` Daniel Vetter
2012-01-16 20:44           ` [Intel-gfx] " Keith Packard
2012-01-16 20:44             ` Keith Packard
2012-01-16 23:08             ` Wu Fengguang
2012-01-16 23:15               ` Keith Packard
2012-01-16 23:15                 ` Keith Packard
2012-01-17 10:22               ` [Intel-gfx] " Daniel Vetter
2012-01-29  4:44                 ` [PATCH][rebased] " Wu Fengguang
2012-01-29  4:44                   ` Wu Fengguang
2012-01-29 12:12                   ` Daniel Vetter
2012-01-29 12:12                     ` Daniel Vetter
2012-01-29 13:23                     ` Wu Fengguang
2012-01-29 13:23                       ` Wu Fengguang
2012-01-29 15:14                       ` Daniel Vetter
2012-01-29 15:14                         ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.