The other patch is to correct the i2c_w() function, according to the datasheet, the 3rd status bit is set if there's an error, else is clear. I've patched this, because with the current code, all the calls to i2c_w() returned error but worked fine (the values in the sensor where changed). This is the same behaviour of the sn9c102 kernel driver.
diff -r 7035f61808ba linux/drivers/media/video/gspca/sonixb.c
--- a/linux/drivers/media/video/gspca/sonixb.c Tue Jul 15 11:36:42 2008 +0200
+++ b/linux/drivers/media/video/gspca/sonixb.c Tue Jul 15 08:50:50 2008 -0300
@@ -482,8 +482,8 @@
while (retry--) {
msleep(10);
reg_r(gspca_dev, 0x08);
- if (gspca_dev->usb_buf[0] == 4)
- return 0;
+ if (gspca_dev->usb_buf[0] & 0x4)
+ return (gspca_dev->usb_buf[0] & 0x8)?-1:0;
}
return -1;
}
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ Spca50x-devs mailing list Spca50x-devs@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/spca50x-devs