diff mbox

[RFT] drm/i915: enable/disable LVDS port at DPMS time

Message ID 20100211124105.242d4341@jbarnes-piketon (mailing list archive)
State Accepted
Headers show

Commit Message

Jesse Barnes Feb. 11, 2010, 8:41 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 75a9772..a1a15a6 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -89,7 +89,10 @@  static u32 intel_lvds_get_max_backlight(struct drm_device *dev)
 static void intel_lvds_set_power(struct drm_device *dev, bool on)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	u32 pp_status, ctl_reg, status_reg;
+	u32 pp_status, ctl_reg, status_reg, lvds_reg = LVDS;
+
+	if (IS_IRONLAKE(dev))
+		lvds_reg = PCH_LVDS;
 
 	if (IS_IRONLAKE(dev)) {
 		ctl_reg = PCH_PP_CONTROL;
@@ -100,6 +103,9 @@  static void intel_lvds_set_power(struct drm_device *dev, bool on)
 	}
 
 	if (on) {
+		I915_WRITE(lvds_reg, I915_READ(lvds_reg) | LVDS_PORT_EN);
+		POSTING_READ(lvds_reg);
+
 		I915_WRITE(ctl_reg, I915_READ(ctl_reg) |
 			   POWER_TARGET_ON);
 		do {
@@ -115,6 +121,9 @@  static void intel_lvds_set_power(struct drm_device *dev, bool on)
 		do {
 			pp_status = I915_READ(status_reg);
 		} while (pp_status & PP_ON);
+
+		I915_WRITE(lvds_reg, I915_READ(lvds_reg) & ~LVDS_PORT_EN);
+		POSTING_READ(lvds_reg);
 	}
 }