Linux Audio

Check our new training course

Loading...
v3.15
  1/*
  2 *
  3 *	V 4 L 2   D R I V E R   H E L P E R   A P I
  4 *
  5 * Moved from videodev2.h
  6 *
  7 *	Some commonly needed functions for drivers (v4l2-common.o module)
  8 */
  9#ifndef _V4L2_IOCTL_H
 10#define _V4L2_IOCTL_H
 11
 12#include <linux/poll.h>
 13#include <linux/fs.h>
 
 14#include <linux/mutex.h>
 15#include <linux/compiler.h> /* need __user */
 16#include <linux/videodev2.h>
 17
 18struct v4l2_fh;
 19
 20struct v4l2_ioctl_ops {
 21	/* ioctl callbacks */
 22
 23	/* VIDIOC_QUERYCAP handler */
 24	int (*vidioc_querycap)(struct file *file, void *fh, struct v4l2_capability *cap);
 25
 26	/* Priority handling */
 27	int (*vidioc_g_priority)   (struct file *file, void *fh,
 28				    enum v4l2_priority *p);
 29	int (*vidioc_s_priority)   (struct file *file, void *fh,
 30				    enum v4l2_priority p);
 31
 32	/* VIDIOC_ENUM_FMT handlers */
 33	int (*vidioc_enum_fmt_vid_cap)     (struct file *file, void *fh,
 34					    struct v4l2_fmtdesc *f);
 35	int (*vidioc_enum_fmt_vid_overlay) (struct file *file, void *fh,
 36					    struct v4l2_fmtdesc *f);
 37	int (*vidioc_enum_fmt_vid_out)     (struct file *file, void *fh,
 38					    struct v4l2_fmtdesc *f);
 39	int (*vidioc_enum_fmt_vid_cap_mplane)(struct file *file, void *fh,
 40					      struct v4l2_fmtdesc *f);
 41	int (*vidioc_enum_fmt_vid_out_mplane)(struct file *file, void *fh,
 42					      struct v4l2_fmtdesc *f);
 43	int (*vidioc_enum_fmt_sdr_cap)     (struct file *file, void *fh,
 44					    struct v4l2_fmtdesc *f);
 45
 46	/* VIDIOC_G_FMT handlers */
 47	int (*vidioc_g_fmt_vid_cap)    (struct file *file, void *fh,
 48					struct v4l2_format *f);
 49	int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *fh,
 50					struct v4l2_format *f);
 51	int (*vidioc_g_fmt_vid_out)    (struct file *file, void *fh,
 52					struct v4l2_format *f);
 53	int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *fh,
 54					struct v4l2_format *f);
 55	int (*vidioc_g_fmt_vbi_cap)    (struct file *file, void *fh,
 56					struct v4l2_format *f);
 57	int (*vidioc_g_fmt_vbi_out)    (struct file *file, void *fh,
 58					struct v4l2_format *f);
 59	int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *fh,
 60					struct v4l2_format *f);
 61	int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *fh,
 62					struct v4l2_format *f);
 63	int (*vidioc_g_fmt_vid_cap_mplane)(struct file *file, void *fh,
 64					   struct v4l2_format *f);
 65	int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *fh,
 66					   struct v4l2_format *f);
 67	int (*vidioc_g_fmt_sdr_cap)    (struct file *file, void *fh,
 68					struct v4l2_format *f);
 69
 70	/* VIDIOC_S_FMT handlers */
 71	int (*vidioc_s_fmt_vid_cap)    (struct file *file, void *fh,
 72					struct v4l2_format *f);
 73	int (*vidioc_s_fmt_vid_overlay)(struct file *file, void *fh,
 74					struct v4l2_format *f);
 75	int (*vidioc_s_fmt_vid_out)    (struct file *file, void *fh,
 76					struct v4l2_format *f);
 77	int (*vidioc_s_fmt_vid_out_overlay)(struct file *file, void *fh,
 78					struct v4l2_format *f);
 79	int (*vidioc_s_fmt_vbi_cap)    (struct file *file, void *fh,
 80					struct v4l2_format *f);
 81	int (*vidioc_s_fmt_vbi_out)    (struct file *file, void *fh,
 82					struct v4l2_format *f);
 83	int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *file, void *fh,
 84					struct v4l2_format *f);
 85	int (*vidioc_s_fmt_sliced_vbi_out)(struct file *file, void *fh,
 86					struct v4l2_format *f);
 87	int (*vidioc_s_fmt_vid_cap_mplane)(struct file *file, void *fh,
 88					   struct v4l2_format *f);
 89	int (*vidioc_s_fmt_vid_out_mplane)(struct file *file, void *fh,
 90					   struct v4l2_format *f);
 91	int (*vidioc_s_fmt_sdr_cap)    (struct file *file, void *fh,
 92					struct v4l2_format *f);
 93
 94	/* VIDIOC_TRY_FMT handlers */
 95	int (*vidioc_try_fmt_vid_cap)    (struct file *file, void *fh,
 96					  struct v4l2_format *f);
 97	int (*vidioc_try_fmt_vid_overlay)(struct file *file, void *fh,
 98					  struct v4l2_format *f);
 99	int (*vidioc_try_fmt_vid_out)    (struct file *file, void *fh,
100					  struct v4l2_format *f);
101	int (*vidioc_try_fmt_vid_out_overlay)(struct file *file, void *fh,
102					  struct v4l2_format *f);
103	int (*vidioc_try_fmt_vbi_cap)    (struct file *file, void *fh,
104					  struct v4l2_format *f);
105	int (*vidioc_try_fmt_vbi_out)    (struct file *file, void *fh,
106					  struct v4l2_format *f);
107	int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *file, void *fh,
108					  struct v4l2_format *f);
109	int (*vidioc_try_fmt_sliced_vbi_out)(struct file *file, void *fh,
110					  struct v4l2_format *f);
111	int (*vidioc_try_fmt_vid_cap_mplane)(struct file *file, void *fh,
112					     struct v4l2_format *f);
113	int (*vidioc_try_fmt_vid_out_mplane)(struct file *file, void *fh,
114					     struct v4l2_format *f);
115	int (*vidioc_try_fmt_sdr_cap)    (struct file *file, void *fh,
116					  struct v4l2_format *f);
117
118	/* Buffer handlers */
119	int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b);
120	int (*vidioc_querybuf)(struct file *file, void *fh, struct v4l2_buffer *b);
121	int (*vidioc_qbuf)    (struct file *file, void *fh, struct v4l2_buffer *b);
122	int (*vidioc_expbuf)  (struct file *file, void *fh,
123				struct v4l2_exportbuffer *e);
124	int (*vidioc_dqbuf)   (struct file *file, void *fh, struct v4l2_buffer *b);
125
126	int (*vidioc_create_bufs)(struct file *file, void *fh, struct v4l2_create_buffers *b);
127	int (*vidioc_prepare_buf)(struct file *file, void *fh, struct v4l2_buffer *b);
128
129	int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i);
130	int (*vidioc_g_fbuf)   (struct file *file, void *fh,
131				struct v4l2_framebuffer *a);
132	int (*vidioc_s_fbuf)   (struct file *file, void *fh,
133				const struct v4l2_framebuffer *a);
134
135		/* Stream on/off */
136	int (*vidioc_streamon) (struct file *file, void *fh, enum v4l2_buf_type i);
137	int (*vidioc_streamoff)(struct file *file, void *fh, enum v4l2_buf_type i);
138
139		/* Standard handling
140			ENUMSTD is handled by videodev.c
141		 */
142	int (*vidioc_g_std) (struct file *file, void *fh, v4l2_std_id *norm);
143	int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id norm);
144	int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a);
145
146		/* Input handling */
147	int (*vidioc_enum_input)(struct file *file, void *fh,
148				 struct v4l2_input *inp);
149	int (*vidioc_g_input)   (struct file *file, void *fh, unsigned int *i);
150	int (*vidioc_s_input)   (struct file *file, void *fh, unsigned int i);
151
152		/* Output handling */
153	int (*vidioc_enum_output) (struct file *file, void *fh,
154				  struct v4l2_output *a);
155	int (*vidioc_g_output)   (struct file *file, void *fh, unsigned int *i);
156	int (*vidioc_s_output)   (struct file *file, void *fh, unsigned int i);
157
158		/* Control handling */
159	int (*vidioc_queryctrl)        (struct file *file, void *fh,
160					struct v4l2_queryctrl *a);
161	int (*vidioc_g_ctrl)           (struct file *file, void *fh,
162					struct v4l2_control *a);
163	int (*vidioc_s_ctrl)           (struct file *file, void *fh,
164					struct v4l2_control *a);
165	int (*vidioc_g_ext_ctrls)      (struct file *file, void *fh,
166					struct v4l2_ext_controls *a);
167	int (*vidioc_s_ext_ctrls)      (struct file *file, void *fh,
168					struct v4l2_ext_controls *a);
169	int (*vidioc_try_ext_ctrls)    (struct file *file, void *fh,
170					struct v4l2_ext_controls *a);
171	int (*vidioc_querymenu)        (struct file *file, void *fh,
172					struct v4l2_querymenu *a);
173
174	/* Audio ioctls */
175	int (*vidioc_enumaudio)        (struct file *file, void *fh,
176					struct v4l2_audio *a);
177	int (*vidioc_g_audio)          (struct file *file, void *fh,
178					struct v4l2_audio *a);
179	int (*vidioc_s_audio)          (struct file *file, void *fh,
180					const struct v4l2_audio *a);
181
182	/* Audio out ioctls */
183	int (*vidioc_enumaudout)       (struct file *file, void *fh,
184					struct v4l2_audioout *a);
185	int (*vidioc_g_audout)         (struct file *file, void *fh,
186					struct v4l2_audioout *a);
187	int (*vidioc_s_audout)         (struct file *file, void *fh,
188					const struct v4l2_audioout *a);
189	int (*vidioc_g_modulator)      (struct file *file, void *fh,
190					struct v4l2_modulator *a);
191	int (*vidioc_s_modulator)      (struct file *file, void *fh,
192					const struct v4l2_modulator *a);
193	/* Crop ioctls */
194	int (*vidioc_cropcap)          (struct file *file, void *fh,
195					struct v4l2_cropcap *a);
196	int (*vidioc_g_crop)           (struct file *file, void *fh,
197					struct v4l2_crop *a);
198	int (*vidioc_s_crop)           (struct file *file, void *fh,
199					const struct v4l2_crop *a);
200	int (*vidioc_g_selection)      (struct file *file, void *fh,
201					struct v4l2_selection *s);
202	int (*vidioc_s_selection)      (struct file *file, void *fh,
203					struct v4l2_selection *s);
204	/* Compression ioctls */
205	int (*vidioc_g_jpegcomp)       (struct file *file, void *fh,
206					struct v4l2_jpegcompression *a);
207	int (*vidioc_s_jpegcomp)       (struct file *file, void *fh,
208					const struct v4l2_jpegcompression *a);
209	int (*vidioc_g_enc_index)      (struct file *file, void *fh,
210					struct v4l2_enc_idx *a);
211	int (*vidioc_encoder_cmd)      (struct file *file, void *fh,
212					struct v4l2_encoder_cmd *a);
213	int (*vidioc_try_encoder_cmd)  (struct file *file, void *fh,
214					struct v4l2_encoder_cmd *a);
215	int (*vidioc_decoder_cmd)      (struct file *file, void *fh,
216					struct v4l2_decoder_cmd *a);
217	int (*vidioc_try_decoder_cmd)  (struct file *file, void *fh,
218					struct v4l2_decoder_cmd *a);
219
220	/* Stream type-dependent parameter ioctls */
221	int (*vidioc_g_parm)           (struct file *file, void *fh,
222					struct v4l2_streamparm *a);
223	int (*vidioc_s_parm)           (struct file *file, void *fh,
224					struct v4l2_streamparm *a);
225
226	/* Tuner ioctls */
227	int (*vidioc_g_tuner)          (struct file *file, void *fh,
228					struct v4l2_tuner *a);
229	int (*vidioc_s_tuner)          (struct file *file, void *fh,
230					const struct v4l2_tuner *a);
231	int (*vidioc_g_frequency)      (struct file *file, void *fh,
232					struct v4l2_frequency *a);
233	int (*vidioc_s_frequency)      (struct file *file, void *fh,
234					const struct v4l2_frequency *a);
235	int (*vidioc_enum_freq_bands) (struct file *file, void *fh,
236				    struct v4l2_frequency_band *band);
237
238	/* Sliced VBI cap */
239	int (*vidioc_g_sliced_vbi_cap) (struct file *file, void *fh,
240					struct v4l2_sliced_vbi_cap *a);
241
242	/* Log status ioctl */
243	int (*vidioc_log_status)       (struct file *file, void *fh);
244
245	int (*vidioc_s_hw_freq_seek)   (struct file *file, void *fh,
246					const struct v4l2_hw_freq_seek *a);
247
248	/* Debugging ioctls */
249#ifdef CONFIG_VIDEO_ADV_DEBUG
250	int (*vidioc_g_register)       (struct file *file, void *fh,
251					struct v4l2_dbg_register *reg);
252	int (*vidioc_s_register)       (struct file *file, void *fh,
253					const struct v4l2_dbg_register *reg);
254
255	int (*vidioc_g_chip_info)      (struct file *file, void *fh,
256					struct v4l2_dbg_chip_info *chip);
257#endif
 
 
258
259	int (*vidioc_enum_framesizes)   (struct file *file, void *fh,
260					 struct v4l2_frmsizeenum *fsize);
261
262	int (*vidioc_enum_frameintervals) (struct file *file, void *fh,
263					   struct v4l2_frmivalenum *fival);
264
265	/* DV Timings IOCTLs */
 
 
 
 
 
 
 
 
 
266	int (*vidioc_s_dv_timings) (struct file *file, void *fh,
267				    struct v4l2_dv_timings *timings);
268	int (*vidioc_g_dv_timings) (struct file *file, void *fh,
269				    struct v4l2_dv_timings *timings);
270	int (*vidioc_query_dv_timings) (struct file *file, void *fh,
271				    struct v4l2_dv_timings *timings);
272	int (*vidioc_enum_dv_timings) (struct file *file, void *fh,
273				    struct v4l2_enum_dv_timings *timings);
274	int (*vidioc_dv_timings_cap) (struct file *file, void *fh,
275				    struct v4l2_dv_timings_cap *cap);
276	int (*vidioc_g_edid) (struct file *file, void *fh, struct v4l2_edid *edid);
277	int (*vidioc_s_edid) (struct file *file, void *fh, struct v4l2_edid *edid);
278
279	int (*vidioc_subscribe_event)  (struct v4l2_fh *fh,
280					const struct v4l2_event_subscription *sub);
281	int (*vidioc_unsubscribe_event)(struct v4l2_fh *fh,
282					const struct v4l2_event_subscription *sub);
283
284	/* For other private ioctls */
285	long (*vidioc_default)	       (struct file *file, void *fh,
286					bool valid_prio, unsigned int cmd, void *arg);
287};
288
289
290/* v4l debugging and diagnostics */
291
292/* Debug bitmask flags to be used on V4L2 */
293#define V4L2_DEBUG_IOCTL     0x01
294#define V4L2_DEBUG_IOCTL_ARG 0x02
295
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296/*  Video standard functions  */
297extern const char *v4l2_norm_to_name(v4l2_std_id id);
298extern void v4l2_video_std_frame_period(int id, struct v4l2_fract *frameperiod);
299extern int v4l2_video_std_construct(struct v4l2_standard *vs,
300				    int id, const char *name);
301/* Prints the ioctl in a human-readable format. If prefix != NULL,
302   then do printk(KERN_DEBUG "%s: ", prefix) first. */
303extern void v4l_printk_ioctl(const char *prefix, unsigned int cmd);
304
305/* Internal use only: get the mutex (if any) that we need to lock for the
306   given command. */
307struct video_device;
308extern struct mutex *v4l2_ioctl_get_lock(struct video_device *vdev, unsigned cmd);
309
310/* names for fancy debug output */
311extern const char *v4l2_field_names[];
312extern const char *v4l2_type_names[];
313
314#ifdef CONFIG_COMPAT
315/* 32 Bits compatibility layer for 64 bits processors */
316extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd,
317				unsigned long arg);
318#endif
319
320typedef long (*v4l2_kioctl)(struct file *file,
321		unsigned int cmd, void *arg);
322
323/* Include support for obsoleted stuff */
324extern long video_usercopy(struct file *file, unsigned int cmd,
325				unsigned long arg, v4l2_kioctl func);
326
327/* Standard handlers for V4L ioctl's */
328extern long video_ioctl2(struct file *file,
329			unsigned int cmd, unsigned long arg);
330
331#endif /* _V4L2_IOCTL_H */
v3.1
  1/*
  2 *
  3 *	V 4 L 2   D R I V E R   H E L P E R   A P I
  4 *
  5 * Moved from videodev2.h
  6 *
  7 *	Some commonly needed functions for drivers (v4l2-common.o module)
  8 */
  9#ifndef _V4L2_IOCTL_H
 10#define _V4L2_IOCTL_H
 11
 12#include <linux/poll.h>
 13#include <linux/fs.h>
 14#include <linux/device.h>
 15#include <linux/mutex.h>
 16#include <linux/compiler.h> /* need __user */
 17#include <linux/videodev2.h>
 18
 19struct v4l2_fh;
 20
 21struct v4l2_ioctl_ops {
 22	/* ioctl callbacks */
 23
 24	/* VIDIOC_QUERYCAP handler */
 25	int (*vidioc_querycap)(struct file *file, void *fh, struct v4l2_capability *cap);
 26
 27	/* Priority handling */
 28	int (*vidioc_g_priority)   (struct file *file, void *fh,
 29				    enum v4l2_priority *p);
 30	int (*vidioc_s_priority)   (struct file *file, void *fh,
 31				    enum v4l2_priority p);
 32
 33	/* VIDIOC_ENUM_FMT handlers */
 34	int (*vidioc_enum_fmt_vid_cap)     (struct file *file, void *fh,
 35					    struct v4l2_fmtdesc *f);
 36	int (*vidioc_enum_fmt_vid_overlay) (struct file *file, void *fh,
 37					    struct v4l2_fmtdesc *f);
 38	int (*vidioc_enum_fmt_vid_out)     (struct file *file, void *fh,
 39					    struct v4l2_fmtdesc *f);
 40	int (*vidioc_enum_fmt_vid_cap_mplane)(struct file *file, void *fh,
 41					      struct v4l2_fmtdesc *f);
 42	int (*vidioc_enum_fmt_vid_out_mplane)(struct file *file, void *fh,
 43					      struct v4l2_fmtdesc *f);
 44	int (*vidioc_enum_fmt_type_private)(struct file *file, void *fh,
 45					    struct v4l2_fmtdesc *f);
 46
 47	/* VIDIOC_G_FMT handlers */
 48	int (*vidioc_g_fmt_vid_cap)    (struct file *file, void *fh,
 49					struct v4l2_format *f);
 50	int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *fh,
 51					struct v4l2_format *f);
 52	int (*vidioc_g_fmt_vid_out)    (struct file *file, void *fh,
 53					struct v4l2_format *f);
 54	int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *fh,
 55					struct v4l2_format *f);
 56	int (*vidioc_g_fmt_vbi_cap)    (struct file *file, void *fh,
 57					struct v4l2_format *f);
 58	int (*vidioc_g_fmt_vbi_out)    (struct file *file, void *fh,
 59					struct v4l2_format *f);
 60	int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *fh,
 61					struct v4l2_format *f);
 62	int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *fh,
 63					struct v4l2_format *f);
 64	int (*vidioc_g_fmt_vid_cap_mplane)(struct file *file, void *fh,
 65					   struct v4l2_format *f);
 66	int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *fh,
 67					   struct v4l2_format *f);
 68	int (*vidioc_g_fmt_type_private)(struct file *file, void *fh,
 69					struct v4l2_format *f);
 70
 71	/* VIDIOC_S_FMT handlers */
 72	int (*vidioc_s_fmt_vid_cap)    (struct file *file, void *fh,
 73					struct v4l2_format *f);
 74	int (*vidioc_s_fmt_vid_overlay)(struct file *file, void *fh,
 75					struct v4l2_format *f);
 76	int (*vidioc_s_fmt_vid_out)    (struct file *file, void *fh,
 77					struct v4l2_format *f);
 78	int (*vidioc_s_fmt_vid_out_overlay)(struct file *file, void *fh,
 79					struct v4l2_format *f);
 80	int (*vidioc_s_fmt_vbi_cap)    (struct file *file, void *fh,
 81					struct v4l2_format *f);
 82	int (*vidioc_s_fmt_vbi_out)    (struct file *file, void *fh,
 83					struct v4l2_format *f);
 84	int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *file, void *fh,
 85					struct v4l2_format *f);
 86	int (*vidioc_s_fmt_sliced_vbi_out)(struct file *file, void *fh,
 87					struct v4l2_format *f);
 88	int (*vidioc_s_fmt_vid_cap_mplane)(struct file *file, void *fh,
 89					   struct v4l2_format *f);
 90	int (*vidioc_s_fmt_vid_out_mplane)(struct file *file, void *fh,
 91					   struct v4l2_format *f);
 92	int (*vidioc_s_fmt_type_private)(struct file *file, void *fh,
 93					struct v4l2_format *f);
 94
 95	/* VIDIOC_TRY_FMT handlers */
 96	int (*vidioc_try_fmt_vid_cap)    (struct file *file, void *fh,
 97					  struct v4l2_format *f);
 98	int (*vidioc_try_fmt_vid_overlay)(struct file *file, void *fh,
 99					  struct v4l2_format *f);
100	int (*vidioc_try_fmt_vid_out)    (struct file *file, void *fh,
101					  struct v4l2_format *f);
102	int (*vidioc_try_fmt_vid_out_overlay)(struct file *file, void *fh,
103					  struct v4l2_format *f);
104	int (*vidioc_try_fmt_vbi_cap)    (struct file *file, void *fh,
105					  struct v4l2_format *f);
106	int (*vidioc_try_fmt_vbi_out)    (struct file *file, void *fh,
107					  struct v4l2_format *f);
108	int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *file, void *fh,
109					  struct v4l2_format *f);
110	int (*vidioc_try_fmt_sliced_vbi_out)(struct file *file, void *fh,
111					  struct v4l2_format *f);
112	int (*vidioc_try_fmt_vid_cap_mplane)(struct file *file, void *fh,
113					     struct v4l2_format *f);
114	int (*vidioc_try_fmt_vid_out_mplane)(struct file *file, void *fh,
115					     struct v4l2_format *f);
116	int (*vidioc_try_fmt_type_private)(struct file *file, void *fh,
117					  struct v4l2_format *f);
118
119	/* Buffer handlers */
120	int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b);
121	int (*vidioc_querybuf)(struct file *file, void *fh, struct v4l2_buffer *b);
122	int (*vidioc_qbuf)    (struct file *file, void *fh, struct v4l2_buffer *b);
 
 
123	int (*vidioc_dqbuf)   (struct file *file, void *fh, struct v4l2_buffer *b);
124
 
 
125
126	int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i);
127	int (*vidioc_g_fbuf)   (struct file *file, void *fh,
128				struct v4l2_framebuffer *a);
129	int (*vidioc_s_fbuf)   (struct file *file, void *fh,
130				struct v4l2_framebuffer *a);
131
132		/* Stream on/off */
133	int (*vidioc_streamon) (struct file *file, void *fh, enum v4l2_buf_type i);
134	int (*vidioc_streamoff)(struct file *file, void *fh, enum v4l2_buf_type i);
135
136		/* Standard handling
137			ENUMSTD is handled by videodev.c
138		 */
139	int (*vidioc_g_std) (struct file *file, void *fh, v4l2_std_id *norm);
140	int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id *norm);
141	int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a);
142
143		/* Input handling */
144	int (*vidioc_enum_input)(struct file *file, void *fh,
145				 struct v4l2_input *inp);
146	int (*vidioc_g_input)   (struct file *file, void *fh, unsigned int *i);
147	int (*vidioc_s_input)   (struct file *file, void *fh, unsigned int i);
148
149		/* Output handling */
150	int (*vidioc_enum_output) (struct file *file, void *fh,
151				  struct v4l2_output *a);
152	int (*vidioc_g_output)   (struct file *file, void *fh, unsigned int *i);
153	int (*vidioc_s_output)   (struct file *file, void *fh, unsigned int i);
154
155		/* Control handling */
156	int (*vidioc_queryctrl)        (struct file *file, void *fh,
157					struct v4l2_queryctrl *a);
158	int (*vidioc_g_ctrl)           (struct file *file, void *fh,
159					struct v4l2_control *a);
160	int (*vidioc_s_ctrl)           (struct file *file, void *fh,
161					struct v4l2_control *a);
162	int (*vidioc_g_ext_ctrls)      (struct file *file, void *fh,
163					struct v4l2_ext_controls *a);
164	int (*vidioc_s_ext_ctrls)      (struct file *file, void *fh,
165					struct v4l2_ext_controls *a);
166	int (*vidioc_try_ext_ctrls)    (struct file *file, void *fh,
167					struct v4l2_ext_controls *a);
168	int (*vidioc_querymenu)        (struct file *file, void *fh,
169					struct v4l2_querymenu *a);
170
171	/* Audio ioctls */
172	int (*vidioc_enumaudio)        (struct file *file, void *fh,
173					struct v4l2_audio *a);
174	int (*vidioc_g_audio)          (struct file *file, void *fh,
175					struct v4l2_audio *a);
176	int (*vidioc_s_audio)          (struct file *file, void *fh,
177					struct v4l2_audio *a);
178
179	/* Audio out ioctls */
180	int (*vidioc_enumaudout)       (struct file *file, void *fh,
181					struct v4l2_audioout *a);
182	int (*vidioc_g_audout)         (struct file *file, void *fh,
183					struct v4l2_audioout *a);
184	int (*vidioc_s_audout)         (struct file *file, void *fh,
185					struct v4l2_audioout *a);
186	int (*vidioc_g_modulator)      (struct file *file, void *fh,
187					struct v4l2_modulator *a);
188	int (*vidioc_s_modulator)      (struct file *file, void *fh,
189					struct v4l2_modulator *a);
190	/* Crop ioctls */
191	int (*vidioc_cropcap)          (struct file *file, void *fh,
192					struct v4l2_cropcap *a);
193	int (*vidioc_g_crop)           (struct file *file, void *fh,
194					struct v4l2_crop *a);
195	int (*vidioc_s_crop)           (struct file *file, void *fh,
196					struct v4l2_crop *a);
 
 
 
 
197	/* Compression ioctls */
198	int (*vidioc_g_jpegcomp)       (struct file *file, void *fh,
199					struct v4l2_jpegcompression *a);
200	int (*vidioc_s_jpegcomp)       (struct file *file, void *fh,
201					struct v4l2_jpegcompression *a);
202	int (*vidioc_g_enc_index)      (struct file *file, void *fh,
203					struct v4l2_enc_idx *a);
204	int (*vidioc_encoder_cmd)      (struct file *file, void *fh,
205					struct v4l2_encoder_cmd *a);
206	int (*vidioc_try_encoder_cmd)  (struct file *file, void *fh,
207					struct v4l2_encoder_cmd *a);
 
 
 
 
208
209	/* Stream type-dependent parameter ioctls */
210	int (*vidioc_g_parm)           (struct file *file, void *fh,
211					struct v4l2_streamparm *a);
212	int (*vidioc_s_parm)           (struct file *file, void *fh,
213					struct v4l2_streamparm *a);
214
215	/* Tuner ioctls */
216	int (*vidioc_g_tuner)          (struct file *file, void *fh,
217					struct v4l2_tuner *a);
218	int (*vidioc_s_tuner)          (struct file *file, void *fh,
219					struct v4l2_tuner *a);
220	int (*vidioc_g_frequency)      (struct file *file, void *fh,
221					struct v4l2_frequency *a);
222	int (*vidioc_s_frequency)      (struct file *file, void *fh,
223					struct v4l2_frequency *a);
 
 
224
225	/* Sliced VBI cap */
226	int (*vidioc_g_sliced_vbi_cap) (struct file *file, void *fh,
227					struct v4l2_sliced_vbi_cap *a);
228
229	/* Log status ioctl */
230	int (*vidioc_log_status)       (struct file *file, void *fh);
231
232	int (*vidioc_s_hw_freq_seek)   (struct file *file, void *fh,
233					struct v4l2_hw_freq_seek *a);
234
235	/* Debugging ioctls */
236#ifdef CONFIG_VIDEO_ADV_DEBUG
237	int (*vidioc_g_register)       (struct file *file, void *fh,
238					struct v4l2_dbg_register *reg);
239	int (*vidioc_s_register)       (struct file *file, void *fh,
240					struct v4l2_dbg_register *reg);
 
 
 
241#endif
242	int (*vidioc_g_chip_ident)     (struct file *file, void *fh,
243					struct v4l2_dbg_chip_ident *chip);
244
245	int (*vidioc_enum_framesizes)   (struct file *file, void *fh,
246					 struct v4l2_frmsizeenum *fsize);
247
248	int (*vidioc_enum_frameintervals) (struct file *file, void *fh,
249					   struct v4l2_frmivalenum *fival);
250
251	/* DV Timings IOCTLs */
252	int (*vidioc_enum_dv_presets) (struct file *file, void *fh,
253				       struct v4l2_dv_enum_preset *preset);
254
255	int (*vidioc_s_dv_preset) (struct file *file, void *fh,
256				   struct v4l2_dv_preset *preset);
257	int (*vidioc_g_dv_preset) (struct file *file, void *fh,
258				   struct v4l2_dv_preset *preset);
259	int (*vidioc_query_dv_preset) (struct file *file, void *fh,
260					struct v4l2_dv_preset *qpreset);
261	int (*vidioc_s_dv_timings) (struct file *file, void *fh,
262				    struct v4l2_dv_timings *timings);
263	int (*vidioc_g_dv_timings) (struct file *file, void *fh,
264				    struct v4l2_dv_timings *timings);
 
 
 
 
 
 
 
 
265
266	int (*vidioc_subscribe_event)  (struct v4l2_fh *fh,
267					struct v4l2_event_subscription *sub);
268	int (*vidioc_unsubscribe_event)(struct v4l2_fh *fh,
269					struct v4l2_event_subscription *sub);
270
271	/* For other private ioctls */
272	long (*vidioc_default)	       (struct file *file, void *fh,
273					bool valid_prio, int cmd, void *arg);
274};
275
276
277/* v4l debugging and diagnostics */
278
279/* Debug bitmask flags to be used on V4L2 */
280#define V4L2_DEBUG_IOCTL     0x01
281#define V4L2_DEBUG_IOCTL_ARG 0x02
282
283/* Use this macro for non-I2C drivers. Pass the driver name as the first arg. */
284#define v4l_print_ioctl(name, cmd)  		 \
285	do {  					 \
286		printk(KERN_DEBUG "%s: ", name); \
287		v4l_printk_ioctl(cmd);		 \
288	} while (0)
289
290/* Use this macro in I2C drivers where 'client' is the struct i2c_client
291   pointer */
292#define v4l_i2c_print_ioctl(client, cmd) 		   \
293	do {      					   \
294		v4l_client_printk(KERN_DEBUG, client, ""); \
295		v4l_printk_ioctl(cmd);			   \
296	} while (0)
297
298/*  Video standard functions  */
299extern const char *v4l2_norm_to_name(v4l2_std_id id);
300extern void v4l2_video_std_frame_period(int id, struct v4l2_fract *frameperiod);
301extern int v4l2_video_std_construct(struct v4l2_standard *vs,
302				    int id, const char *name);
303/* Prints the ioctl in a human-readable format */
304extern void v4l_printk_ioctl(unsigned int cmd);
 
 
 
 
 
 
305
306/* names for fancy debug output */
307extern const char *v4l2_field_names[];
308extern const char *v4l2_type_names[];
309
310#ifdef CONFIG_COMPAT
311/* 32 Bits compatibility layer for 64 bits processors */
312extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd,
313				unsigned long arg);
314#endif
315
316typedef long (*v4l2_kioctl)(struct file *file,
317		unsigned int cmd, void *arg);
318
319/* Include support for obsoleted stuff */
320extern long video_usercopy(struct file *file, unsigned int cmd,
321				unsigned long arg, v4l2_kioctl func);
322
323/* Standard handlers for V4L ioctl's */
324extern long video_ioctl2(struct file *file,
325			unsigned int cmd, unsigned long arg);
326
327#endif /* _V4L2_IOCTL_H */