Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 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> |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 14 | #include <linux/mutex.h> |
| 15 | #include <linux/compiler.h> /* need __user */ |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 16 | #include <linux/videodev2.h> |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 17 | |
Sakari Ailus | d3d7c96 | 2010-03-27 11:02:10 -0300 | [diff] [blame] | 18 | struct v4l2_fh; |
| 19 | |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 20 | struct 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 | |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 26 | /* VIDIOC_ENUM_FMT handlers */ |
| 27 | int (*vidioc_enum_fmt_vid_cap) (struct file *file, void *fh, |
| 28 | struct v4l2_fmtdesc *f); |
| 29 | int (*vidioc_enum_fmt_vid_overlay) (struct file *file, void *fh, |
| 30 | struct v4l2_fmtdesc *f); |
| 31 | int (*vidioc_enum_fmt_vid_out) (struct file *file, void *fh, |
| 32 | struct v4l2_fmtdesc *f); |
Pawel Osciak | d14e6d7 | 2010-12-23 04:15:27 -0300 | [diff] [blame] | 33 | int (*vidioc_enum_fmt_vid_cap_mplane)(struct file *file, void *fh, |
| 34 | struct v4l2_fmtdesc *f); |
| 35 | int (*vidioc_enum_fmt_vid_out_mplane)(struct file *file, void *fh, |
| 36 | struct v4l2_fmtdesc *f); |
Antti Palosaari | 855df1d | 2013-12-14 13:10:20 -0300 | [diff] [blame] | 37 | int (*vidioc_enum_fmt_sdr_cap) (struct file *file, void *fh, |
| 38 | struct v4l2_fmtdesc *f); |
Antti Palosaari | 9effc72 | 2015-10-10 13:51:00 -0300 | [diff] [blame] | 39 | int (*vidioc_enum_fmt_sdr_out) (struct file *file, void *fh, |
| 40 | struct v4l2_fmtdesc *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 41 | |
| 42 | /* VIDIOC_G_FMT handlers */ |
| 43 | int (*vidioc_g_fmt_vid_cap) (struct file *file, void *fh, |
| 44 | struct v4l2_format *f); |
| 45 | int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *fh, |
| 46 | struct v4l2_format *f); |
| 47 | int (*vidioc_g_fmt_vid_out) (struct file *file, void *fh, |
| 48 | struct v4l2_format *f); |
| 49 | int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *fh, |
| 50 | struct v4l2_format *f); |
| 51 | int (*vidioc_g_fmt_vbi_cap) (struct file *file, void *fh, |
| 52 | struct v4l2_format *f); |
| 53 | int (*vidioc_g_fmt_vbi_out) (struct file *file, void *fh, |
| 54 | struct v4l2_format *f); |
| 55 | int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *fh, |
| 56 | struct v4l2_format *f); |
| 57 | int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *fh, |
| 58 | struct v4l2_format *f); |
Pawel Osciak | d14e6d7 | 2010-12-23 04:15:27 -0300 | [diff] [blame] | 59 | int (*vidioc_g_fmt_vid_cap_mplane)(struct file *file, void *fh, |
| 60 | struct v4l2_format *f); |
| 61 | int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *fh, |
| 62 | struct v4l2_format *f); |
Antti Palosaari | 855df1d | 2013-12-14 13:10:20 -0300 | [diff] [blame] | 63 | int (*vidioc_g_fmt_sdr_cap) (struct file *file, void *fh, |
| 64 | struct v4l2_format *f); |
Antti Palosaari | 9effc72 | 2015-10-10 13:51:00 -0300 | [diff] [blame] | 65 | int (*vidioc_g_fmt_sdr_out) (struct file *file, void *fh, |
| 66 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 67 | |
| 68 | /* VIDIOC_S_FMT handlers */ |
| 69 | int (*vidioc_s_fmt_vid_cap) (struct file *file, void *fh, |
| 70 | struct v4l2_format *f); |
| 71 | int (*vidioc_s_fmt_vid_overlay)(struct file *file, void *fh, |
| 72 | struct v4l2_format *f); |
| 73 | int (*vidioc_s_fmt_vid_out) (struct file *file, void *fh, |
| 74 | struct v4l2_format *f); |
| 75 | int (*vidioc_s_fmt_vid_out_overlay)(struct file *file, void *fh, |
| 76 | struct v4l2_format *f); |
| 77 | int (*vidioc_s_fmt_vbi_cap) (struct file *file, void *fh, |
| 78 | struct v4l2_format *f); |
| 79 | int (*vidioc_s_fmt_vbi_out) (struct file *file, void *fh, |
| 80 | struct v4l2_format *f); |
| 81 | int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *file, void *fh, |
| 82 | struct v4l2_format *f); |
| 83 | int (*vidioc_s_fmt_sliced_vbi_out)(struct file *file, void *fh, |
| 84 | struct v4l2_format *f); |
Pawel Osciak | d14e6d7 | 2010-12-23 04:15:27 -0300 | [diff] [blame] | 85 | int (*vidioc_s_fmt_vid_cap_mplane)(struct file *file, void *fh, |
| 86 | struct v4l2_format *f); |
| 87 | int (*vidioc_s_fmt_vid_out_mplane)(struct file *file, void *fh, |
| 88 | struct v4l2_format *f); |
Antti Palosaari | 855df1d | 2013-12-14 13:10:20 -0300 | [diff] [blame] | 89 | int (*vidioc_s_fmt_sdr_cap) (struct file *file, void *fh, |
| 90 | struct v4l2_format *f); |
Antti Palosaari | 9effc72 | 2015-10-10 13:51:00 -0300 | [diff] [blame] | 91 | int (*vidioc_s_fmt_sdr_out) (struct file *file, void *fh, |
| 92 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 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); |
Pawel Osciak | d14e6d7 | 2010-12-23 04:15:27 -0300 | [diff] [blame] | 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); |
Antti Palosaari | 855df1d | 2013-12-14 13:10:20 -0300 | [diff] [blame] | 115 | int (*vidioc_try_fmt_sdr_cap) (struct file *file, void *fh, |
| 116 | struct v4l2_format *f); |
Antti Palosaari | 9effc72 | 2015-10-10 13:51:00 -0300 | [diff] [blame] | 117 | int (*vidioc_try_fmt_sdr_out) (struct file *file, void *fh, |
| 118 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 119 | |
| 120 | /* Buffer handlers */ |
| 121 | int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b); |
| 122 | int (*vidioc_querybuf)(struct file *file, void *fh, struct v4l2_buffer *b); |
| 123 | int (*vidioc_qbuf) (struct file *file, void *fh, struct v4l2_buffer *b); |
Tomasz Stanislawski | b799d09 | 2012-06-14 11:32:23 -0300 | [diff] [blame] | 124 | int (*vidioc_expbuf) (struct file *file, void *fh, |
| 125 | struct v4l2_exportbuffer *e); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 126 | int (*vidioc_dqbuf) (struct file *file, void *fh, struct v4l2_buffer *b); |
| 127 | |
Guennadi Liakhovetski | 2150158 | 2011-09-28 11:34:06 -0300 | [diff] [blame] | 128 | int (*vidioc_create_bufs)(struct file *file, void *fh, struct v4l2_create_buffers *b); |
| 129 | int (*vidioc_prepare_buf)(struct file *file, void *fh, struct v4l2_buffer *b); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 130 | |
| 131 | int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 132 | int (*vidioc_g_fbuf) (struct file *file, void *fh, |
| 133 | struct v4l2_framebuffer *a); |
| 134 | int (*vidioc_s_fbuf) (struct file *file, void *fh, |
Hans Verkuil | e6eb28c | 2012-09-04 10:26:45 -0300 | [diff] [blame] | 135 | const struct v4l2_framebuffer *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 136 | |
| 137 | /* Stream on/off */ |
| 138 | int (*vidioc_streamon) (struct file *file, void *fh, enum v4l2_buf_type i); |
| 139 | int (*vidioc_streamoff)(struct file *file, void *fh, enum v4l2_buf_type i); |
| 140 | |
| 141 | /* Standard handling |
| 142 | ENUMSTD is handled by videodev.c |
| 143 | */ |
| 144 | int (*vidioc_g_std) (struct file *file, void *fh, v4l2_std_id *norm); |
Hans Verkuil | 314527a | 2013-03-15 06:10:40 -0300 | [diff] [blame] | 145 | int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id norm); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 146 | int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a); |
| 147 | |
| 148 | /* Input handling */ |
| 149 | int (*vidioc_enum_input)(struct file *file, void *fh, |
| 150 | struct v4l2_input *inp); |
| 151 | int (*vidioc_g_input) (struct file *file, void *fh, unsigned int *i); |
| 152 | int (*vidioc_s_input) (struct file *file, void *fh, unsigned int i); |
| 153 | |
| 154 | /* Output handling */ |
| 155 | int (*vidioc_enum_output) (struct file *file, void *fh, |
| 156 | struct v4l2_output *a); |
| 157 | int (*vidioc_g_output) (struct file *file, void *fh, unsigned int *i); |
| 158 | int (*vidioc_s_output) (struct file *file, void *fh, unsigned int i); |
| 159 | |
| 160 | /* Control handling */ |
| 161 | int (*vidioc_queryctrl) (struct file *file, void *fh, |
| 162 | struct v4l2_queryctrl *a); |
Hans Verkuil | e6bee36 | 2014-06-10 04:22:06 -0300 | [diff] [blame] | 163 | int (*vidioc_query_ext_ctrl) (struct file *file, void *fh, |
| 164 | struct v4l2_query_ext_ctrl *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 165 | int (*vidioc_g_ctrl) (struct file *file, void *fh, |
| 166 | struct v4l2_control *a); |
| 167 | int (*vidioc_s_ctrl) (struct file *file, void *fh, |
| 168 | struct v4l2_control *a); |
| 169 | int (*vidioc_g_ext_ctrls) (struct file *file, void *fh, |
| 170 | struct v4l2_ext_controls *a); |
| 171 | int (*vidioc_s_ext_ctrls) (struct file *file, void *fh, |
| 172 | struct v4l2_ext_controls *a); |
| 173 | int (*vidioc_try_ext_ctrls) (struct file *file, void *fh, |
| 174 | struct v4l2_ext_controls *a); |
| 175 | int (*vidioc_querymenu) (struct file *file, void *fh, |
| 176 | struct v4l2_querymenu *a); |
| 177 | |
| 178 | /* Audio ioctls */ |
| 179 | int (*vidioc_enumaudio) (struct file *file, void *fh, |
| 180 | struct v4l2_audio *a); |
| 181 | int (*vidioc_g_audio) (struct file *file, void *fh, |
| 182 | struct v4l2_audio *a); |
| 183 | int (*vidioc_s_audio) (struct file *file, void *fh, |
Hans Verkuil | 0e8025b9 | 2012-09-04 11:59:31 -0300 | [diff] [blame] | 184 | const struct v4l2_audio *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 185 | |
| 186 | /* Audio out ioctls */ |
| 187 | int (*vidioc_enumaudout) (struct file *file, void *fh, |
| 188 | struct v4l2_audioout *a); |
| 189 | int (*vidioc_g_audout) (struct file *file, void *fh, |
| 190 | struct v4l2_audioout *a); |
| 191 | int (*vidioc_s_audout) (struct file *file, void *fh, |
Hans Verkuil | ba9425b | 2012-09-04 12:03:49 -0300 | [diff] [blame] | 192 | const struct v4l2_audioout *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 193 | int (*vidioc_g_modulator) (struct file *file, void *fh, |
| 194 | struct v4l2_modulator *a); |
| 195 | int (*vidioc_s_modulator) (struct file *file, void *fh, |
Hans Verkuil | 3f70e1f5 | 2012-09-04 12:08:47 -0300 | [diff] [blame] | 196 | const struct v4l2_modulator *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 197 | /* Crop ioctls */ |
| 198 | int (*vidioc_cropcap) (struct file *file, void *fh, |
| 199 | struct v4l2_cropcap *a); |
| 200 | int (*vidioc_g_crop) (struct file *file, void *fh, |
| 201 | struct v4l2_crop *a); |
| 202 | int (*vidioc_s_crop) (struct file *file, void *fh, |
Hans Verkuil | 4f99659 | 2012-09-05 05:10:48 -0300 | [diff] [blame] | 203 | const struct v4l2_crop *a); |
Tomasz Stanislawski | 0e8caac | 2011-08-10 10:37:47 -0300 | [diff] [blame] | 204 | int (*vidioc_g_selection) (struct file *file, void *fh, |
| 205 | struct v4l2_selection *s); |
| 206 | int (*vidioc_s_selection) (struct file *file, void *fh, |
| 207 | struct v4l2_selection *s); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 208 | /* Compression ioctls */ |
| 209 | int (*vidioc_g_jpegcomp) (struct file *file, void *fh, |
| 210 | struct v4l2_jpegcompression *a); |
| 211 | int (*vidioc_s_jpegcomp) (struct file *file, void *fh, |
Hans Verkuil | d88aab5 | 2012-09-17 05:05:25 -0300 | [diff] [blame] | 212 | const struct v4l2_jpegcompression *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 213 | int (*vidioc_g_enc_index) (struct file *file, void *fh, |
| 214 | struct v4l2_enc_idx *a); |
| 215 | int (*vidioc_encoder_cmd) (struct file *file, void *fh, |
| 216 | struct v4l2_encoder_cmd *a); |
| 217 | int (*vidioc_try_encoder_cmd) (struct file *file, void *fh, |
| 218 | struct v4l2_encoder_cmd *a); |
Hans Verkuil | a45c0ad | 2011-11-24 09:53:43 -0300 | [diff] [blame] | 219 | int (*vidioc_decoder_cmd) (struct file *file, void *fh, |
| 220 | struct v4l2_decoder_cmd *a); |
| 221 | int (*vidioc_try_decoder_cmd) (struct file *file, void *fh, |
| 222 | struct v4l2_decoder_cmd *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 223 | |
| 224 | /* Stream type-dependent parameter ioctls */ |
| 225 | int (*vidioc_g_parm) (struct file *file, void *fh, |
| 226 | struct v4l2_streamparm *a); |
| 227 | int (*vidioc_s_parm) (struct file *file, void *fh, |
| 228 | struct v4l2_streamparm *a); |
| 229 | |
| 230 | /* Tuner ioctls */ |
| 231 | int (*vidioc_g_tuner) (struct file *file, void *fh, |
| 232 | struct v4l2_tuner *a); |
| 233 | int (*vidioc_s_tuner) (struct file *file, void *fh, |
Hans Verkuil | 2f73c7c | 2013-03-15 06:10:06 -0300 | [diff] [blame] | 234 | const struct v4l2_tuner *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 235 | int (*vidioc_g_frequency) (struct file *file, void *fh, |
| 236 | struct v4l2_frequency *a); |
| 237 | int (*vidioc_s_frequency) (struct file *file, void *fh, |
Hans Verkuil | b530a44 | 2013-03-19 04:09:26 -0300 | [diff] [blame] | 238 | const struct v4l2_frequency *a); |
Hans Verkuil | 82b655b | 2012-07-05 06:37:08 -0300 | [diff] [blame] | 239 | int (*vidioc_enum_freq_bands) (struct file *file, void *fh, |
| 240 | struct v4l2_frequency_band *band); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 241 | |
| 242 | /* Sliced VBI cap */ |
| 243 | int (*vidioc_g_sliced_vbi_cap) (struct file *file, void *fh, |
| 244 | struct v4l2_sliced_vbi_cap *a); |
| 245 | |
| 246 | /* Log status ioctl */ |
| 247 | int (*vidioc_log_status) (struct file *file, void *fh); |
| 248 | |
| 249 | int (*vidioc_s_hw_freq_seek) (struct file *file, void *fh, |
Hans Verkuil | ec6f432 | 2012-09-14 07:41:18 -0300 | [diff] [blame] | 250 | const struct v4l2_hw_freq_seek *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 251 | |
| 252 | /* Debugging ioctls */ |
| 253 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
| 254 | int (*vidioc_g_register) (struct file *file, void *fh, |
Hans Verkuil | aecde8b5 | 2008-12-30 07:14:19 -0300 | [diff] [blame] | 255 | struct v4l2_dbg_register *reg); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 256 | int (*vidioc_s_register) (struct file *file, void *fh, |
Hans Verkuil | 977ba3b | 2013-03-24 08:28:46 -0300 | [diff] [blame] | 257 | const struct v4l2_dbg_register *reg); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 258 | |
Hans Verkuil | 96b03d2 | 2013-04-06 06:16:58 -0300 | [diff] [blame] | 259 | int (*vidioc_g_chip_info) (struct file *file, void *fh, |
| 260 | struct v4l2_dbg_chip_info *chip); |
Hans Verkuil | cd634f1 | 2013-03-27 08:04:23 -0300 | [diff] [blame] | 261 | #endif |
Hans Verkuil | 79b0c64 | 2013-03-18 12:16:34 -0300 | [diff] [blame] | 262 | |
Mauro Carvalho Chehab | 74d83fa | 2008-11-11 21:13:47 -0300 | [diff] [blame] | 263 | int (*vidioc_enum_framesizes) (struct file *file, void *fh, |
| 264 | struct v4l2_frmsizeenum *fsize); |
| 265 | |
| 266 | int (*vidioc_enum_frameintervals) (struct file *file, void *fh, |
| 267 | struct v4l2_frmivalenum *fival); |
| 268 | |
Muralidharan Karicheri | b6456c0 | 2009-11-19 12:00:31 -0300 | [diff] [blame] | 269 | /* DV Timings IOCTLs */ |
Muralidharan Karicheri | b6456c0 | 2009-11-19 12:00:31 -0300 | [diff] [blame] | 270 | int (*vidioc_s_dv_timings) (struct file *file, void *fh, |
| 271 | struct v4l2_dv_timings *timings); |
| 272 | int (*vidioc_g_dv_timings) (struct file *file, void *fh, |
| 273 | struct v4l2_dv_timings *timings); |
Hans Verkuil | 5d7758e | 2012-05-15 08:06:44 -0300 | [diff] [blame] | 274 | int (*vidioc_query_dv_timings) (struct file *file, void *fh, |
| 275 | struct v4l2_dv_timings *timings); |
| 276 | int (*vidioc_enum_dv_timings) (struct file *file, void *fh, |
| 277 | struct v4l2_enum_dv_timings *timings); |
| 278 | int (*vidioc_dv_timings_cap) (struct file *file, void *fh, |
| 279 | struct v4l2_dv_timings_cap *cap); |
Hans Verkuil | dd519bb | 2014-03-07 07:18:37 -0300 | [diff] [blame] | 280 | int (*vidioc_g_edid) (struct file *file, void *fh, struct v4l2_edid *edid); |
| 281 | int (*vidioc_s_edid) (struct file *file, void *fh, struct v4l2_edid *edid); |
Muralidharan Karicheri | b6456c0 | 2009-11-19 12:00:31 -0300 | [diff] [blame] | 282 | |
Sakari Ailus | d3d7c96 | 2010-03-27 11:02:10 -0300 | [diff] [blame] | 283 | int (*vidioc_subscribe_event) (struct v4l2_fh *fh, |
Hans Verkuil | 85f5fe3 | 2012-09-04 11:46:09 -0300 | [diff] [blame] | 284 | const struct v4l2_event_subscription *sub); |
Sakari Ailus | d3d7c96 | 2010-03-27 11:02:10 -0300 | [diff] [blame] | 285 | int (*vidioc_unsubscribe_event)(struct v4l2_fh *fh, |
Hans Verkuil | 85f5fe3 | 2012-09-04 11:46:09 -0300 | [diff] [blame] | 286 | const struct v4l2_event_subscription *sub); |
Sakari Ailus | d3d7c96 | 2010-03-27 11:02:10 -0300 | [diff] [blame] | 287 | |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 288 | /* For other private ioctls */ |
Hans Verkuil | 069b747 | 2008-12-30 07:04:34 -0300 | [diff] [blame] | 289 | long (*vidioc_default) (struct file *file, void *fh, |
Mauro Carvalho Chehab | 6d43be7 | 2013-03-26 08:04:52 -0300 | [diff] [blame] | 290 | bool valid_prio, unsigned int cmd, void *arg); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 291 | }; |
| 292 | |
| 293 | |
Mauro Carvalho Chehab | 2864462 | 2008-07-20 20:26:54 -0300 | [diff] [blame] | 294 | /* v4l debugging and diagnostics */ |
| 295 | |
Hans Verkuil | 17028cd | 2014-12-01 10:10:44 -0300 | [diff] [blame] | 296 | /* Device debug flags to be used with the video device debug attribute */ |
| 297 | |
| 298 | /* Just log the ioctl name + error code */ |
| 299 | #define V4L2_DEV_DEBUG_IOCTL 0x01 |
| 300 | /* Log the ioctl name arguments + error code */ |
| 301 | #define V4L2_DEV_DEBUG_IOCTL_ARG 0x02 |
| 302 | /* Log the file operations open, release, mmap and get_unmapped_area */ |
| 303 | #define V4L2_DEV_DEBUG_FOP 0x04 |
| 304 | /* Log the read and write file operations and the VIDIOC_(D)QBUF ioctls */ |
| 305 | #define V4L2_DEV_DEBUG_STREAMING 0x08 |
| 306 | /* Log poll() */ |
| 307 | #define V4L2_DEV_DEBUG_POLL 0x10 |
Mauro Carvalho Chehab | 2864462 | 2008-07-20 20:26:54 -0300 | [diff] [blame] | 308 | |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 309 | /* Video standard functions */ |
| 310 | extern const char *v4l2_norm_to_name(v4l2_std_id id); |
Trent Piepho | 51f0b8d5 | 2009-03-04 01:21:02 -0300 | [diff] [blame] | 311 | extern void v4l2_video_std_frame_period(int id, struct v4l2_fract *frameperiod); |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 312 | extern int v4l2_video_std_construct(struct v4l2_standard *vs, |
| 313 | int id, const char *name); |
Hans Verkuil | 4a08516 | 2012-06-22 06:38:06 -0300 | [diff] [blame] | 314 | /* Prints the ioctl in a human-readable format. If prefix != NULL, |
| 315 | then do printk(KERN_DEBUG "%s: ", prefix) first. */ |
| 316 | extern void v4l_printk_ioctl(const char *prefix, unsigned int cmd); |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 317 | |
Hans Verkuil | 5a5adf6 | 2012-06-22 07:29:35 -0300 | [diff] [blame] | 318 | /* Internal use only: get the mutex (if any) that we need to lock for the |
| 319 | given command. */ |
| 320 | struct video_device; |
| 321 | extern struct mutex *v4l2_ioctl_get_lock(struct video_device *vdev, unsigned cmd); |
| 322 | |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 323 | /* names for fancy debug output */ |
| 324 | extern const char *v4l2_field_names[]; |
| 325 | extern const char *v4l2_type_names[]; |
| 326 | |
Hans Verkuil | bec4366 | 2008-12-30 06:58:20 -0300 | [diff] [blame] | 327 | #ifdef CONFIG_COMPAT |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 328 | /* 32 Bits compatibility layer for 64 bits processors */ |
Hans Verkuil | 9bb7cde | 2008-12-30 06:42:40 -0300 | [diff] [blame] | 329 | extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 330 | unsigned long arg); |
Hans Verkuil | bec4366 | 2008-12-30 06:58:20 -0300 | [diff] [blame] | 331 | #endif |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 332 | |
Hans Verkuil | 08af245 | 2010-12-24 10:33:19 -0300 | [diff] [blame] | 333 | typedef long (*v4l2_kioctl)(struct file *file, |
| 334 | unsigned int cmd, void *arg); |
| 335 | |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 336 | /* Include support for obsoleted stuff */ |
Hans Verkuil | 069b747 | 2008-12-30 07:04:34 -0300 | [diff] [blame] | 337 | extern long video_usercopy(struct file *file, unsigned int cmd, |
Hans Verkuil | f473bf7 | 2008-11-01 08:25:11 -0300 | [diff] [blame] | 338 | unsigned long arg, v4l2_kioctl func); |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 339 | |
Mauro Carvalho Chehab | 8a522c9 | 2008-10-21 11:58:39 -0300 | [diff] [blame] | 340 | /* Standard handlers for V4L ioctl's */ |
Hans Verkuil | 069b747 | 2008-12-30 07:04:34 -0300 | [diff] [blame] | 341 | extern long video_ioctl2(struct file *file, |
Mauro Carvalho Chehab | 8a522c9 | 2008-10-21 11:58:39 -0300 | [diff] [blame] | 342 | unsigned int cmd, unsigned long arg); |
| 343 | |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 344 | #endif /* _V4L2_IOCTL_H */ |