summaryrefslogtreecommitdiff
path: root/src/sil164
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-10-01 13:45:09 -0700
committerEric Anholt <eric@anholt.net>2007-10-01 13:48:48 -0700
commit29d3188ee9676f697f6fcb859c7f680f5df30318 (patch)
tree4108bc0a18bde800687492a0abef775c114263ec /src/sil164
parent6dd8228a386334d05836353672aae9f8c456e435 (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/sil164')
-rw-r--r--src/sil164/sil164.c18
-rw-r--r--src/sil164/sil164_reg.h1
2 files changed, 13 insertions, 6 deletions
diff --git a/src/sil164/sil164.c b/src/sil164/sil164.c
index 60a03e22..c774a56c 100644
--- a/src/sil164/sil164.c
+++ b/src/sil164/sil164.c
@@ -49,9 +49,11 @@ static Bool
sil164ReadByte(SIL164Ptr sil, int addr, CARD8 *ch)
{
if (!xf86I2CReadByte(&(sil->d), addr, ch)) {
- xf86DrvMsg(sil->d.pI2CBus->scrnIndex, X_ERROR,
- "Unable to read from %s Slave %d.\n",
- sil->d.pI2CBus->BusName, sil->d.SlaveAddr);
+ if (!sil->quiet) {
+ xf86DrvMsg(sil->d.pI2CBus->scrnIndex, X_ERROR,
+ "Unable to read from %s Slave %d.\n",
+ sil->d.pI2CBus->BusName, sil->d.SlaveAddr);
+ }
return FALSE;
}
return TRUE;
@@ -61,9 +63,11 @@ static Bool
sil164WriteByte(SIL164Ptr sil, int addr, CARD8 ch)
{
if (!xf86I2CWriteByte(&(sil->d), addr, ch)) {
- xf86DrvMsg(sil->d.pI2CBus->scrnIndex, X_ERROR,
- "Unable to write to %s Slave %d.\n",
- sil->d.pI2CBus->BusName, sil->d.SlaveAddr);
+ if (!sil->quiet) {
+ xf86DrvMsg(sil->d.pI2CBus->scrnIndex, X_ERROR,
+ "Unable to write to %s Slave %d.\n",
+ sil->d.pI2CBus->BusName, sil->d.SlaveAddr);
+ }
return FALSE;
}
return TRUE;
@@ -91,6 +95,7 @@ sil164_init(I2CBusPtr b, I2CSlaveAddr addr)
sil->d.AcknTimeout = b->AcknTimeout;
sil->d.ByteTimeout = b->ByteTimeout;
sil->d.DriverPrivate.ptr = sil;
+ sil->quiet = TRUE;
if (!sil164ReadByte(sil, SIL164_VID_LO, &ch))
goto out;
@@ -111,6 +116,7 @@ sil164_init(I2CBusPtr b, I2CSlaveAddr addr)
ch, sil->d.pI2CBus->BusName, sil->d.SlaveAddr);
goto out;
}
+ sil->quiet = FALSE;
if (!xf86I2CDevInit(&(sil->d))) {
goto out;
diff --git a/src/sil164/sil164_reg.h b/src/sil164/sil164_reg.h
index ebfcb8c7..734e55dd 100644
--- a/src/sil164/sil164_reg.h
+++ b/src/sil164/sil164_reg.h
@@ -65,6 +65,7 @@ typedef struct _Sil164SaveRec {
typedef struct {
I2CDevRec d;
+ Bool quiet;
SIL164SaveRec SavedReg;
SIL164SaveRec ModeReg;
} SIL164Rec, *SIL164Ptr;