Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138025
b: refs/heads/master
c: 253bae5
h: refs/heads/master
i:
  138023: da1af3f
v: v3
  • Loading branch information
Jean-Francois Moine authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent d51db3b commit 4363192
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7434ca4343c001267cec25b0ade01b0551beb1e4
refs/heads/master: 253bae5748010e218539603f1ec18f7fc6a03002
23 changes: 13 additions & 10 deletions trunk/drivers/media/video/gspca/mars.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -247,9 +247,11 @@ static int sd_start(struct gspca_dev *gspca_dev)
data[0] = 0x5e; /* address */
data[1] = 0; /* reg 94, Y Gain (auto) */
/*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;

Expand Down Expand Up @@ -365,10 +367,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;
Expand Down

0 comments on commit 4363192

Please sign in to comment.