The patch number 10790 was added via Mauro Carvalho Chehab <mche...@redhat.com>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <linux-me...@vger.kernel.org>

------

From: Mauro Carvalho Chehab  <mche...@redhat.com>
merge: http://linuxtv.org/hg/~eandren/v4l-dvb


Priority: normal

Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com>


---

 linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c |    6 ++
 linux/drivers/media/video/gspca/mars.c               |   23 ++++++-----
 linux/drivers/media/video/gspca/vc032x.c             |    2 
 3 files changed, 19 insertions(+), 12 deletions(-)

diff -r c1318037610e -r 1b20206ceca3 
linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
--- a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c      Mon Mar 02 
10:06:24 2009 -0300
+++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c      Tue Mar 03 
21:32:23 2009 -0300
@@ -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)))
diff -r c1318037610e -r 1b20206ceca3 linux/drivers/media/video/gspca/mars.c
--- a/linux/drivers/media/video/gspca/mars.c    Mon Mar 02 10:06:24 2009 -0300
+++ b/linux/drivers/media/video/gspca/mars.c    Tue Mar 03 21:32:23 2009 -0300
@@ -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 *gs
        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 *gs
        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
 
        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;
diff -r c1318037610e -r 1b20206ceca3 linux/drivers/media/video/gspca/vc032x.c
--- a/linux/drivers/media/video/gspca/vc032x.c  Mon Mar 02 10:06:24 2009 -0300
+++ b/linux/drivers/media/video/gspca/vc032x.c  Tue Mar 03 21:32:23 2009 -0300
@@ -2316,7 +2316,7 @@ static int sd_start(struct gspca_dev *gs
                break;
        case SENSOR_MI1310_SOC:
                GammaT = mi1320_gamma;
-               MatrixT = mi0360_matrix;
+               MatrixT = mi1320_matrix;
                switch (mode) {
                case 1:
                        init = mi1310_socinitQVGA_JPG;  /* 320x240 */


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/1b20206ceca364a8a15fae6561965557fa3c7921

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to