Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306221
b: refs/heads/master
c: df8b985
h: refs/heads/master
i:
  306219: 90b95f7
v: v3
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed May 7, 2012
1 parent 83d4fa2 commit 403316a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 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: 48bb7315f8205272c69fa49c732adb20b2f08614
refs/heads/master: df8b98538c7011c4c74bd2d678369825c66be86c
20 changes: 15 additions & 5 deletions trunk/drivers/media/video/gspca/pac7302.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
* 0 | 0xc7 | setbluebalance()
* 0 | 0xdc | setbrightcont(), setcolors()
* 3 | 0x02 | setexposure()
* 3 | 0x10 | setgain()
* 3 | 0x10, 0x12 | setgain()
* 3 | 0x11 | setcolors(), setgain(), setexposure(), sethvflip()
* 3 | 0x21 | sethvflip()
*/
Expand Down Expand Up @@ -212,10 +212,10 @@ static const struct ctrl sd_ctrls[] = {
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "Gain",
.minimum = 0,
.maximum = 255,
.maximum = 62,
.step = 1,
#define GAIN_DEF 127
#define GAIN_KNEE 255 /* Gain seems to cause little noise on the pac73xx */
#define GAIN_DEF 15
#define GAIN_KNEE 46
.default_value = GAIN_DEF,
},
.set_control = setgain
Expand Down Expand Up @@ -601,9 +601,19 @@ static void setbluebalance(struct gspca_dev *gspca_dev)
static void setgain(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
u8 reg10, reg12;

if (sd->ctrls[GAIN].val < 32) {
reg10 = sd->ctrls[GAIN].val;
reg12 = 0;
} else {
reg10 = 31;
reg12 = sd->ctrls[GAIN].val - 31;
}

reg_w(gspca_dev, 0xff, 0x03); /* page 3 */
reg_w(gspca_dev, 0x10, sd->ctrls[GAIN].val >> 3);
reg_w(gspca_dev, 0x10, reg10);
reg_w(gspca_dev, 0x12, reg12);

/* load registers to sensor (Bit 0, auto clear) */
reg_w(gspca_dev, 0x11, 0x01);
Expand Down

0 comments on commit 403316a

Please sign in to comment.