union v4l2_ctrl_ptr ptr);
};
+/**
+ * typedef v4l2_ctrl_notify_fnc - typedef for a notify argument with a function
+ * that should be called when a control value has changed.
+ *
+ * @ctrl: pointer to struct &v4l2_ctrl
+ * @priv: control private data
+ *
+ * This typedef definition is used as an argument to v4l2_ctrl_notify()
+ * and as an argument at struct &v4l2_ctrl_handler.
+ */
typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv);
/**
* @key: Used by the lock validator if CONFIG_LOCKDEP is set.
* @name: Used by the lock validator if CONFIG_LOCKDEP is set.
*
- * Returns an error if the buckets could not be allocated. This error will
- * also be stored in @hdl->error.
+ * .. attention::
+ *
+ * Never use this call directly, always use the v4l2_ctrl_handler_init()
+ * macro that hides the @key and @name arguments.
*
- * Never use this call directly, always use the v4l2_ctrl_handler_init
- * macro that hides the @key and @name arguments.
+ * Return: returns an error if the buckets could not be allocated. This
+ * error will also be stored in @hdl->error.
*/
int v4l2_ctrl_handler_init_class(struct v4l2_ctrl_handler *hdl,
unsigned int nr_of_controls_hint,
struct lock_class_key *key, const char *name);
#ifdef CONFIG_LOCKDEP
+
+/**
+ * v4l2_ctrl_handler_init -
+ *
+ * @hdl: The control handler.
+ * @nr_of_controls_hint: A hint of how many controls this handler is
+ * expected to refer to. This is the total number, so including
+ * any inherited controls. It doesn't have to be precise, but if
+ * it is way off, then you either waste memory (too many buckets
+ * are allocated) or the control lookup becomes slower (not enough
+ * buckets are allocated, so there are more slow list lookups).
+ * It will always work, though.
+ *
+ * This helper function creates a static struct &lock_class_key and
+ * calls v4l2_ctrl_handler_init_class(), providing a proper name for the lock
+ * validador.
+ *
+ * Use this helper function to initialize a control handler.
+ */
#define v4l2_ctrl_handler_init(hdl, nr_of_controls_hint) \
( \
({ \
u32 id, u8 max, u8 def,
const s64 *qmenu_int);
+/**
+ * typedef v4l2_ctrl_filter - Typedef to define the filter function to be
+ * used when adding a control handler.
+ *
+ * @ctrl: pointer to struct &v4l2_ctrl.
+ */
+
typedef bool (*v4l2_ctrl_filter)(const struct v4l2_ctrl *ctrl);
/**
* be marked active, and any reads will just return the current value without
* going through g_volatile_ctrl.
*
- * In addition, this function will set the V4L2_CTRL_FLAG_UPDATE flag
- * on the autofoo control and V4L2_CTRL_FLAG_INACTIVE on the foo control(s)
+ * In addition, this function will set the %V4L2_CTRL_FLAG_UPDATE flag
+ * on the autofoo control and %V4L2_CTRL_FLAG_INACTIVE on the foo control(s)
* if autofoo is in auto mode.
*/
void v4l2_ctrl_auto_cluster(unsigned int ncontrols,
*/
void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed);
-
/**
*__v4l2_ctrl_modify_range() - Unlocked variant of v4l2_ctrl_modify_range()
*