From: Jean-Francois Moine Date: Wed, 3 Sep 2008 19:48:01 +0000 (-0300) Subject: V4L/DVB (8710): gspca: Bad color control in sonixj. X-Git-Tag: v2.6.27-rc6~37^2~4^2~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d55b83d3c4558d0d118bf20ef3f1fa65b1c75c3d;p=platform%2Fkernel%2Flinux-3.10.git V4L/DVB (8710): gspca: Bad color control in sonixj. Signed-off-by: Jean-Francois Moine Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index b17aaa4..c34e02d 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c @@ -794,7 +794,7 @@ static int configure_gpio(struct gspca_dev *gspca_dev, switch (sd->sensor) { case SENSOR_OM6802: - reg_w1(gspca_dev, 0x02, 0x71); + reg_w1(gspca_dev, 0x02, 0x73); /* was 71 */ reg_w1(gspca_dev, 0x01, 0x42); reg_w1(gspca_dev, 0x17, 0x64); reg_w1(gspca_dev, 0x01, 0x42); @@ -1056,7 +1056,7 @@ static unsigned int setexposure(struct gspca_dev *gspca_dev, expo = 0x0001; gainOm[3] = expo >> 2; i2c_w8(gspca_dev, gainOm); - reg_w1(gspca_dev, 0x96, expo >> 5); + reg_w1(gspca_dev, 0x96, (expo >> 5) & 0x1f); PDEBUG(D_CONF, "set exposure %d", gainOm[3]); break; } @@ -1138,11 +1138,13 @@ static void setcolors(struct gspca_dev *gspca_dev) int colour; colour = sd->colors - 128; - if (colour > 0) + if (colour > 0) { data = (colour + 32) & 0x7f; /* blue */ - else + reg_w1(gspca_dev, 0x06, data); + } else { data = (-colour + 32) & 0x7f; /* red */ - reg_w1(gspca_dev, 0x05, data); + reg_w1(gspca_dev, 0x05, data); + } } static void setautogain(struct gspca_dev *gspca_dev)