Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113995
b: refs/heads/master
c: b1accfa
h: refs/heads/master
i:
  113993: f87f1ea
  113991: c1ecc84
v: v3
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed Oct 12, 2008
1 parent f34be76 commit 541e475
Show file tree
Hide file tree
Showing 2 changed files with 14 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: 5e26d50f4e6b9c42bbfbaa452722797ece929cda
refs/heads/master: b1accfa15533fdd40280aae3102e9599e63a7c10
21 changes: 13 additions & 8 deletions trunk/drivers/media/video/uvc/uvc_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,17 @@ static int uvc_ctrl_commit_entity(struct uvc_device *dev,

for (i = 0; i < entity->ncontrols; ++i) {
ctrl = &entity->controls[i];
if (ctrl->info == NULL || !ctrl->dirty)
if (ctrl->info == NULL)
continue;

/* Reset the loaded flag for auto-update controls that were
* marked as loaded in uvc_ctrl_get/uvc_ctrl_set to prevent
* uvc_ctrl_get from using the cached value.
*/
if (ctrl->info->flags & UVC_CONTROL_AUTO_UPDATE)
ctrl->loaded = 0;

if (!ctrl->dirty)
continue;

if (!rollback)
Expand All @@ -853,9 +863,6 @@ static int uvc_ctrl_commit_entity(struct uvc_device *dev,
uvc_ctrl_data(ctrl, UVC_CTRL_DATA_BACKUP),
ctrl->info->size);

if ((ctrl->info->flags & UVC_CONTROL_GET_CUR) == 0)
ctrl->loaded = 0;

ctrl->dirty = 0;

if (ret < 0)
Expand Down Expand Up @@ -913,8 +920,7 @@ int uvc_ctrl_get(struct uvc_video_device *video,
if (ret < 0)
return ret;

if ((ctrl->info->flags & UVC_CONTROL_AUTO_UPDATE) == 0)
ctrl->loaded = 1;
ctrl->loaded = 1;
}

xctrl->value = uvc_get_le_value(
Expand Down Expand Up @@ -965,8 +971,7 @@ int uvc_ctrl_set(struct uvc_video_device *video,
return ret;
}

if ((ctrl->info->flags & UVC_CONTROL_AUTO_UPDATE) == 0)
ctrl->loaded = 1;
ctrl->loaded = 1;
}

if (!ctrl->dirty) {
Expand Down

0 comments on commit 541e475

Please sign in to comment.