aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/video4linux
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-09-07 03:46:39 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-01-04 21:49:54 -0500
commit8ac7a9493a4380a8a886fbfe311ab00bc424ca0f (patch)
tree25f60268aad8cf9f45c44b1ef7e8a2f30e506952 /Documentation/video4linux
parent20deebfe17b20ded00ba404adbcd014eb2b024c1 (diff)
[media] v4l2-ctrls: add a notify callback
Sometimes platform/bridge drivers need to be notified when a control from a sub-device changes value. In order to support this a notify callback was added. [dheitmueller@kernellabs.com: fix merge conflict in v4l2-ctrls.c] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/video4linux')
-rw-r--r--Documentation/video4linux/v4l2-controls.txt22
1 files changed, 14 insertions, 8 deletions
diff --git a/Documentation/video4linux/v4l2-controls.txt b/Documentation/video4linux/v4l2-controls.txt
index cfe52c798d74..676f87366025 100644
--- a/Documentation/video4linux/v4l2-controls.txt
+++ b/Documentation/video4linux/v4l2-controls.txt
@@ -715,14 +715,20 @@ a control of this type whenever the first control belonging to a new control
715class is added. 715class is added.
716 716
717 717
718Proposals for Extensions 718Adding Notify Callbacks
719======================== 719=======================
720
721Sometimes the platform or bridge driver needs to be notified when a control
722from a sub-device driver changes. You can set a notify callback by calling
723this function:
720 724
721Some ideas for future extensions to the spec: 725void v4l2_ctrl_notify(struct v4l2_ctrl *ctrl,
726 void (*notify)(struct v4l2_ctrl *ctrl, void *priv), void *priv);
722 727
7231) Add a V4L2_CTRL_FLAG_HEX to have values shown as hexadecimal instead of 728Whenever the give control changes value the notify callback will be called
724decimal. Useful for e.g. video_mute_yuv. 729with a pointer to the control and the priv pointer that was passed with
730v4l2_ctrl_notify. Note that the control's handler lock is held when the
731notify function is called.
725 732
7262) It is possible to mark in the controls array which controls have been 733There can be only one notify function per control handler. Any attempt
727successfully written and which failed by for example adding a bit to the 734to set another notify function will cause a WARN_ON.
728control ID. Not sure if it is worth the effort, though.