v4l2_ctrl_modify_range(9)
π v4l2_ctrl_modify_range β Kernel API Manual vibes π
okay so bestie, you know how a control has a range and normally you just... set it once and move on? yeah. this is NOT that. this is the glow-up-in-place function. welcome to the Kernel API Manual page for v4l2_ctrl_modify_range, she's iconic, she's a 9-section girly, let's go β¨
πΈ NAME πΈ
v4l2_ctrl_modify_range β update the range of a control. that's it. that's the whole name. short, sweet, main character energy π
π¦ SYNOPSIS π¦
int v4l2_ctrl_modify_range (struct v4l2_ctrl *ctrl , s64 min , s64 max ,
u64 step , s64 def );
like, exactly that, don't come for me about the spacing, I copied it verbatim, that's the whole point π«Ά
π ARGUMENTS π
ctrlβ the control you're updating. the one getting the makeover. the it-girl of this function πminβ the control's minimum value. the floor, the absolute lowest she can go πmaxβ the control's maximum value. the ceiling. sky's the limit (no, literally, this is the limit) βstepβ the control's step value. the increments, the little baby steps π©°defβ the control's default value. the fallback, the "factory settings" reset button π
β¨ DESCRIPTION β¨
so bestie, what this does is update the range of a control on the fly. like, live, in real time, no reboot, no drama, no "please reinitialize your handler". she just changes it. lowkey obsessed.
this works for these control types, and I need you to remember all of them because I refuse to leave anyone out: INTEGER, BOOLEAN, MENU, INTEGER MENU and BITMASK. those five. periodt.
π¨ quick heads-up for the menu girlies: for menu controls, thestepvalue is interpreted as amenu_skip_mask. so don't get confused whenstepis doing something completely different for menus than it does for everyone else. iykyk π
and if one of the range arguments is invalid for this control type? an error is returned. no silent failing, no vibes-based guessing, she just tells you. ngl that's a serve.
π IMPORTANT, do not skip this one: this function assumes that the control handler is not locked and will take the lock itself. so like... don't hold the lock and then call this, that's a bad time. she's an independent woman, she handles her own locking π«Ά
π SEE ALSO π
okay this is the big one. the whole friend group. the entire group chat. every single mutual, no cap, I'm not skipping a single one because every reference matters π
Kernel file ./include/media/v4l2-ctrls.hunion v4l2_ctrl_ptr(9)v4l2_ctrl_ptr_create(9)struct v4l2_ctrl_ops(9)struct v4l2_ctrl_type_ops(9)v4l2_ctrl_notify_fnc(9)struct v4l2_ctrl(9)struct v4l2_ctrl_ref(9)struct v4l2_ctrl_handler(9)struct v4l2_ctrl_config(9)v4l2_ctrl_fill(9)v4l2_ctrl_handler_init_class(9)v4l2_ctrl_handler_init(9)v4l2_ctrl_handler_free(9)v4l2_ctrl_lock(9)v4l2_ctrl_unlock(9)__v4l2_ctrl_handler_setup(9)v4l2_ctrl_handler_setup(9)v4l2_ctrl_handler_log_status(9)v4l2_ctrl_new_custom(9)v4l2_ctrl_new_std(9)v4l2_ctrl_new_std_menu(9)v4l2_ctrl_new_std_menu_items(9)v4l2_ctrl_new_std_compound(9)v4l2_ctrl_new_int_menu(9)v4l2_ctrl_filter(9)v4l2_ctrl_add_handler(9)v4l2_ctrl_radio_filter(9)v4l2_ctrl_cluster(9)v4l2_ctrl_auto_cluster(9)v4l2_ctrl_find(9)v4l2_ctrl_activate(9)__v4l2_ctrl_grab(9)v4l2_ctrl_grab(9)__v4l2_ctrl_modify_range(9)__v4l2_ctrl_modify_dimensions(9)v4l2_ctrl_modify_dimensions(9)v4l2_ctrl_notify(9)v4l2_ctrl_get_name(9)v4l2_ctrl_get_menu(9)v4l2_ctrl_get_int_menu(9)v4l2_ctrl_g_ctrl(9)__v4l2_ctrl_s_ctrl(9)v4l2_ctrl_s_ctrl(9)v4l2_ctrl_g_ctrl_int64(9)__v4l2_ctrl_s_ctrl_int64(9)v4l2_ctrl_s_ctrl_int64(9)__v4l2_ctrl_s_ctrl_string(9)v4l2_ctrl_s_ctrl_string(9)__v4l2_ctrl_s_ctrl_compound(9)v4l2_ctrl_s_ctrl_compound(9)v4l2_ctrl_replace(9)v4l2_ctrl_merge(9)v4l2_ctrl_log_status(9)v4l2_ctrl_subscribe_event(9)v4l2_ctrl_poll(9)v4l2_ctrl_request_setup(9)v4l2_ctrl_request_complete(9)v4l2_ctrl_request_hdl_find(9)v4l2_ctrl_request_hdl_put(9)v4l2_ctrl_request_hdl_ctrl_find(9)v4l2_queryctrl(9)v4l2_query_ext_ctrl_to_v4l2_queryctrl(9)v4l2_query_ext_ctrl(9)v4l2_querymenu(9)v4l2_g_ctrl(9)v4l2_s_ctrl(9)v4l2_g_ext_ctrls(9)v4l2_try_ext_ctrls(9)v4l2_s_ext_ctrls(9)v4l2_ctrl_subdev_subscribe_event(9)v4l2_ctrl_subdev_log_status(9)v4l2_ctrl_new_fwnode_properties(9)v4l2_ctrl_type_op_equal(9)v4l2_ctrl_type_op_init(9)v4l2_ctrl_type_op_log(9)v4l2_ctrl_type_op_validate(9)
that's 76 refs bestie. seventy-six. I counted. and the source of truth lives at ./include/media in the kernel tree, so go say hi to her π§
πΈ alright that's the whole page, love u, go modify some ranges responsibly πΈ
signed off by ./include/media, dated October 2026 β this manpage said periodt and went home π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms