From 30990100e7ddb6b2bb3b599e5ed14329f7fbd0ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Mon, 2 Feb 2015 14:09:04 +0200 Subject: [PATCH] hack: try to set i2c bus speed to 100kbps via dpcd --- drivers/gpu/drm/i915/intel_dp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 5cecc20..8ba8dd3 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -3579,6 +3579,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); struct drm_device *dev = dig_port->base.base.dev; struct drm_i915_private *dev_priv = dev->dev_private; + u8 i2c_ctrl; if (intel_dp_dpcd_read_wake(&intel_dp->aux, 0x000, intel_dp->dpcd, sizeof(intel_dp->dpcd)) < 0) @@ -3586,6 +3587,18 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) DRM_DEBUG_KMS("DPCD: %*ph\n", (int) sizeof(intel_dp->dpcd), intel_dp->dpcd); + i2c_ctrl = 0; + intel_dp_dpcd_read_wake(&intel_dp->aux, 0x109, &i2c_ctrl, 1); + DRM_DEBUG_KMS("Old i2c speed control: 0x%x\n", i2c_ctrl); + + DRM_DEBUG_KMS("Trying to force i2c speed to 100kHz\n"); + i2c_ctrl = 0x8; + drm_dp_dpcd_write(&intel_dp->aux, 0x109, &i2c_ctrl, 1); + + i2c_ctrl = 0; + intel_dp_dpcd_read_wake(&intel_dp->aux, 0x109, &i2c_ctrl, 1); + DRM_DEBUG_KMS("New i2c speed control: 0x%x\n", i2c_ctrl); + if (intel_dp->dpcd[DP_DPCD_REV] == 0) return false; /* DPCD not present */ -- 2.0.5