diff options
Diffstat (limited to 'Documentation/video4linux/v4l2-controls.txt')
-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. | ||