Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242084
b: refs/heads/master
c: f0baad8
h: refs/heads/master
v: v3
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Mar 22, 2011
1 parent e4d271e commit ed8c8ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 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: f51a8caafedfc643b3dfa2ffdfb02da31a13db3f
refs/heads/master: f0baad866b3c71d448747b06b1cf6b3493d2f7ce
14 changes: 12 additions & 2 deletions trunk/drivers/media/video/gspca/sonixb.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ static const struct ctrl sd_ctrls[NCTRLS] = {
.step = 1,
#define AUTOGAIN_DEF 1
.default_value = AUTOGAIN_DEF,
.flags = 0,
.flags = V4L2_CTRL_FLAG_UPDATE
},
.set = sd_setautogain,
},
Expand Down Expand Up @@ -1008,7 +1008,8 @@ static void do_autogain(struct gspca_dev *gspca_dev)
struct sd *sd = (struct sd *) gspca_dev;
int avg_lum = atomic_read(&sd->avg_lum);

if (avg_lum == -1 || !sd->ctrls[AUTOGAIN].val)
if ((gspca_dev->ctrl_dis & (1 << AUTOGAIN)) ||
avg_lum == -1 || !sd->ctrls[AUTOGAIN].val)
return;

if (sd->autogain_ignore_frames > 0) {
Expand Down Expand Up @@ -1062,6 +1063,10 @@ static int sd_config(struct gspca_dev *gspca_dev,
sd->bridge = id->driver_info & 0xff;

gspca_dev->ctrl_dis = sensor_data[sd->sensor].ctrl_dis;
#if AUTOGAIN_DEF
if (!(gspca_dev->ctrl_dis & (1 << AUTOGAIN)))
gspca_dev->ctrl_inac = (1 << GAIN) | (1 << EXPOSURE);
#endif

cam = &gspca_dev->cam;
cam->ctrls = sd->ctrls;
Expand Down Expand Up @@ -1400,6 +1405,11 @@ static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val)
}
}

if (sd->ctrls[AUTOGAIN].val)
gspca_dev->ctrl_inac = (1 << GAIN) | (1 << EXPOSURE);
else
gspca_dev->ctrl_inac = 0;

return 0;
}

Expand Down

0 comments on commit ed8c8ed

Please sign in to comment.