summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca/sonixj.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-08-18 11:45:13 +0200
committerJean-Francois Moine <moinejf@free.fr>2008-08-18 11:45:13 +0200
commit353199b76b1499244bd79cbfc66efed0bac94e95 (patch)
tree46682993fc05c6a42fa536fe9d1b63ec39b53c28 /linux/drivers/media/video/gspca/sonixj.c
parent6bcdd562d2f7ec79396f4717d2a108b6dcafe597 (diff)
downloadmediapointer-dvb-s2-353199b76b1499244bd79cbfc66efed0bac94e95.tar.gz
mediapointer-dvb-s2-353199b76b1499244bd79cbfc66efed0bac94e95.tar.bz2
gspca: Bad color control in sonixj.
From: Jean-Francois Moine <moinejf@free.fr> Priority: high Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers/media/video/gspca/sonixj.c')
-rw-r--r--linux/drivers/media/video/gspca/sonixj.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/linux/drivers/media/video/gspca/sonixj.c b/linux/drivers/media/video/gspca/sonixj.c
index 8cf5d60d3..8a42d2a4f 100644
--- a/linux/drivers/media/video/gspca/sonixj.c
+++ b/linux/drivers/media/video/gspca/sonixj.c
@@ -814,7 +814,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);
@@ -1091,7 +1091,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;
}
@@ -1173,11 +1173,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)