Skip to content

Commit 428d2e8

Browse files
committed
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>
1 parent 29e1316 commit 428d2e8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

drivers/gpu/drm/i915/intel_lvds.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,22 @@ static bool lvds_is_present_in_vbt(struct drm_device *dev)
810810
return false;
811811
}
812812

813+
static bool intel_lvds_ddc_probe(struct drm_device *dev)
814+
{
815+
struct drm_i915_private *dev_priv = dev->dev_private;
816+
u8 buf = 0;
817+
struct i2c_msg msgs[] = {
818+
{
819+
.addr = 0xA0,
820+
.flags = 0,
821+
.len = 1,
822+
.buf = &buf,
823+
},
824+
};
825+
struct i2c_adapter *i2c = &dev_priv->gmbus[GMBUS_PORT_PANEL].adapter;
826+
return i2c_transfer(i2c, msgs, 1) == 1;
827+
}
828+
813829
/**
814830
* intel_lvds_init - setup LVDS connectors on this device
815831
* @dev: drm device
@@ -849,6 +865,11 @@ void intel_lvds_init(struct drm_device *dev)
849865
gpio = PCH_GPIOC;
850866
}
851867

868+
if (!intel_lvds_ddc_probe(dev)) {
869+
DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n");
870+
return;
871+
}
872+
852873
intel_lvds = kzalloc(sizeof(struct intel_lvds), GFP_KERNEL);
853874
if (!intel_lvds) {
854875
return;

0 commit comments

Comments
 (0)