diff options
author | Eric Anholt <eric@anholt.net> | 2006-11-27 11:23:55 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2006-11-27 11:23:55 -0800 |
commit | 72692ba2e0254460c4f5a8cd476f5748383390ae (patch) | |
tree | 98307ae227ccbdc369615a2c970cf5e3b0b07edc /src/i830_sdvo.c | |
parent | 5f38bc3e2a685da5c03efa8103a353f79c842aa7 (diff) |
Postpone SDVO DDC bus creation until we've detected the SDVO device.
This reduces log noise for those of us with no SDVO devices.
Diffstat (limited to 'src/i830_sdvo.c')
-rw-r--r-- | src/i830_sdvo.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c index 71bccc7f..ebf5868c 100644 --- a/src/i830_sdvo.c +++ b/src/i830_sdvo.c @@ -1026,6 +1026,22 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device) return; } + output->pI2CBus = i2cbus; + output->dev_priv = dev_priv; + + /* Read the regs to test if we can talk to the device */ + for (i = 0; i < 0x40; i++) { + if (!i830_sdvo_read_byte_quiet(output, i, &ch[i])) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "No SDVO device found on SDVO%c\n", + output_device == SDVOB ? 'B' : 'C'); + xf86DestroyI2CDevRec(&dev_priv->d, FALSE); + xf86DestroyI2CBusRec(i2cbus, TRUE, TRUE); + xfree(dev_priv); + return; + } + } + /* Set up our wrapper I2C bus for DDC. It acts just like the regular I2C * bus, except that it does the control bus switch to DDC mode before every * Start. While we only need to do it at Start after every Stop after a @@ -1055,24 +1071,7 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device) xfree(dev_priv); return; } - - output->pI2CBus = i2cbus; output->pDDCBus = ddcbus; - output->dev_priv = dev_priv; - - /* Read the regs to test if we can talk to the device */ - for (i = 0; i < 0x40; i++) { - if (!i830_sdvo_read_byte_quiet(output, i, &ch[i])) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "No SDVO device found on SDVO%c\n", - output_device == SDVOB ? 'B' : 'C'); - xf86DestroyI2CBusRec(output->pDDCBus, FALSE, FALSE); - xf86DestroyI2CDevRec(&dev_priv->d, FALSE); - xf86DestroyI2CBusRec(i2cbus, TRUE, TRUE); - xfree(dev_priv); - return; - } - } i830_sdvo_get_capabilities(output, &dev_priv->caps); |