]> err.no Git - linux-2.6/commitdiff
V4L/DVB (3575): Cxusb: fix i2c debug messages for bluebird devices
authorMichael Krufky <mkrufky@linuxtv.org>
Thu, 23 Mar 2006 04:11:18 +0000 (01:11 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 24 Mar 2006 19:26:55 +0000 (16:26 -0300)
Only the Medion boxes return 0x08 after an i2c read/write.
The bluebird devices do not return anything at all.
This patch conditionalizes the test for the 0x08 return code
to produce a warning message when using the Medion box, only.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/dvb-usb/cxusb.c
drivers/media/dvb/dvb-usb/cxusb.h

index 9f9adb77e7e340b7cfc3293ac878cdb68a386b18..a14e737ec848df57f4147f62c139f2630a996b77 100644 (file)
@@ -109,7 +109,7 @@ static int cxusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num)
                                break;
 
                        if (ibuf[0] != 0x08)
-                               deb_info("i2c read may have failed\n");
+                               deb_i2c("i2c read may have failed\n");
 
                        memcpy(msg[i+1].buf,&ibuf[1],msg[i+1].len);
 
@@ -123,7 +123,7 @@ static int cxusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num)
                        if (cxusb_ctrl_msg(d,CMD_I2C_WRITE, obuf, 2+msg[i].len, &ibuf,1) < 0)
                                break;
                        if (ibuf != 0x08)
-                               deb_info("i2c write may have failed\n");
+                               deb_i2c("i2c write may have failed\n");
                }
        }
 
index 087c99427853f6a51496b6598f7aec5bb8941859..c8ef77554b00a1cbff09faedd858ef898317a170 100644 (file)
@@ -6,6 +6,8 @@
 
 extern int dvb_usb_cxusb_debug;
 #define deb_info(args...)   dprintk(dvb_usb_cxusb_debug,0x01,args)
+#define deb_i2c(args...)    if (d->udev->descriptor.idVendor == USB_VID_MEDION) \
+                               dprintk(dvb_usb_cxusb_debug,0x01,args)
 
 /* usb commands - some of it are guesses, don't have a reference yet */
 #define CMD_I2C_WRITE     0x08