drm/i915/lvds: Connect the PWM to the LVDS pipe
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 3 Dec 2010 20:17:19 +0000 (20:17 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Sun, 5 Dec 2010 00:37:35 +0000 (00:37 +0000)
... and do not just assume to always use pipe B.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/intel_lvds.c

index 23247b235e6820c27765a8fd36fda9653eed3f55..d07055c4d84fb793f99b253f8f4dba293a273a62 100644 (file)
@@ -1012,10 +1012,18 @@ bool intel_lvds_init(struct drm_device *dev)
 out:
        if (HAS_PCH_SPLIT(dev)) {
                u32 pwm;
-               /* make sure PWM is enabled */
+
+               pipe = (I915_READ(PCH_LVDS) & LVDS_PIPEB_SELECT) ? 1 : 0;
+
+               /* make sure PWM is enabled and locked to the LVDS pipe */
                pwm = I915_READ(BLC_PWM_CPU_CTL2);
-               pwm |= (PWM_ENABLE | PWM_PIPE_B);
-               I915_WRITE(BLC_PWM_CPU_CTL2, pwm);
+               if (pipe == 0 && (pwm & PWM_PIPE_B))
+                       I915_WRITE(BLC_PWM_CPU_CTL2, pwm & ~PWM_ENABLE);
+               if (pipe)
+                       pwm |= PWM_PIPE_B;
+               else
+                       pwm &= ~PWM_PIPE_B;
+               I915_WRITE(BLC_PWM_CPU_CTL2, pwm | PWM_ENABLE);
 
                pwm = I915_READ(BLC_PWM_PCH_CTL1);
                pwm |= PWM_PCH_ENABLE;