diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 7a581eb..99371ea 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c @@ -1476,10 +1476,35 @@ static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connect static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) { struct intel_output *intel_output = to_intel_output(connector); + struct i2c_adapter *ddcbus; + int ret; /* set the bus switch and get the modes */ - intel_ddc_get_modes(intel_output); + ret = intel_ddc_get_modes(intel_output); + + if (ret != 0) + return; + list_for_each_entry(connector, + &connector->dev->mode_config.connector_list, head) { + if (connector->connector_type == DRM_MODE_CONNECTOR_VGA && + connector_status_connected == + connector->funcs->detect(connector)) + return; + } + ddcbus = intel_output->ddc_bus; + intel_output->ddc_bus = + intel_i2c_create(connector->dev, GPIOA, "CRTDDC_A"); + + if (!intel_output->ddc_bus) { + intel_output->ddc_bus = ddcbus; + dev_printk(KERN_ERR, &connector->dev->pdev->dev, + "DDC bus registration failed for CRTDDC_A.\n"); + return; + } + intel_ddc_get_modes(intel_output); + intel_i2c_destroy(intel_output->ddc_bus); + intel_output->ddc_bus = ddcbus; #if 0 struct drm_device *dev = encoder->dev; struct drm_i915_private *dev_priv = dev->dev_private;