UPSTREAM: usb: dwc3: gadget: pass dep as argument to endpoint command
[firefly-linux-kernel-4.4.55.git] / include / media / v4l2-ctrls.h
index da6fe9802feeab18df01dba3bd606dd12daaa552..0a9434afd862d948d9e64ee323cf5e0d6b593e0d 100644 (file)
@@ -44,6 +44,12 @@ struct poll_table_struct;
  * @p_u16:     Pointer to a 16-bit unsigned value.
  * @p_u32:     Pointer to a 32-bit unsigned value.
  * @p_char:    Pointer to a string.
+ * @p_h264_sps:        Pointer to a struct v4l2_ctrl_h264_sps.
+ * @p_h264_pps:        Pointer to a struct v4l2_ctrl_h264_pps.
+ * @p_h264_scal_mtrx:  Pointer to a struct v4l2_ctrl_h264_scaling_matrix.
+ * @p_h264_slice_param:        Pointer to a struct v4l2_ctrl_h264_slice_param.
+ * @p_h264_decode_param: Pointer to a struct v4l2_ctrl_h264_decode_param.
+ * @p_vp8_frame_hdr:   Pointer to a struct v4l2_ctrl_vp8_frame_hdr.
  * @p:         Pointer to a compound value.
  */
 union v4l2_ctrl_ptr {
@@ -53,6 +59,12 @@ union v4l2_ctrl_ptr {
        u16 *p_u16;
        u32 *p_u32;
        char *p_char;
+       struct v4l2_ctrl_h264_sps *p_h264_sps;
+       struct v4l2_ctrl_h264_pps *p_h264_pps;
+       struct v4l2_ctrl_h264_scaling_matrix *p_h264_scal_mtrx;
+       struct v4l2_ctrl_h264_slice_param *p_h264_slice_param;
+       struct v4l2_ctrl_h264_decode_param *p_h264_decode_param;
+       struct v4l2_ctrl_vp8_frame_hdr *p_vp8_frame_hdr;
        void *p;
 };
 
@@ -146,6 +158,9 @@ typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv);
  * @elem_size: The size in bytes of the control.
  * @dims:      The size of each dimension.
  * @nr_of_dims:The number of dimensions in @dims.
+ * @max_stores:The maximum number of configuration stores of this control.
+ * @nr_of_stores: The number of allocated configuration stores of this control.
+ * @store:     The configuration store that the control op operates on.
  * @menu_skip_mask: The control's skip mask for menu controls. This makes it
  *             easy to skip menu items that are not valid. If bit X is set,
  *             then menu item X is skipped. Of course, this only works for
@@ -202,6 +217,9 @@ struct v4l2_ctrl {
        u32 elem_size;
        u32 dims[V4L2_CTRL_MAX_DIMS];
        u32 nr_of_dims;
+       u16 max_stores;
+       u16 nr_of_stores;
+       u16 store;
        union {
                u64 step;
                u64 menu_skip_mask;
@@ -219,6 +237,7 @@ struct v4l2_ctrl {
 
        union v4l2_ctrl_ptr p_new;
        union v4l2_ctrl_ptr p_cur;
+       union v4l2_ctrl_ptr *p_stores;
 };
 
 /**
@@ -285,6 +304,7 @@ struct v4l2_ctrl_handler {
  * @def:       The control's default value.
  * @dims:      The size of each dimension.
  * @elem_size: The size in bytes of the control.
+ * @max_stores:        The maximum number of stores allowed.
  * @flags:     The control's flags.
  * @menu_skip_mask: The control's skip mask for menu controls. This makes it
  *             easy to skip menu items that are not valid. If bit X is set,
@@ -313,6 +333,7 @@ struct v4l2_ctrl_config {
        s64 def;
        u32 dims[V4L2_CTRL_MAX_DIMS];
        u32 elem_size;
+       u16 max_stores;
        u32 flags;
        u64 menu_skip_mask;
        const char * const *qmenu;
@@ -886,6 +907,13 @@ static inline int v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char *s)
        return rval;
 }
 
+static inline void v4l2_ctrl_set_max_stores(struct v4l2_ctrl *ctrl, u16 max_stores)
+{
+       ctrl->max_stores = max_stores;
+}
+
+int v4l2_ctrl_apply_store(struct v4l2_ctrl_handler *hdl, unsigned store);
+
 /* Internal helper functions that deal with control events. */
 extern const struct v4l2_subscribed_event_ops v4l2_ctrl_sub_ev_ops;
 void v4l2_ctrl_replace(struct v4l2_event *old, const struct v4l2_event *new);