diff options
author | Eric Anholt <eric@anholt.net> | 2007-10-01 13:45:09 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2007-10-01 13:48:48 -0700 |
commit | 29d3188ee9676f697f6fcb859c7f680f5df30318 (patch) | |
tree | 4108bc0a18bde800687492a0abef775c114263ec /src/ch7xxx | |
parent | 6dd8228a386334d05836353672aae9f8c456e435 (diff) |
Suppress I2C failure error messages during DVO device detection.
Otherwise, errors would be printed for every chip probed which wasn't present
on the system.
Diffstat (limited to 'src/ch7xxx')
-rw-r--r-- | src/ch7xxx/ch7xxx.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/ch7xxx/ch7xxx.c b/src/ch7xxx/ch7xxx.c index 3ef9612a..3c58165d 100644 --- a/src/ch7xxx/ch7xxx.c +++ b/src/ch7xxx/ch7xxx.c @@ -67,6 +67,8 @@ struct ch7xxx_reg_state { struct ch7xxx_priv { I2CDevRec d; + Bool quiet; + struct ch7xxx_reg_state SavedReg; struct ch7xxx_reg_state ModeReg; CARD8 save_TCTL, save_TPCP, save_TPD, save_TPVT; @@ -92,9 +94,11 @@ static Bool ch7xxx_read(struct ch7xxx_priv *dev_priv, int addr, unsigned char *ch) { if (!xf86I2CReadByte(&dev_priv->d, addr, ch)) { - xf86DrvMsg(dev_priv->d.pI2CBus->scrnIndex, - X_ERROR, "Unable to read from %s Slave %d.\n", - dev_priv->d.pI2CBus->BusName, dev_priv->d.SlaveAddr); + if (!dev_priv->quiet) { + xf86DrvMsg(dev_priv->d.pI2CBus->scrnIndex, + X_ERROR, "Unable to read from %s Slave %d.\n", + dev_priv->d.pI2CBus->BusName, dev_priv->d.SlaveAddr); + } return FALSE; } @@ -106,9 +110,11 @@ static Bool ch7xxx_write(struct ch7xxx_priv *dev_priv, int addr, unsigned char ch) { if (!xf86I2CWriteByte(&dev_priv->d, addr, ch)) { - xf86DrvMsg(dev_priv->d.pI2CBus->scrnIndex, X_ERROR, - "Unable to write to %s Slave %d.\n", - dev_priv->d.pI2CBus->BusName, dev_priv->d.SlaveAddr); + if (!dev_priv->quiet) { + xf86DrvMsg(dev_priv->d.pI2CBus->scrnIndex, X_ERROR, + "Unable to write to %s Slave %d.\n", + dev_priv->d.pI2CBus->BusName, dev_priv->d.SlaveAddr); + } return FALSE; } @@ -136,6 +142,7 @@ ch7xxx_init(I2CBusPtr b, I2CSlaveAddr addr) dev_priv->d.ByteTimeout = b->ByteTimeout; dev_priv->d.DriverPrivate.ptr = dev_priv; + dev_priv->quiet = TRUE; if (!ch7xxx_read(dev_priv, CH7xxx_REG_VID, &vendor)) goto out; @@ -159,9 +166,11 @@ ch7xxx_init(I2CBusPtr b, I2CSlaveAddr addr) dev_priv->d.SlaveAddr); goto out; } - xf86DrvMsg(dev_priv->d.pI2CBus->scrnIndex, X_INFO, - "Detected %s chipset, vendor/device ID 0x%02x/0x%02x\n", - name, vendor, device); + dev_priv->quiet = FALSE; + + xf86DrvMsg(dev_priv->d.pI2CBus->scrnIndex, X_INFO, + "Detected %s chipset, vendor/device ID 0x%02x/0x%02x\n", + name, vendor, device); if (!xf86I2CDevInit(&dev_priv->d)) { goto out; |