drm/i915: HDMI hot remove notification to audio driver
authorWu Fengguang <fengguang.wu@intel.com>
Fri, 9 Dec 2011 12:42:20 +0000 (20:42 +0800)
committerKeith Packard <keithp@keithp.com>
Tue, 20 Dec 2011 03:15:48 +0000 (19:15 -0800)
On HDMI monitor hot remove, clear SDVO_AUDIO_ENABLE accordingly, so that
the audio driver will receive hot plug events and take action to refresh
its device state and ELD contents.

The cleared SDVO_AUDIO_ENABLE bit needs to be restored to prevent losing
HDMI audio after DPMS on.

CC: Wang Zhenyu <zhenyu.z.wang@intel.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
drivers/gpu/drm/i915/intel_hdmi.c

index d4f5a0b2120d05b40a396695653594d2064ba15f..64541f7ef90069a07f073980bb17720af60bb3b3 100644 (file)
@@ -269,6 +269,10 @@ static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode)
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
        u32 temp;
+       u32 enable_bits = SDVO_ENABLE;
+
+       if (intel_hdmi->has_audio)
+               enable_bits |= SDVO_AUDIO_ENABLE;
 
        temp = I915_READ(intel_hdmi->sdvox_reg);
 
@@ -281,9 +285,9 @@ static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode)
        }
 
        if (mode != DRM_MODE_DPMS_ON) {
-               temp &= ~SDVO_ENABLE;
+               temp &= ~enable_bits;
        } else {
-               temp |= SDVO_ENABLE;
+               temp |= enable_bits;
        }
 
        I915_WRITE(intel_hdmi->sdvox_reg, temp);