From 3ebd17946448df50b9082412d09955c87a112721 Mon Sep 17 00:00:00 2001 From: Jean-François Moine Date: Sat, 25 Dec 2010 13:07:57 -0300 Subject: [media] gspca - sq930x: Don't register a webcam when there are USB errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jean-François Moine Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/gspca/sq930x.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'drivers/media/video/gspca/sq930x.c') diff --git a/drivers/media/video/gspca/sq930x.c b/drivers/media/video/gspca/sq930x.c index 3e4b0b94c70..74628eda7d9 100644 --- a/drivers/media/video/gspca/sq930x.c +++ b/drivers/media/video/gspca/sq930x.c @@ -687,10 +687,12 @@ static void cmos_probe(struct gspca_dev *gspca_dev) if (gspca_dev->usb_buf[0] != 0) break; } - if (i >= ARRAY_SIZE(probe_order)) + if (i >= ARRAY_SIZE(probe_order)) { err("Unknown sensor"); - else - sd->sensor = probe_order[i]; + gspca_dev->usb_err = -EINVAL; + return; + } + sd->sensor = probe_order[i]; } static void mt9v111_init(struct gspca_dev *gspca_dev) @@ -867,6 +869,9 @@ static int sd_init(struct gspca_dev *gspca_dev) */ reg_r(gspca_dev, SQ930_CTRL_GET_DEV_INFO, 8); + if (gspca_dev->usb_err < 0) + return gspca_dev->usb_err; + /* it returns: * 03 00 12 93 0b f6 c9 00 live! ultra * 03 00 07 93 0b f6 ca 00 live! ultra for notebook @@ -905,10 +910,10 @@ static int sd_init(struct gspca_dev *gspca_dev) else cmos_probe(gspca_dev); } - - PDEBUG(D_PROBE, "Sensor %s", sensor_tb[sd->sensor].name); - - global_init(sd, 1); + if (gspca_dev->usb_err >= 0) { + PDEBUG(D_PROBE, "Sensor %s", sensor_tb[sd->sensor].name); + global_init(sd, 1); + } return gspca_dev->usb_err; } -- cgit v1.2.3-70-g09d2 From efd3769269f2ef9a0ad452ea8298b3edcb2f5a62 Mon Sep 17 00:00:00 2001 From: Jean-François Moine Date: Sat, 25 Dec 2010 13:11:54 -0300 Subject: [media] gspca - sq930x: Some detected sensors are not handled yet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are OmniVision's OV7660 and OV9630. Don't register the webcam when they are found. Signed-off-by: Jean-François Moine Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/gspca/sq930x.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/media/video/gspca/sq930x.c') diff --git a/drivers/media/video/gspca/sq930x.c b/drivers/media/video/gspca/sq930x.c index 74628eda7d9..b1d771bc3f2 100644 --- a/drivers/media/video/gspca/sq930x.c +++ b/drivers/media/video/gspca/sq930x.c @@ -693,6 +693,13 @@ static void cmos_probe(struct gspca_dev *gspca_dev) return; } sd->sensor = probe_order[i]; + switch (sd->sensor) { + case SENSOR_OV7660: + case SENSOR_OV9630: + err("Sensor %s not yet treated", sensor_tb[sd->sensor].name); + gspca_dev->usb_err = -EINVAL; + break; + } } static void mt9v111_init(struct gspca_dev *gspca_dev) -- cgit v1.2.3-70-g09d2 From f2c5d92ecd4c69a4f86e76d19cb7663f2ebf4781 Mon Sep 17 00:00:00 2001 From: Jean-François Moine Date: Sat, 25 Dec 2010 13:19:59 -0300 Subject: [media] gspca - sq930x: Fix a bad comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jean-François Moine Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/gspca/sq930x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/video/gspca/sq930x.c') diff --git a/drivers/media/video/gspca/sq930x.c b/drivers/media/video/gspca/sq930x.c index b1d771bc3f2..a4a98811b9e 100644 --- a/drivers/media/video/gspca/sq930x.c +++ b/drivers/media/video/gspca/sq930x.c @@ -912,7 +912,7 @@ static int sd_init(struct gspca_dev *gspca_dev) if (sd->sensor == SENSOR_MI0360) { /* no sensor probe for icam tracer */ - if (gspca_dev->usb_buf[5] == 0xf6) /* if CMOS */ + if (gspca_dev->usb_buf[5] == 0xf6) /* if ccd */ sd->sensor = SENSOR_ICX098BQ; else cmos_probe(gspca_dev); -- cgit v1.2.3-70-g09d2