From da03bb58104d244cbf33a6672940e8c52a06ce5b Mon Sep 17 00:00:00 2001 From: Jean-Francois Moine Date: Sat, 28 Feb 2009 12:09:24 +0100 Subject: gspca - mars: Bad webcam register values tied to saturation. From: Jean-Francois Moine Priority: normal Signed-off-by: Jean-Francois Moine --- linux/drivers/media/video/gspca/mars.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'linux/drivers') diff --git a/linux/drivers/media/video/gspca/mars.c b/linux/drivers/media/video/gspca/mars.c index c5a19b5bc..5d54893eb 100644 --- a/linux/drivers/media/video/gspca/mars.c +++ b/linux/drivers/media/video/gspca/mars.c @@ -69,10 +69,10 @@ static struct ctrl sd_ctrls[] = { .id = V4L2_CID_SATURATION, .type = V4L2_CTRL_TYPE_INTEGER, .name = "Color", - .minimum = 0, - .maximum = 220, + .minimum = 1, + .maximum = 255, .step = 1, -#define COLOR_DEF 190 +#define COLOR_DEF 200 .default_value = COLOR_DEF, }, .set = sd_setcolors, @@ -191,7 +191,7 @@ static int sd_start(struct gspca_dev *gspca_dev) struct sd *sd = (struct sd *) gspca_dev; int err_code; u8 *data; - int i, val; + int i; data = gspca_dev->usb_buf; @@ -253,9 +253,11 @@ static int sd_start(struct gspca_dev *gspca_dev) data[1] = 0; /* reg 94, Y Gain (auto) */ #if 1 /*jfm: from win trace*/ - val = sd->colors * 0x40 + 0x400; - data[2] = val; /* reg 0x5f/0x60 (LE) = saturation */ - data[3] = val >> 8; + /* reg 0x5f/0x60 (LE) = saturation */ + /* h (60): xxxx x100 + * l (5f): xxxx x000 */ + data[2] = sd->colors << 3; + data[3] = ((sd->colors >> 2) & 0xf8) | 0x04; data[4] = sd->brightness; /* reg 0x61 = brightness */ data[5] = 0x00; #else @@ -403,10 +405,11 @@ static int sd_setcolors(struct gspca_dev *gspca_dev, __s32 val) sd->colors = val; if (gspca_dev->streaming) { - val = val * 0x40 + 0x400; + + /* see sd_start */ gspca_dev->usb_buf[0] = 0x5f; - gspca_dev->usb_buf[1] = val; - gspca_dev->usb_buf[2] = val >> 8; + gspca_dev->usb_buf[1] = sd->colors << 3; + gspca_dev->usb_buf[2] = ((sd->colors >> 2) & 0xf8) | 0x04; reg_w(gspca_dev, 3); } return 0; -- cgit v1.2.3 From 675a1a53c3d2ca166e3fe921f4f23c2d0f42e5e4 Mon Sep 17 00:00:00 2001 From: Jean-Francois Moine Date: Sat, 28 Feb 2009 12:23:25 +0100 Subject: gspca - vc032x: Bad matrix for sensor mi1310_soc. From: Jean-Francois Moine Priority: normal Signed-off-by: Jean-Francois Moine --- linux/drivers/media/video/gspca/vc032x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux/drivers') diff --git a/linux/drivers/media/video/gspca/vc032x.c b/linux/drivers/media/video/gspca/vc032x.c index 72cbf56c9..f1c149476 100644 --- a/linux/drivers/media/video/gspca/vc032x.c +++ b/linux/drivers/media/video/gspca/vc032x.c @@ -2316,7 +2316,7 @@ static int sd_start(struct gspca_dev *gspca_dev) break; case SENSOR_MI1310_SOC: GammaT = mi1320_gamma; - MatrixT = mi0360_matrix; + MatrixT = mi1320_matrix; switch (mode) { case 1: init = mi1310_socinitQVGA_JPG; /* 320x240 */ -- cgit v1.2.3 From 3b38addc33a36ea34a73f3f910df0901feb4ff1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Andr=C3=A9n?= Date: Sun, 22 Feb 2009 21:54:11 +0100 Subject: m5602-s5k4aa: Split up the initial sensor probe in chunks. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Gregory Lardiere The previous probe rotine tried to read 6 bytes in one chunk which currently isn't allowed. This is the rev. 10346 243399e67c41 readded with a high priority. Priority: high Signed-off-by: Gregory Lardiere Signed-off-by: Erik Andrén --- linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'linux/drivers') diff --git a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c index 2bd7d4d99..7e79f7eca 100644 --- a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c +++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c @@ -104,7 +104,11 @@ int s5k4aa_probe(struct sd *sd) } /* Test some registers, but we don't know their exact meaning yet */ - if (m5602_read_sensor(sd, 0x00, prod_id, sizeof(prod_id))) + if (m5602_read_sensor(sd, 0x00, prod_id, 2)) + return -ENODEV; + if (m5602_read_sensor(sd, 0x02, prod_id+2, 2)) + return -ENODEV; + if (m5602_read_sensor(sd, 0x04, prod_id+4, 2)) return -ENODEV; if (memcmp(prod_id, expected_prod_id, sizeof(prod_id))) -- cgit v1.2.3