xf86-video-intel: Branch 'modesetting' - src/i830_driver.c src/i830_sdvo.c

Dave Airlie airlied at kemper.freedesktop.org
Thu Apr 20 02:51:28 EEST 2006


 src/i830_driver.c |    3 +--
 src/i830_sdvo.c   |    9 ++++++---
 2 files changed, 7 insertions(+), 5 deletions(-)

New commits:
diff-tree b5f099e03a9f58b6b99933fb06526bce4db72bd3 (from 2909802de63756972b38651a496b4ff1b36ac8a2)
Author: Dave Airlie <airlied at linux.ie>
Date:   Thu Apr 20 09:50:36 2006 +1000

    cleanup sDVO for device on C only
    
    This destroys the i2c device properly if the device isn't detected,
    and allows sDVO to work on GM chipsets, and doesn't initialise
    the i2c bus twice for sDVO.

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 61cc231..e0bb55a 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1369,7 +1369,6 @@ I830SetupOutputBusses(ScrnInfoPtr pScrn)
       pI830->output[i].type = I830_OUTPUT_LVDS;
       I830I2CInit(pScrn, &pI830->output[i].pDDCBus, GPIOC, "LVDSDDC_C");
       i++;
-      break;
    case PCI_CHIP_I915_G:
    case PCI_CHIP_I945_G:
       /* Set up SDVOB */
@@ -1380,7 +1379,7 @@ I830SetupOutputBusses(ScrnInfoPtr pScrn)
 
       /* Set up SDVOC */
       pI830->output[i].type = I830_OUTPUT_SDVO;
-      I830I2CInit(pScrn, &pI830->output[i].pI2CBus, GPIOE, "SDVOCTRL_E");
+      pI830->output[i].pI2CBus = pI830->output[i-1].pI2CBus;
       I830SDVOInit(pScrn, i, SDVOC);
       i++;
       break;
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index bbf2b93..4d76044 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -544,11 +544,13 @@ I830SDVOInit(ScrnInfoPtr pScrn, int outp
     if (sdvo == NULL)
 	return NULL;
 
-    sdvo->d.DevName = "SDVO Controller";
-    if (output_device == SDVOB)
+    if (output_device == SDVOB) {
+	sdvo->d.DevName = "SDVO Controller B";
 	sdvo->d.SlaveAddr = 0x70;
-    else
+    } else {
+	sdvo->d.DevName = "SDVO Controller C";
 	sdvo->d.SlaveAddr = 0x72;
+    }
     sdvo->d.pI2CBus = pI830->output[output_index].pI2CBus;
     sdvo->d.DriverPrivate.ptr = sdvo;
     sdvo->output_device = output_device;
@@ -564,6 +566,7 @@ I830SDVOInit(ScrnInfoPtr pScrn, int outp
     /* Read the regs to test if we can talk to the device */
     for (i = 0; i < 0x40; i++) {
 	if (!sReadByte(sdvo, i, &ch[i])) {
+	    xf86DestroyI2CDevRec(&sdvo->d, 0);
 	    xfree(sdvo);
 	    return NULL;
 	}



More information about the xorg-commit mailing list