diff options
Diffstat (limited to 'include/media/v4l2-subdev.h')
-rw-r--r-- | include/media/v4l2-subdev.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 37b09e56e943..1d181b4ccb01 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -78,6 +78,9 @@ struct v4l2_subdev_core_ops { | |||
78 | int (*queryctrl)(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc); | 78 | int (*queryctrl)(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc); |
79 | int (*g_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); | 79 | int (*g_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); |
80 | int (*s_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); | 80 | int (*s_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); |
81 | int (*g_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); | ||
82 | int (*s_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); | ||
83 | int (*try_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); | ||
81 | int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm); | 84 | int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm); |
82 | long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); | 85 | long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); |
83 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 86 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
@@ -112,9 +115,17 @@ struct v4l2_subdev_video_ops { | |||
112 | int (*g_vbi_data)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_data *vbi_data); | 115 | int (*g_vbi_data)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_data *vbi_data); |
113 | int (*g_sliced_vbi_cap)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_cap *cap); | 116 | int (*g_sliced_vbi_cap)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_cap *cap); |
114 | int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std); | 117 | int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std); |
118 | int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); | ||
119 | int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); | ||
115 | int (*s_stream)(struct v4l2_subdev *sd, int enable); | 120 | int (*s_stream)(struct v4l2_subdev *sd, int enable); |
116 | int (*s_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); | 121 | int (*enum_fmt)(struct v4l2_subdev *sd, struct v4l2_fmtdesc *fmtdesc); |
117 | int (*g_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); | 122 | int (*g_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); |
123 | int (*try_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); | ||
124 | int (*s_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); | ||
125 | int (*g_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); | ||
126 | int (*s_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); | ||
127 | int (*enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); | ||
128 | int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival); | ||
118 | }; | 129 | }; |
119 | 130 | ||
120 | struct v4l2_subdev_ops { | 131 | struct v4l2_subdev_ops { |
@@ -132,7 +143,7 @@ struct v4l2_subdev_ops { | |||
132 | struct v4l2_subdev { | 143 | struct v4l2_subdev { |
133 | struct list_head list; | 144 | struct list_head list; |
134 | struct module *owner; | 145 | struct module *owner; |
135 | struct v4l2_device *dev; | 146 | struct v4l2_device *v4l2_dev; |
136 | const struct v4l2_subdev_ops *ops; | 147 | const struct v4l2_subdev_ops *ops; |
137 | /* name must be unique */ | 148 | /* name must be unique */ |
138 | char name[V4L2_SUBDEV_NAME_SIZE]; | 149 | char name[V4L2_SUBDEV_NAME_SIZE]; |
@@ -171,7 +182,7 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd, | |||
171 | /* ops->core MUST be set */ | 182 | /* ops->core MUST be set */ |
172 | BUG_ON(!ops || !ops->core); | 183 | BUG_ON(!ops || !ops->core); |
173 | sd->ops = ops; | 184 | sd->ops = ops; |
174 | sd->dev = NULL; | 185 | sd->v4l2_dev = NULL; |
175 | sd->name[0] = '\0'; | 186 | sd->name[0] = '\0'; |
176 | sd->grp_id = 0; | 187 | sd->grp_id = 0; |
177 | sd->priv = NULL; | 188 | sd->priv = NULL; |
@@ -186,4 +197,9 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd, | |||
186 | (!(sd) ? -ENODEV : (((sd) && (sd)->ops->o && (sd)->ops->o->f) ? \ | 197 | (!(sd) ? -ENODEV : (((sd) && (sd)->ops->o && (sd)->ops->o->f) ? \ |
187 | (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD)) | 198 | (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD)) |
188 | 199 | ||
200 | /* Send a notification to v4l2_device. */ | ||
201 | #define v4l2_subdev_notify(sd, notification, arg) \ | ||
202 | ((!(sd) || !(sd)->v4l2_dev || !(sd)->v4l2_dev->notify) ? -ENODEV : \ | ||
203 | (sd)->v4l2_dev->notify((sd), (notification), (arg))) | ||
204 | |||
189 | #endif | 205 | #endif |