Lines Matching refs:ctrl

40 	struct v4l2_ctrl *ctrl;
1199 static void fill_event(struct v4l2_event *ev, struct v4l2_ctrl *ctrl, u32 changes)
1203 ev->id = ctrl->id;
1204 ev->u.ctrl.changes = changes;
1205 ev->u.ctrl.type = ctrl->type;
1206 ev->u.ctrl.flags = ctrl->flags;
1207 if (ctrl->is_ptr)
1208 ev->u.ctrl.value64 = 0;
1210 ev->u.ctrl.value64 = *ctrl->p_cur.p_s64;
1211 ev->u.ctrl.minimum = ctrl->minimum;
1212 ev->u.ctrl.maximum = ctrl->maximum;
1213 if (ctrl->type == V4L2_CTRL_TYPE_MENU
1214 || ctrl->type == V4L2_CTRL_TYPE_INTEGER_MENU)
1215 ev->u.ctrl.step = 1;
1217 ev->u.ctrl.step = ctrl->step;
1218 ev->u.ctrl.default_value = ctrl->default_value;
1221 static void send_event(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl, u32 changes)
1226 if (list_empty(&ctrl->ev_subs))
1228 fill_event(&ev, ctrl, changes);
1230 list_for_each_entry(sev, &ctrl->ev_subs, node)
1236 static bool std_equal(const struct v4l2_ctrl *ctrl, u32 idx,
1240 switch (ctrl->type) {
1244 idx *= ctrl->elem_size;
1256 if (ctrl->is_int)
1258 idx *= ctrl->elem_size;
1259 return !memcmp(ptr1.p + idx, ptr2.p + idx, ctrl->elem_size);
1263 static void std_init(const struct v4l2_ctrl *ctrl, u32 idx,
1266 switch (ctrl->type) {
1268 idx *= ctrl->elem_size;
1269 memset(ptr.p_char + idx, ' ', ctrl->minimum);
1270 ptr.p_char[idx + ctrl->minimum] = '\0';
1273 ptr.p_s64[idx] = ctrl->default_value;
1280 ptr.p_s32[idx] = ctrl->default_value;
1283 ptr.p_u8[idx] = ctrl->default_value;
1286 ptr.p_u16[idx] = ctrl->default_value;
1289 ptr.p_u32[idx] = ctrl->default_value;
1292 idx *= ctrl->elem_size;
1293 memset(ptr.p + idx, 0, ctrl->elem_size);
1298 static void std_log(const struct v4l2_ctrl *ctrl)
1300 union v4l2_ctrl_ptr ptr = ctrl->p_cur;
1302 if (ctrl->is_array) {
1305 for (i = 0; i < ctrl->nr_of_dims; i++)
1306 pr_cont("[%u]", ctrl->dims[i]);
1310 switch (ctrl->type) {
1318 pr_cont("%s", ctrl->qmenu[*ptr.p_s32]);
1321 pr_cont("%lld", ctrl->qmenu_int[*ptr.p_s32]);
1342 pr_cont("unknown type %d", ctrl->type);
1352 #define ROUND_TO_RANGE(val, offset_type, ctrl) \
1355 if ((ctrl)->maximum >= 0 && \
1356 val >= (ctrl)->maximum - (s32)((ctrl)->step / 2)) \
1357 val = (ctrl)->maximum; \
1359 val += (s32)((ctrl)->step / 2); \
1361 (ctrl)->minimum, (ctrl)->maximum); \
1362 offset = (val) - (ctrl)->minimum; \
1363 offset = (ctrl)->step * (offset / (u32)(ctrl)->step); \
1364 val = (ctrl)->minimum + offset; \
1369 static int std_validate(const struct v4l2_ctrl *ctrl, u32 idx,
1376 switch (ctrl->type) {
1378 return ROUND_TO_RANGE(ptr.p_s32[idx], u32, ctrl);
1385 if (ctrl->maximum >= 0 && val >= ctrl->maximum - (s64)(ctrl->step / 2))
1386 val = ctrl->maximum;
1388 val += (s64)(ctrl->step / 2);
1389 val = clamp_t(s64, val, ctrl->minimum, ctrl->maximum);
1390 offset = val - ctrl->minimum;
1391 do_div(offset, ctrl->step);
1392 ptr.p_s64[idx] = ctrl->minimum + offset * ctrl->step;
1395 return ROUND_TO_RANGE(ptr.p_u8[idx], u8, ctrl);
1397 return ROUND_TO_RANGE(ptr.p_u16[idx], u16, ctrl);
1399 return ROUND_TO_RANGE(ptr.p_u32[idx], u32, ctrl);
1407 if (ptr.p_s32[idx] < ctrl->minimum || ptr.p_s32[idx] > ctrl->maximum)
1409 if (ctrl->menu_skip_mask & (1 << ptr.p_s32[idx]))
1411 if (ctrl->type == V4L2_CTRL_TYPE_MENU &&
1412 ctrl->qmenu[ptr.p_s32[idx]][0] == '\0')
1417 ptr.p_s32[idx] &= ctrl->maximum;
1426 idx *= ctrl->elem_size;
1428 if (len < ctrl->minimum)
1430 if ((len - (u32)ctrl->minimum) % (u32)ctrl->step)
1448 struct v4l2_ctrl *ctrl,
1453 if (ctrl->is_ptr && !ctrl->is_string)
1457 switch (ctrl->type) {
1461 c->size = ctrl->elem_size;
1478 struct v4l2_ctrl *ctrl)
1480 return ptr_to_user(c, ctrl, ctrl->p_cur);
1485 struct v4l2_ctrl *ctrl)
1487 return ptr_to_user(c, ctrl, ctrl->p_new);
1492 struct v4l2_ctrl *ctrl,
1498 ctrl->is_new = 1;
1499 if (ctrl->is_ptr && !ctrl->is_string) {
1503 if (ret || !ctrl->is_array)
1505 for (idx = c->size / ctrl->elem_size; idx < ctrl->elems; idx++)
1506 ctrl->type_ops->init(ctrl, idx, ptr);
1510 switch (ctrl->type) {
1518 if (size > ctrl->maximum + 1)
1519 size = ctrl->maximum + 1;
1525 /* If the string was longer than ctrl->maximum,
1527 if (strlen(ptr.p_char) == ctrl->maximum && last)
1540 struct v4l2_ctrl *ctrl)
1542 return user_to_ptr(c, ctrl, ctrl->p_new);
1546 static void ptr_to_ptr(struct v4l2_ctrl *ctrl,
1549 if (ctrl == NULL)
1551 memcpy(to.p, from.p, ctrl->elems * ctrl->elem_size);
1555 static void new_to_cur(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl, u32 ch_flags)
1559 if (ctrl == NULL)
1563 changed = ctrl->has_changed;
1565 ptr_to_ptr(ctrl, ctrl->p_new, ctrl->p_cur);
1569 ctrl->flags &=
1571 if (!is_cur_manual(ctrl->cluster[0])) {
1572 ctrl->flags |= V4L2_CTRL_FLAG_INACTIVE;
1573 if (ctrl->cluster[0]->has_volatiles)
1574 ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE;
1581 if (!ctrl->is_new)
1583 send_event(fh, ctrl,
1585 if (ctrl->call_notify && changed && ctrl->handler->notify)
1586 ctrl->handler->notify(ctrl, ctrl->handler->notify_priv);
1591 static void cur_to_new(struct v4l2_ctrl *ctrl)
1593 if (ctrl == NULL)
1595 ptr_to_ptr(ctrl, ctrl->p_cur, ctrl->p_new);
1607 struct v4l2_ctrl *ctrl = master->cluster[i];
1610 if (ctrl == NULL)
1612 for (idx = 0; !ctrl_changed && idx < ctrl->elems; idx++)
1613 ctrl_changed = !ctrl->type_ops->equal(ctrl, idx,
1614 ctrl->p_cur, ctrl->p_new);
1615 ctrl->has_changed = ctrl_changed;
1616 changed |= ctrl->has_changed;
1661 static int validate_new(const struct v4l2_ctrl *ctrl,
1668 if (!ctrl->is_ptr) {
1669 switch (ctrl->type) {
1678 return ctrl->type_ops->validate(ctrl, 0, ptr);
1682 return ctrl->type_ops->validate(ctrl, 0, ptr);
1688 for (idx = 0; !err && idx < c->size / ctrl->elem_size; idx++)
1689 err = ctrl->type_ops->validate(ctrl, idx, ptr);
1695 return list_entry(node, struct v4l2_ctrl_ref, node)->ctrl->id;
1728 struct v4l2_ctrl *ctrl, *next_ctrl;
1741 list_for_each_entry_safe(ctrl, next_ctrl, &hdl->ctrls, node) {
1742 list_del(&ctrl->node);
1743 list_for_each_entry_safe(sev, next_sev, &ctrl->ev_subs, node)
1745 kfree(ctrl);
1770 if (V4L2_CTRL_ID2CLASS(ref->ctrl->id) == V4L2_CTRL_CLASS_USER &&
1771 V4L2_CTRL_DRIVER_PRIV(ref->ctrl->id)) {
1772 if (!ref->ctrl->is_int)
1796 if (hdl->cached && hdl->cached->ctrl->id == id)
1801 while (ref && ref->ctrl->id != id)
1828 return ref ? ref->ctrl : NULL;
1834 struct v4l2_ctrl *ctrl)
1838 u32 id = ctrl->id;
1846 if (ctrl->type < V4L2_CTRL_COMPOUND_TYPES &&
1857 new_ref->ctrl = ctrl;
1858 if (ctrl->handler == hdl) {
1860 new_ref->ctrl is basically a cluster array with one
1863 ctrl->cluster = &new_ref->ctrl;
1864 ctrl->ncontrols = 1;
1882 if (ref->ctrl->id < id)
1885 if (ref->ctrl->id == id) {
1913 struct v4l2_ctrl *ctrl;
1993 ctrl = kzalloc(sizeof(*ctrl) + sz_extra, GFP_KERNEL);
1994 if (ctrl == NULL) {
1999 INIT_LIST_HEAD(&ctrl->node);
2000 INIT_LIST_HEAD(&ctrl->ev_subs);
2001 ctrl->handler = hdl;
2002 ctrl->ops = ops;
2003 ctrl->type_ops = type_ops ? type_ops : &std_type_ops;
2004 ctrl->id = id;
2005 ctrl->name = name;
2006 ctrl->type = type;
2007 ctrl->flags = flags;
2008 ctrl->minimum = min;
2009 ctrl->maximum = max;
2010 ctrl->step = step;
2011 ctrl->default_value = def;
2012 ctrl->is_string = !is_array && type == V4L2_CTRL_TYPE_STRING;
2013 ctrl->is_ptr = is_array || type >= V4L2_CTRL_COMPOUND_TYPES || ctrl->is_string;
2014 ctrl->is_int = !ctrl->is_ptr && type != V4L2_CTRL_TYPE_INTEGER64;
2015 ctrl->is_array = is_array;
2016 ctrl->elems = elems;
2017 ctrl->nr_of_dims = nr_of_dims;
2019 memcpy(ctrl->dims, dims, nr_of_dims * sizeof(dims[0]));
2020 ctrl->elem_size = elem_size;
2022 ctrl->qmenu = qmenu;
2024 ctrl->qmenu_int = qmenu_int;
2025 ctrl->priv = priv;
2026 ctrl->cur.val = ctrl->val = def;
2027 data = &ctrl[1];
2029 if (!ctrl->is_int) {
2030 ctrl->p_new.p = data;
2031 ctrl->p_cur.p = data + tot_ctrl_size;
2033 ctrl->p_new.p = &ctrl->val;
2034 ctrl->p_cur.p = &ctrl->cur.val;
2037 ctrl->type_ops->init(ctrl, idx, ctrl->p_cur);
2038 ctrl->type_ops->init(ctrl, idx, ctrl->p_new);
2041 if (handler_new_ref(hdl, ctrl)) {
2042 kfree(ctrl);
2046 list_add_tail(&ctrl->node, &hdl->ctrls);
2048 return ctrl;
2055 struct v4l2_ctrl *ctrl;
2084 ctrl = v4l2_ctrl_new(hdl, cfg->ops, cfg->type_ops, cfg->id, name,
2089 if (ctrl)
2090 ctrl->is_private = cfg->is_private;
2091 return ctrl;
2209 struct v4l2_ctrl *ctrl)
2213 if (ctrl == NULL) {
2217 if (ctrl->handler == hdl)
2218 return ctrl;
2219 return handler_new_ref(hdl, ctrl) ? NULL : ctrl;
2226 bool (*filter)(const struct v4l2_ctrl *ctrl))
2238 struct v4l2_ctrl *ctrl = ref->ctrl;
2241 if (ctrl->is_private)
2244 if (ctrl->type == V4L2_CTRL_TYPE_CTRL_CLASS)
2247 if (filter && !filter(ctrl))
2249 ret = handler_new_ref(hdl, ctrl);
2258 bool v4l2_ctrl_radio_filter(const struct v4l2_ctrl *ctrl)
2260 if (V4L2_CTRL_ID2CLASS(ctrl->id) == V4L2_CTRL_CLASS_FM_TX)
2262 if (V4L2_CTRL_ID2CLASS(ctrl->id) == V4L2_CTRL_CLASS_FM_RX)
2264 switch (ctrl->id) {
2328 void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active)
2334 if (ctrl == NULL)
2339 old = test_and_set_bit(4, &ctrl->flags);
2342 old = test_and_clear_bit(4, &ctrl->flags);
2344 send_event(NULL, ctrl, V4L2_EVENT_CTRL_CH_FLAGS);
2354 void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed)
2358 if (ctrl == NULL)
2361 v4l2_ctrl_lock(ctrl);
2364 old = test_and_set_bit(1, &ctrl->flags);
2367 old = test_and_clear_bit(1, &ctrl->flags);
2369 send_event(NULL, ctrl, V4L2_EVENT_CTRL_CH_FLAGS);
2370 v4l2_ctrl_unlock(ctrl);
2375 static void log_ctrl(const struct v4l2_ctrl *ctrl,
2378 if (ctrl->flags & (V4L2_CTRL_FLAG_DISABLED | V4L2_CTRL_FLAG_WRITE_ONLY))
2380 if (ctrl->type == V4L2_CTRL_TYPE_CTRL_CLASS)
2383 pr_info("%s%s%s: ", prefix, colon, ctrl->name);
2385 ctrl->type_ops->log(ctrl);
2387 if (ctrl->flags & (V4L2_CTRL_FLAG_INACTIVE |
2390 if (ctrl->flags & V4L2_CTRL_FLAG_INACTIVE)
2392 if (ctrl->flags & V4L2_CTRL_FLAG_GRABBED)
2394 if (ctrl->flags & V4L2_CTRL_FLAG_VOLATILE)
2404 struct v4l2_ctrl *ctrl;
2416 list_for_each_entry(ctrl, &hdl->ctrls, node)
2417 if (!(ctrl->flags & V4L2_CTRL_FLAG_DISABLED))
2418 log_ctrl(ctrl, prefix, colon);
2433 struct v4l2_ctrl *ctrl;
2439 list_for_each_entry(ctrl, &hdl->ctrls, node)
2440 ctrl->done = false;
2442 list_for_each_entry(ctrl, &hdl->ctrls, node) {
2443 struct v4l2_ctrl *master = ctrl->cluster[0];
2448 if (ctrl->done || ctrl->type == V4L2_CTRL_TYPE_BUTTON ||
2449 (ctrl->flags & V4L2_CTRL_FLAG_READ_ONLY))
2474 struct v4l2_ctrl *ctrl;
2508 ref->ctrl->type >= V4L2_CTRL_COMPOUND_TYPES;
2509 if (id < ref->ctrl->id &&
2522 ref->ctrl->type >= V4L2_CTRL_COMPOUND_TYPES;
2523 if (id < ref->ctrl->id &&
2536 ctrl = ref->ctrl;
2541 qc->id = ctrl->id;
2542 strlcpy(qc->name, ctrl->name, sizeof(qc->name));
2543 qc->flags = ctrl->flags;
2544 qc->type = ctrl->type;
2545 if (ctrl->is_ptr)
2547 qc->elem_size = ctrl->elem_size;
2548 qc->elems = ctrl->elems;
2549 qc->nr_of_dims = ctrl->nr_of_dims;
2550 memcpy(qc->dims, ctrl->dims, qc->nr_of_dims * sizeof(qc->dims[0]));
2551 qc->minimum = ctrl->minimum;
2552 qc->maximum = ctrl->maximum;
2553 qc->default_value = ctrl->default_value;
2554 if (ctrl->type == V4L2_CTRL_TYPE_MENU
2555 || ctrl->type == V4L2_CTRL_TYPE_INTEGER_MENU)
2558 qc->step = ctrl->step;
2611 struct v4l2_ctrl *ctrl;
2614 ctrl = v4l2_ctrl_find(hdl, qm->id);
2615 if (!ctrl)
2620 switch (ctrl->type) {
2622 if (ctrl->qmenu == NULL)
2626 if (ctrl->qmenu_int == NULL)
2633 if (i < ctrl->minimum || i > ctrl->maximum)
2637 if (ctrl->menu_skip_mask & (1 << i))
2640 if (ctrl->type == V4L2_CTRL_TYPE_MENU) {
2641 if (ctrl->qmenu[i] == NULL || ctrl->qmenu[i][0] == '\0')
2643 strlcpy(qm->name, ctrl->qmenu[i], sizeof(qm->name));
2645 qm->value = ctrl->qmenu_int[i];
2712 struct v4l2_ctrl *ctrl;
2727 ctrl = ref->ctrl;
2728 if (ctrl->flags & V4L2_CTRL_FLAG_DISABLED)
2731 if (ctrl->cluster[0]->ncontrols > 1)
2733 if (ctrl->cluster[0] != ctrl)
2734 ref = find_ref_lock(hdl, ctrl->cluster[0]->id);
2735 if (ctrl->is_ptr && !ctrl->is_string) {
2736 unsigned tot_size = ctrl->elems * ctrl->elem_size;
2749 h->ctrl = ctrl;
2831 if (helpers[i].ctrl->flags & V4L2_CTRL_FLAG_WRITE_ONLY)
2836 struct v4l2_ctrl *ctrl) = cur_to_user;
2842 master = helpers[i].mref->ctrl;
2863 helpers[idx].ctrl);
2883 static int get_ctrl(struct v4l2_ctrl *ctrl, struct v4l2_ext_control *c)
2885 struct v4l2_ctrl *master = ctrl->cluster[0];
2893 if (!ctrl->is_int)
2896 if (ctrl->flags & V4L2_CTRL_FLAG_WRITE_ONLY)
2901 if (ctrl->flags & V4L2_CTRL_FLAG_VOLATILE) {
2905 new_to_user(c, ctrl);
2907 cur_to_user(c, ctrl);
2915 struct v4l2_ctrl *ctrl = v4l2_ctrl_find(hdl, control->id);
2919 if (ctrl == NULL || !ctrl->is_int)
2921 ret = get_ctrl(ctrl, &c);
2933 s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl)
2938 WARN_ON(!ctrl->is_int);
2940 get_ctrl(ctrl, &c);
2945 s64 v4l2_ctrl_g_ctrl_int64(struct v4l2_ctrl *ctrl)
2950 WARN_ON(ctrl->is_ptr || ctrl->type != V4L2_CTRL_TYPE_INTEGER64);
2952 get_ctrl(ctrl, &c);
2960 Must be called with ctrl->handler->lock held. */
2973 struct v4l2_ctrl *ctrl = master->cluster[i];
2975 if (ctrl == NULL)
2978 if (!ctrl->is_new) {
2979 cur_to_new(ctrl);
2984 if (set && (ctrl->flags & V4L2_CTRL_FLAG_GRABBED))
3014 struct v4l2_ctrl *ctrl = helpers[i].ctrl;
3018 if (ctrl->flags & V4L2_CTRL_FLAG_READ_ONLY)
3026 if (set && (ctrl->flags & V4L2_CTRL_FLAG_GRABBED))
3028 ret = validate_new(ctrl, &cs->controls[i]);
3087 master = helpers[i].mref->ctrl;
3110 if (helpers[tmp_idx].ctrl == master)
3123 ret = user_to_new(cs->controls + idx, helpers[idx].ctrl);
3135 helpers[idx].ctrl);
3173 static int set_ctrl(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl,
3176 struct v4l2_ctrl *master = ctrl->cluster[0];
3185 user_to_new(c, ctrl);
3190 if (master->is_auto && master->has_volatiles && ctrl == master &&
3191 !is_cur_manual(master) && ctrl->val == master->manual_mode_value)
3194 ctrl->is_new = 1;
3199 static int set_ctrl_lock(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl,
3202 int ret = validate_new(ctrl, c);
3205 v4l2_ctrl_lock(ctrl);
3206 ret = set_ctrl(fh, ctrl, c, 0);
3208 cur_to_user(c, ctrl);
3209 v4l2_ctrl_unlock(ctrl);
3217 struct v4l2_ctrl *ctrl = v4l2_ctrl_find(hdl, control->id);
3221 if (ctrl == NULL || !ctrl->is_int)
3224 if (ctrl->flags & V4L2_CTRL_FLAG_READ_ONLY)
3228 ret = set_ctrl_lock(fh, ctrl, &c);
3240 int __v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val)
3242 lockdep_assert_held(ctrl->handler->lock);
3245 WARN_ON(!ctrl->is_int);
3246 ctrl->val = val;
3247 return set_ctrl(NULL, ctrl, NULL, 0);
3251 int __v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val)
3253 lockdep_assert_held(ctrl->handler->lock);
3256 WARN_ON(ctrl->is_ptr || ctrl->type != V4L2_CTRL_TYPE_INTEGER64);
3257 *ctrl->p_new.p_s64 = val;
3258 return set_ctrl(NULL, ctrl, NULL, 0);
3262 int __v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char *s)
3264 lockdep_assert_held(ctrl->handler->lock);
3267 WARN_ON(ctrl->type != V4L2_CTRL_TYPE_STRING);
3268 strlcpy(ctrl->p_new.p_char, s, ctrl->maximum + 1);
3269 return set_ctrl(NULL, ctrl, NULL, 0);
3273 void v4l2_ctrl_notify(struct v4l2_ctrl *ctrl, v4l2_ctrl_notify_fnc notify, void *priv)
3275 if (ctrl == NULL)
3278 ctrl->call_notify = 0;
3281 if (WARN_ON(ctrl->handler->notify && ctrl->handler->notify != notify))
3283 ctrl->handler->notify = notify;
3284 ctrl->handler->notify_priv = priv;
3285 ctrl->call_notify = 1;
3289 int __v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl,
3295 lockdep_assert_held(ctrl->handler->lock);
3297 switch (ctrl->type) {
3307 if (ctrl->is_array)
3309 ret = check_range(ctrl->type, min, max, step, def);
3316 ctrl->minimum = min;
3317 ctrl->maximum = max;
3318 ctrl->step = step;
3319 ctrl->default_value = def;
3320 c.value = *ctrl->p_cur.p_s32;
3321 if (validate_new(ctrl, &c))
3323 if (c.value != *ctrl->p_cur.p_s32)
3324 ret = set_ctrl(NULL, ctrl, &c, V4L2_EVENT_CTRL_CH_RANGE);
3326 send_event(NULL, ctrl, V4L2_EVENT_CTRL_CH_RANGE);
3333 struct v4l2_ctrl *ctrl = v4l2_ctrl_find(sev->fh->ctrl_handler, sev->id);
3335 if (ctrl == NULL)
3338 v4l2_ctrl_lock(ctrl);
3339 list_add_tail(&sev->node, &ctrl->ev_subs);
3340 if (ctrl->type != V4L2_CTRL_TYPE_CTRL_CLASS &&
3345 if (!(ctrl->flags & V4L2_CTRL_FLAG_WRITE_ONLY))
3347 fill_event(&ev, ctrl, changes);
3353 v4l2_ctrl_unlock(ctrl);
3359 struct v4l2_ctrl *ctrl = v4l2_ctrl_find(sev->fh->ctrl_handler, sev->id);
3361 v4l2_ctrl_lock(ctrl);
3363 v4l2_ctrl_unlock(ctrl);
3368 u32 old_changes = old->u.ctrl.changes;
3370 old->u.ctrl = new->u.ctrl;
3371 old->u.ctrl.changes |= old_changes;
3377 new->u.ctrl.changes |= old->u.ctrl.changes;