Lines Matching refs:control
4 The V4L2 control API seems simple enough, but quickly becomes very hard to
10 1) How do I add a control?
11 2) How do I set the control's value? (i.e. s_ctrl)
15 3) How do I get the control's value? (i.e. g_volatile_ctrl)
16 4) How do I validate the user's proposed control value? (i.e. try_ctrl)
20 The control framework was created in order to implement all the rules of the
24 Note that the control framework relies on the presence of a struct v4l2_device
33 The v4l2_ctrl object describes the control properties and keeps track of the
34 control's value (both the current value and the proposed new value).
64 1.3) Hook the control handler into the driver:
80 Finally, remove all control functions from your v4l2_ioctl_ops (if any):
99 And set all core control ops in your struct v4l2_subdev_core_ops to these
111 on subdev drivers are converted to the control framework these helpers will
186 control, but if you do not need to access the pointer outside the control ops,
189 The v4l2_ctrl_new_std function will fill in most fields based on the control
191 last four arguments. These values are driver specific while control attributes
192 like type, name, flags are all global. The control's current value will be set
201 control with driver-specific items in the menu. It differs from
208 specific menu for an otherwise standard menu control. A good example for this
209 control is the test pattern control for capture/display/sensors devices that
221 It is recommended to add controls in ascending control ID order: it will be
224 3) Optionally force initial control setup:
229 initializes the hardware to the default control values. It is recommended
256 The control ops are called with the v4l2_ctrl pointer as argument.
257 The new control value has already been validated, so all you need to do is
261 to do any validation of control values, or implement QUERYCTRL, QUERY_EXT_CTRL
281 skipped (so a V4L2 driver can always override a subdev control).
291 The following union is used inside the control framework to access control
313 If the control has a simple s32 type type, then:
321 Within the control ops you can freely use these. The val and cur.val speak for
325 Unless the control is marked volatile the p_cur field points to the the
326 current cached control value. When you create a new control this value is made
348 are not, a V4L2_EVENT_CTRL_CH_VALUE will not be generated when the control
351 To mark a control as volatile you have to set V4L2_CTRL_FLAG_VOLATILE:
361 If s_ctrl returns 0 (OK), then the control framework will copy the new final
369 Outside of the control ops you have to go through to helper functions to get
370 or set a single control value safely in your driver:
375 These functions go through the control framework just as VIDIOC_G/S_CTRL ioctls
376 do. Don't use these inside the control ops g_volatile/s/try_ctrl, though, that
403 A good example is the MPEG Audio Layer II Bitrate menu control where the
410 control, or by calling v4l2_ctrl_new_std_menu().
436 control and will fill in the name, type and flags fields accordingly.
443 activate and deactivate controls. For example, if the Chroma AGC control is
444 on, then the Chroma Gain control is inactive. That is, you may set it, but
446 control is on. Typically user interfaces can disable such input fields.
453 The other flag is the 'grabbed' flag. A grabbed control means that you cannot
457 If a control is set to 'grabbed' using v4l2_ctrl_grab(), then the framework
458 will return -EBUSY if an attempt is made to set this control. The
467 complex scenarios you can get dependencies from one control to another.
485 cluster is set (or 'gotten', or 'tried'), only the control ops of the first
486 control ('volume' in this example) is called. You effectively create a new
487 composite control. Similar to how a 'struct' works in C.
524 The anonymous struct is used to clearly 'cluster' these two control pointers,
526 array with two control pointers. So you can just do:
538 only restriction is that the first control of the cluster must always be
539 present, since that is the 'master' control of the cluster. The master
540 control is the one that identifies the cluster and that provides the
544 a valid control or to NULL.
548 each control. For example, in the case of a volume/mute cluster the 'is_new'
549 flag of the mute control would be set if the user called VIDIOC_S_CTRL for
559 A common type of control cluster is one that handles 'auto-foo/foo'-type
561 autowhitebalance/red balance/blue balance. In all cases you have one control
562 that determines whether another control is handled automatically by the hardware,
563 or whether it is under manual control from the user.
576 Finally the V4L2_CTRL_FLAG_UPDATE should be set for the auto control since
577 changing that control affects the control flags of the manual controls.
593 The first control of the cluster is assumed to be the 'auto' control.
612 Usually the V4L2 driver has just one control handler that is global for
613 all video nodes. But you can also specify different control handlers for
619 control handler. You do that by simply setting the ctrl_handler field in
624 manually to add the subdev's control handler (sd->ctrl_handler) to the desired
625 control handler. This control handler may be specific to the video_device or
627 audio controls, while the video and vbi device nodes share the same control
659 control. The rule is to have one control for each hardware 'knob' that you
669 But sometimes you need to find a control from another handler that you do
670 not own. For example, if you have to find a volume control from a subdev.
693 attempting to find another control from the same handler will deadlock.
695 It is recommended not to use this function from inside the control ops.
701 When one control handler is added to another using v4l2_ctrl_add_handler, then
706 setting the 'is_private' flag of the control to 1:
726 Controls of this type can be used by GUIs to get the name of the control class.
728 containing the controls belonging to a particular control class. The name of
729 each tab can be found by querying a special control with ID <control class | 1>.
732 a control of this type whenever the first control belonging to a new control
739 Sometimes the platform or bridge driver needs to be notified when a control
746 Whenever the give control changes value the notify callback will be called
747 with a pointer to the control and the priv pointer that was passed with
748 v4l2_ctrl_notify. Note that the control's handler lock is held when the
751 There can be only one notify function per control handler. Any attempt