aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_crt.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-09-14 11:46:59 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-14 16:08:36 -0400
commit890f3359f7b84d7015104360d647ccac5f515542 (patch)
tree88c65ad9638fd84d3921fbe9a9fbecb42816c1ec /drivers/gpu/drm/i915/intel_crt.c
parent2cf34d7b7ee99c27c1a6bdd2f91344cbfa5fef5c (diff)
drm/i915/i2c: Track the parent encoder rather than just the dev
The SDVO proxy i2c adapter wants to be able to use information stored in the encoder, so pass that through intel_i2c rather than iterate over all known encoders every time. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_crt.c')
-rw-r--r--drivers/gpu/drm/i915/intel_crt.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index b39183bcc9fa..0403ec9e164a 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -445,19 +445,17 @@ static void intel_crt_destroy(struct drm_connector *connector)
445 445
446static int intel_crt_get_modes(struct drm_connector *connector) 446static int intel_crt_get_modes(struct drm_connector *connector)
447{ 447{
448 int ret;
449 struct intel_encoder *encoder = intel_attached_encoder(connector); 448 struct intel_encoder *encoder = intel_attached_encoder(connector);
450 struct i2c_adapter *ddc_bus; 449 struct i2c_adapter *ddc_bus;
451 struct drm_device *dev = connector->dev; 450 struct drm_device *dev = connector->dev;
452 451 int ret;
453 452
454 ret = intel_ddc_get_modes(connector, encoder->ddc_bus); 453 ret = intel_ddc_get_modes(connector, encoder->ddc_bus);
455 if (ret || !IS_G4X(dev)) 454 if (ret || !IS_G4X(dev))
456 goto end; 455 goto end;
457 456
458 /* Try to probe digital port for output in DVI-I -> VGA mode. */ 457 /* Try to probe digital port for output in DVI-I -> VGA mode. */
459 ddc_bus = intel_i2c_create(connector->dev, GPIOD, "CRTDDC_D"); 458 ddc_bus = intel_i2c_create(encoder, GPIOD, "CRTDDC_D");
460
461 if (!ddc_bus) { 459 if (!ddc_bus) {
462 dev_printk(KERN_ERR, &connector->dev->pdev->dev, 460 dev_printk(KERN_ERR, &connector->dev->pdev->dev,
463 "DDC bus registration failed for CRTDDC_D.\n"); 461 "DDC bus registration failed for CRTDDC_D.\n");
@@ -545,7 +543,8 @@ void intel_crt_init(struct drm_device *dev)
545 if (dev_priv->crt_ddc_bus != 0) 543 if (dev_priv->crt_ddc_bus != 0)
546 i2c_reg = dev_priv->crt_ddc_bus; 544 i2c_reg = dev_priv->crt_ddc_bus;
547 } 545 }
548 intel_encoder->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A"); 546 intel_encoder->ddc_bus = intel_i2c_create(intel_encoder,
547 i2c_reg, "CRTDDC_A");
549 if (!intel_encoder->ddc_bus) { 548 if (!intel_encoder->ddc_bus) {
550 dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration " 549 dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration "
551 "failed.\n"); 550 "failed.\n");