Web lists-archives.com

Re: [Spca50x-devs] PATCH: gspca-mercurial OV7630 control settings


It's me again.
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.

The previous patch is wrong, This patch is the correct behaviour.


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--) {
 		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
Spca50x-devs mailing list