diff mbox

topro 6800 driver

Message ID 1d4c7fd50904200837pe4c82bfx1f0638072efba919@mail.gmail.com (mailing list archive)
State Changes Requested
Delegated to: Douglas Landgraf
Headers show

Commit Message

Thomas Champagne April 20, 2009, 3:37 p.m. UTC
Hello Anders

I found a small time for testing your code. But your code doesn't work
with my webcam. :-(
I think it doesn't have the same sensor. Can you add in the sd_init
method the check of the sensor id ? You can adjust this patch with
your sensor id :



Please, tell me what is your sensor id.

Thomas
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff -r 5a9a52f1277e linux/drivers/media/video/gspca/tp6800.c
--- a/linux/drivers/media/video/gspca/tp6800.c	Sat Apr 18 18:21:49 2009 +0200
+++ b/linux/drivers/media/video/gspca/tp6800.c	Mon Apr 20 17:33:15 2009 +0200
@@ -1601,8 +1601,21 @@ 
 /* this function is called at probe and resume time */
 static int sd_init(struct gspca_dev *gspca_dev)
 {
+	int res = 0;
+	__u8 value;
+
 	/* check if the device responds */
+	REG_W(gspca_dev, TP6800_SIF_TYPE, 0x01);
+	REG_W(gspca_dev, TP6800_SIF_CONTROL, 0x01);
+	REG_W(gspca_dev, TP6800_GPIO_IO, 0x9f);
+	REG_R(gspca_dev, TP6800_GPIO_DATA, &value);
+	if ((value & 7) != 0x00) {
+		PDEBUG(D_ERR, "init reg: 0x%02x. Unrecognized sensor.", value);
+		return -1;
+	}
 	return 0;
+out:
+	return res;
 }

 /* -- start the camera -- */