This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/media_tree.git tree:

Subject: [media] gspca/sn9c20x: Test if sensor is a OV sensor
Author:  Mauro Carvalho Chehab <[email protected]>
Date:    Mon Dec 6 06:53:05 2010 -0300

Instead of just assuming a ov9650 sensor based on USB ID,
double-check it, by reading the sensor ID.

Acked-by: Jean-Francois Moine <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/video/gspca/sn9c20x.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

---

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=5022ba0da8adf4fa82d1c752364b48342d15b0c4

diff --git a/drivers/media/video/gspca/sn9c20x.c 
b/drivers/media/video/gspca/sn9c20x.c
index 6b155ae..1e0f219 100644
--- a/drivers/media/video/gspca/sn9c20x.c
+++ b/drivers/media/video/gspca/sn9c20x.c
@@ -1224,8 +1224,17 @@ static int i2c_r2(struct gspca_dev *gspca_dev, u8 reg, 
u16 *val)
 static int ov9650_init_sensor(struct gspca_dev *gspca_dev)
 {
        int i;
+       u16 id;
        struct sd *sd = (struct sd *) gspca_dev;
 
+       if (i2c_r2(gspca_dev, 0x1c, &id) < 0)
+               return -EINVAL;
+
+       if (id != 0x7fa2) {
+               err("sensor id for ov9650 doesn't match (0x%04x)", id);
+               return -ENODEV;
+       }
+
        for (i = 0; i < ARRAY_SIZE(ov9650_init); i++) {
                if (i2c_w1(gspca_dev, ov9650_init[i].reg,
                                ov9650_init[i].val) < 0) {

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to