Re: PATCH: gspca-mercurial OV7630 control settings

"Andoni Zubimendi" <[email protected]> Tue, 15 Jul 2008 08:54:36 -0300
Newsgroups gmane.linux.drivers.spca50x.devel
Message-ID <[email protected]>
Hi!

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.

Regards,

Andoni

-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/spca50x-devs
patch-fix-i2c_w.patch (text/x-patch, 452 B)
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;
 }