[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.6 / 0040-drm-i915-HDMI-hot-remove-notification-to-audio-drive.patch
1 From 0836f8461a5868c15ea1884b3a3d6d2b2c03a5e2 Mon Sep 17 00:00:00 2001
2 From: Wu Fengguang <fengguang.wu@intel.com>
3 Date: Fri, 9 Dec 2011 20:42:20 +0800
4 Subject: [PATCH 40/87] drm/i915: HDMI hot remove notification to audio driver
6 commit 2deed761188d7480eb5f7efbfe7aa77f09322ed8 upstream.
8 On HDMI monitor hot remove, clear SDVO_AUDIO_ENABLE accordingly, so that
9 the audio driver will receive hot plug events and take action to refresh
10 its device state and ELD contents.
12 The cleared SDVO_AUDIO_ENABLE bit needs to be restored to prevent losing
13 HDMI audio after DPMS on.
15 CC: Wang Zhenyu <zhenyu.z.wang@intel.com>
16 Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
17 Signed-off-by: Keith Packard <keithp@keithp.com>
18 Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 ---
21 drivers/gpu/drm/i915/intel_hdmi.c | 8 ++++++--
22 1 file changed, 6 insertions(+), 2 deletions(-)
24 diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
25 index d4f5a0b..64541f7 100644
26 --- a/drivers/gpu/drm/i915/intel_hdmi.c
27 +++ b/drivers/gpu/drm/i915/intel_hdmi.c
28 @@ -269,6 +269,10 @@ static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode)
29 struct drm_i915_private *dev_priv = dev->dev_private;
30 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
31 u32 temp;
32 + u32 enable_bits = SDVO_ENABLE;
33 +
34 + if (intel_hdmi->has_audio)
35 + enable_bits |= SDVO_AUDIO_ENABLE;
37 temp = I915_READ(intel_hdmi->sdvox_reg);
39 @@ -281,9 +285,9 @@ static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode)
40 }
42 if (mode != DRM_MODE_DPMS_ON) {
43 - temp &= ~SDVO_ENABLE;
44 + temp &= ~enable_bits;
45 } else {
46 - temp |= SDVO_ENABLE;
47 + temp |= enable_bits;
48 }
50 I915_WRITE(intel_hdmi->sdvox_reg, temp);
51 --
52 1.7.9.4