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/ivch | |
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/ivch')
-rw-r--r-- | src/ivch/ivch.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/ivch/ivch.c b/src/ivch/ivch.c index bd11dd42..ac57ff3a 100644 --- a/src/ivch/ivch.c +++ b/src/ivch/ivch.c @@ -48,6 +48,7 @@ struct ivch_priv { I2CDevRec d; xf86OutputPtr output; + Bool quiet; CARD16 width; CARD16 height; @@ -105,9 +106,11 @@ ivch_read(struct ivch_priv *priv, int addr, CARD16 *data) return TRUE; fail: - xf86DrvMsg(priv->d.pI2CBus->scrnIndex, X_ERROR, - "ivch: Unable to read register 0x%02x from %s:%02x.\n", - addr, priv->d.pI2CBus->BusName, priv->d.SlaveAddr); + if (!priv->quiet) { + xf86DrvMsg(priv->d.pI2CBus->scrnIndex, X_ERROR, + "ivch: Unable to read register 0x%02x from %s:%02x.\n", + addr, priv->d.pI2CBus->BusName, priv->d.SlaveAddr); + } b->I2CStop(&priv->d); return FALSE; @@ -140,9 +143,12 @@ ivch_write(struct ivch_priv *priv, int addr, CARD16 data) fail: b->I2CStop(&priv->d); - xf86DrvMsg(priv->d.pI2CBus->scrnIndex, X_ERROR, - "Unable to write register 0x%02x to %s:%d.\n", - addr, priv->d.pI2CBus->BusName, priv->d.SlaveAddr); + + if (!priv->quiet) { + xf86DrvMsg(priv->d.pI2CBus->scrnIndex, X_ERROR, + "Unable to write register 0x%02x to %s:%d.\n", + addr, priv->d.pI2CBus->BusName, priv->d.SlaveAddr); + } return FALSE; } @@ -167,9 +173,11 @@ ivch_init(I2CBusPtr b, I2CSlaveAddr addr) priv->d.AcknTimeout = b->AcknTimeout; priv->d.ByteTimeout = b->ByteTimeout; priv->d.DriverPrivate.ptr = priv; + priv->quiet = TRUE; if (!ivch_read(priv, VR00, &temp)) goto out; + priv->quiet = FALSE; /* Since the identification bits are probably zeroes, which doesn't seem * very unique, check that the value in the base address field matches |