Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285700
b: refs/heads/master
c: 6807cfc
h: refs/heads/master
v: v3
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Jan 6, 2012
1 parent f65e1ea commit cea0306
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 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: c20d78cde37018caa0313469c9320424995cc489
refs/heads/master: 6807cfcb9ddb913e6d3d2c68f9a8bc1d1d94b87f
31 changes: 23 additions & 8 deletions trunk/drivers/media/video/pwc/pwc-v4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,18 +575,14 @@ static int pwc_s_input(struct file *file, void *fh, unsigned int i)
return i ? -EINVAL : 0;
}

static int pwc_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
static int pwc_g_volatile_ctrl_unlocked(struct v4l2_ctrl *ctrl)
{
struct pwc_device *pdev =
container_of(ctrl->handler, struct pwc_device, ctrl_handler);
int ret = 0;

mutex_lock(&pdev->udevlock);

if (!pdev->udev) {
ret = -ENODEV;
goto leave;
}
if (!pdev->udev)
return -ENODEV;

switch (ctrl->id) {
case V4L2_CID_AUTO_WHITE_BALANCE:
Expand Down Expand Up @@ -651,7 +647,17 @@ static int pwc_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
if (ret)
PWC_ERROR("g_ctrl %s error %d\n", ctrl->name, ret);

leave:
return ret;
}

static int pwc_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
{
struct pwc_device *pdev =
container_of(ctrl->handler, struct pwc_device, ctrl_handler);
int ret;

mutex_lock(&pdev->udevlock);
ret = pwc_g_volatile_ctrl_unlocked(ctrl);
mutex_unlock(&pdev->udevlock);
return ret;
}
Expand All @@ -669,6 +675,15 @@ static int pwc_set_awb(struct pwc_device *pdev)

if (pdev->auto_white_balance->val != awb_manual)
pdev->color_bal_valid = false; /* Force cache update */

/*
* If this is a preset, update our red / blue balance values
* so that events get generated for the new preset values
*/
if (pdev->auto_white_balance->val == awb_indoor ||
pdev->auto_white_balance->val == awb_outdoor ||
pdev->auto_white_balance->val == awb_fl)
pwc_g_volatile_ctrl_unlocked(pdev->auto_white_balance);
}
if (pdev->auto_white_balance->val != awb_manual)
return 0;
Expand Down

0 comments on commit cea0306

Please sign in to comment.