diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-09-07 03:46:39 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-01-04 21:49:54 -0500 |
commit | 8ac7a9493a4380a8a886fbfe311ab00bc424ca0f (patch) | |
tree | 25f60268aad8cf9f45c44b1ef7e8a2f30e506952 /Documentation/video4linux | |
parent | 20deebfe17b20ded00ba404adbcd014eb2b024c1 (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.txt | 22 |
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 | |||
715 | class is added. | 715 | class is added. |
716 | 716 | ||
717 | 717 | ||
718 | Proposals for Extensions | 718 | Adding Notify Callbacks |
719 | ======================== | 719 | ======================= |
720 | |||
721 | Sometimes the platform or bridge driver needs to be notified when a control | ||
722 | from a sub-device driver changes. You can set a notify callback by calling | ||
723 | this function: | ||
720 | 724 | ||
721 | Some ideas for future extensions to the spec: | 725 | void v4l2_ctrl_notify(struct v4l2_ctrl *ctrl, |
726 | void (*notify)(struct v4l2_ctrl *ctrl, void *priv), void *priv); | ||
722 | 727 | ||
723 | 1) Add a V4L2_CTRL_FLAG_HEX to have values shown as hexadecimal instead of | 728 | Whenever the give control changes value the notify callback will be called |
724 | decimal. Useful for e.g. video_mute_yuv. | 729 | with a pointer to the control and the priv pointer that was passed with |
730 | v4l2_ctrl_notify. Note that the control's handler lock is held when the | ||
731 | notify function is called. | ||
725 | 732 | ||
726 | 2) It is possible to mark in the controls array which controls have been | 733 | There can be only one notify function per control handler. Any attempt |
727 | successfully written and which failed by for example adding a bit to the | 734 | to set another notify function will cause a WARN_ON. |
728 | control ID. Not sure if it is worth the effort, though. | ||