aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2011-01-11 12:45:03 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-01-19 08:45:32 -0500
commit2a863793beaa0fc9ee7aeb87efe85544a6b129c0 (patch)
tree9316b12b95a707eb5541db2e24d6033d9b0e2805 /drivers/media
parent45f6f84af3ae9db19f39bc5d0976d626b0ef626e (diff)
[media] v4l2-ctrls: v4l2_ctrl_handler_setup must set is_new to 1
Renamed has_new to is_new. Drivers can use the is_new field to determine if a new value was specified for a control. The v4l2_ctrl_handler_setup() must always set this to 1 since the setup has to force a full update of all controls. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/v4l2-ctrls.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index 8f81efcfcf56..0d1a3d831374 100644
--- a/drivers/media/video/v4l2-ctrls.c
+++ b/drivers/media/video/v4l2-ctrls.c
@@ -569,7 +569,7 @@ static int user_to_new(struct v4l2_ext_control *c,
569 int ret; 569 int ret;
570 u32 size; 570 u32 size;
571 571
572 ctrl->has_new = 1; 572 ctrl->is_new = 1;
573 switch (ctrl->type) { 573 switch (ctrl->type) {
574 case V4L2_CTRL_TYPE_INTEGER64: 574 case V4L2_CTRL_TYPE_INTEGER64:
575 ctrl->val64 = c->value64; 575 ctrl->val64 = c->value64;
@@ -1280,8 +1280,12 @@ int v4l2_ctrl_handler_setup(struct v4l2_ctrl_handler *hdl)
1280 if (ctrl->done) 1280 if (ctrl->done)
1281 continue; 1281 continue;
1282 1282
1283 for (i = 0; i < master->ncontrols; i++) 1283 for (i = 0; i < master->ncontrols; i++) {
1284 cur_to_new(master->cluster[i]); 1284 if (master->cluster[i]) {
1285 cur_to_new(master->cluster[i]);
1286 master->cluster[i]->is_new = 1;
1287 }
1288 }
1285 1289
1286 /* Skip button controls and read-only controls. */ 1290 /* Skip button controls and read-only controls. */
1287 if (ctrl->type == V4L2_CTRL_TYPE_BUTTON || 1291 if (ctrl->type == V4L2_CTRL_TYPE_BUTTON ||
@@ -1645,7 +1649,7 @@ static int try_or_set_control_cluster(struct v4l2_ctrl *master, bool set)
1645 if (ctrl == NULL) 1649 if (ctrl == NULL)
1646 continue; 1650 continue;
1647 1651
1648 if (ctrl->has_new) { 1652 if (ctrl->is_new) {
1649 /* Double check this: it may have changed since the 1653 /* Double check this: it may have changed since the
1650 last check in try_or_set_ext_ctrls(). */ 1654 last check in try_or_set_ext_ctrls(). */
1651 if (set && (ctrl->flags & V4L2_CTRL_FLAG_GRABBED)) 1655 if (set && (ctrl->flags & V4L2_CTRL_FLAG_GRABBED))
@@ -1719,13 +1723,13 @@ static int try_or_set_ext_ctrls(struct v4l2_ctrl_handler *hdl,
1719 1723
1720 v4l2_ctrl_lock(ctrl); 1724 v4l2_ctrl_lock(ctrl);
1721 1725
1722 /* Reset the 'has_new' flags of the cluster */ 1726 /* Reset the 'is_new' flags of the cluster */
1723 for (j = 0; j < master->ncontrols; j++) 1727 for (j = 0; j < master->ncontrols; j++)
1724 if (master->cluster[j]) 1728 if (master->cluster[j])
1725 master->cluster[j]->has_new = 0; 1729 master->cluster[j]->is_new = 0;
1726 1730
1727 /* Copy the new caller-supplied control values. 1731 /* Copy the new caller-supplied control values.
1728 user_to_new() sets 'has_new' to 1. */ 1732 user_to_new() sets 'is_new' to 1. */
1729 ret = cluster_walk(i, cs, helpers, user_to_new); 1733 ret = cluster_walk(i, cs, helpers, user_to_new);
1730 1734
1731 if (!ret) 1735 if (!ret)
@@ -1822,13 +1826,13 @@ static int set_ctrl(struct v4l2_ctrl *ctrl, s32 *val)
1822 1826
1823 v4l2_ctrl_lock(ctrl); 1827 v4l2_ctrl_lock(ctrl);
1824 1828
1825 /* Reset the 'has_new' flags of the cluster */ 1829 /* Reset the 'is_new' flags of the cluster */
1826 for (i = 0; i < master->ncontrols; i++) 1830 for (i = 0; i < master->ncontrols; i++)
1827 if (master->cluster[i]) 1831 if (master->cluster[i])
1828 master->cluster[i]->has_new = 0; 1832 master->cluster[i]->is_new = 0;
1829 1833
1830 ctrl->val = *val; 1834 ctrl->val = *val;
1831 ctrl->has_new = 1; 1835 ctrl->is_new = 1;
1832 ret = try_or_set_control_cluster(master, false); 1836 ret = try_or_set_control_cluster(master, false);
1833 if (!ret) 1837 if (!ret)
1834 ret = try_or_set_control_cluster(master, true); 1838 ret = try_or_set_control_cluster(master, true);