summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_lvds.c
diff options
context:
space:
mode:
authorChris Wilson2010-09-23 12:16:49 +0200
committerChris Wilson2010-09-24 15:19:44 +0200
commit428d2e828c0a68206e5158a42451487601dc9194 (patch)
treea1990359723daa2edf585dbeed063a421f20269d /drivers/gpu/drm/i915/intel_lvds.c
parentdrm/i915/tv: Sleep before checking for state changes. (diff)
downloadkernel-qcow2-linux-428d2e828c0a68206e5158a42451487601dc9194.tar.gz
kernel-qcow2-linux-428d2e828c0a68206e5158a42451487601dc9194.tar.xz
kernel-qcow2-linux-428d2e828c0a68206e5158a42451487601dc9194.zip
drm/i915/lvds: Probe DDC on creation
Try to validate the panel's connection by writing to address 0xA0. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=18072 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lvds.c')
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 2bcea8000859..e1f6e05169f6 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -810,6 +810,22 @@ static bool lvds_is_present_in_vbt(struct drm_device *dev)
return false;
}
+static bool intel_lvds_ddc_probe(struct drm_device *dev)
+{
+ struct drm_i915_private *dev_priv = dev->dev_private;
+ u8 buf = 0;
+ struct i2c_msg msgs[] = {
+ {
+ .addr = 0xA0,
+ .flags = 0,
+ .len = 1,
+ .buf = &buf,
+ },
+ };
+ struct i2c_adapter *i2c = &dev_priv->gmbus[GMBUS_PORT_PANEL].adapter;
+ return i2c_transfer(i2c, msgs, 1) == 1;
+}
+
/**
* intel_lvds_init - setup LVDS connectors on this device
* @dev: drm device
@@ -849,6 +865,11 @@ void intel_lvds_init(struct drm_device *dev)
gpio = PCH_GPIOC;
}
+ if (!intel_lvds_ddc_probe(dev)) {
+ DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n");
+ return;
+ }
+
intel_lvds = kzalloc(sizeof(struct intel_lvds), GFP_KERNEL);
if (!intel_lvds) {
return;