@@ -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 -- */