diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2014-06-12 12:09:39 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-21 18:43:03 -0400 |
commit | 605b38403b710ca01a242448241bc45c722b341b (patch) | |
tree | d38d346dfb8924b84f1ce7a0819a1f97eb546089 /include/media | |
parent | c9adcb73b2da5eddfcb96bfa264bb61b6b83ac96 (diff) |
[media] v4l: ctrls: Move control lock/unlock above the control access functions
The v4l2_ctrl_{,un}lock will be needed elsewhere. Define them before the
functions that perform operations on controls.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/v4l2-ctrls.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index c630345e9fd2..4546233a9a3d 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
@@ -367,6 +367,24 @@ int v4l2_ctrl_handler_init_class(struct v4l2_ctrl_handler *hdl, | |||
367 | */ | 367 | */ |
368 | void v4l2_ctrl_handler_free(struct v4l2_ctrl_handler *hdl); | 368 | void v4l2_ctrl_handler_free(struct v4l2_ctrl_handler *hdl); |
369 | 369 | ||
370 | /** v4l2_ctrl_lock() - Helper function to lock the handler | ||
371 | * associated with the control. | ||
372 | * @ctrl: The control to lock. | ||
373 | */ | ||
374 | static inline void v4l2_ctrl_lock(struct v4l2_ctrl *ctrl) | ||
375 | { | ||
376 | mutex_lock(ctrl->handler->lock); | ||
377 | } | ||
378 | |||
379 | /** v4l2_ctrl_unlock() - Helper function to unlock the handler | ||
380 | * associated with the control. | ||
381 | * @ctrl: The control to unlock. | ||
382 | */ | ||
383 | static inline void v4l2_ctrl_unlock(struct v4l2_ctrl *ctrl) | ||
384 | { | ||
385 | mutex_unlock(ctrl->handler->lock); | ||
386 | } | ||
387 | |||
370 | /** v4l2_ctrl_handler_setup() - Call the s_ctrl op for all controls belonging | 388 | /** v4l2_ctrl_handler_setup() - Call the s_ctrl op for all controls belonging |
371 | * to the handler to initialize the hardware to the current control values. | 389 | * to the handler to initialize the hardware to the current control values. |
372 | * @hdl: The control handler. | 390 | * @hdl: The control handler. |
@@ -622,24 +640,6 @@ void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed); | |||
622 | int v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl, | 640 | int v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl, |
623 | s64 min, s64 max, u64 step, s64 def); | 641 | s64 min, s64 max, u64 step, s64 def); |
624 | 642 | ||
625 | /** v4l2_ctrl_lock() - Helper function to lock the handler | ||
626 | * associated with the control. | ||
627 | * @ctrl: The control to lock. | ||
628 | */ | ||
629 | static inline void v4l2_ctrl_lock(struct v4l2_ctrl *ctrl) | ||
630 | { | ||
631 | mutex_lock(ctrl->handler->lock); | ||
632 | } | ||
633 | |||
634 | /** v4l2_ctrl_unlock() - Helper function to unlock the handler | ||
635 | * associated with the control. | ||
636 | * @ctrl: The control to unlock. | ||
637 | */ | ||
638 | static inline void v4l2_ctrl_unlock(struct v4l2_ctrl *ctrl) | ||
639 | { | ||
640 | mutex_unlock(ctrl->handler->lock); | ||
641 | } | ||
642 | |||
643 | /** v4l2_ctrl_notify() - Function to set a notify callback for a control. | 643 | /** v4l2_ctrl_notify() - Function to set a notify callback for a control. |
644 | * @ctrl: The control. | 644 | * @ctrl: The control. |
645 | * @notify: The callback function. | 645 | * @notify: The callback function. |