Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 2 | /* |
| 3 | * |
| 4 | * V 4 L 2 D R I V E R H E L P E R A P I |
| 5 | * |
| 6 | * Moved from videodev2.h |
| 7 | * |
| 8 | * Some commonly needed functions for drivers (v4l2-common.o module) |
| 9 | */ |
| 10 | #ifndef _V4L2_IOCTL_H |
| 11 | #define _V4L2_IOCTL_H |
| 12 | |
| 13 | #include <linux/poll.h> |
| 14 | #include <linux/fs.h> |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 15 | #include <linux/mutex.h> |
Ingo Molnar | 174cd4b | 2017-02-02 19:15:33 +0100 | [diff] [blame] | 16 | #include <linux/sched/signal.h> |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 17 | #include <linux/compiler.h> /* need __user */ |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 18 | #include <linux/videodev2.h> |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 19 | |
Sakari Ailus | d3d7c96 | 2010-03-27 11:02:10 -0300 | [diff] [blame] | 20 | struct v4l2_fh; |
| 21 | |
Mauro Carvalho Chehab | c91661f | 2016-07-22 16:22:41 -0300 | [diff] [blame] | 22 | /** |
| 23 | * struct v4l2_ioctl_ops - describe operations for each V4L2 ioctl |
| 24 | * |
| 25 | * @vidioc_querycap: pointer to the function that implements |
| 26 | * :ref:`VIDIOC_QUERYCAP <vidioc_querycap>` ioctl |
| 27 | * @vidioc_enum_fmt_vid_cap: pointer to the function that implements |
| 28 | * :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic |
Boris Brezillon | 7e98b7b | 2019-06-04 03:06:25 -0400 | [diff] [blame] | 29 | * for video capture in single and multi plane mode |
Mauro Carvalho Chehab | c91661f | 2016-07-22 16:22:41 -0300 | [diff] [blame] | 30 | * @vidioc_enum_fmt_vid_overlay: pointer to the function that implements |
| 31 | * :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic |
| 32 | * for video overlay |
| 33 | * @vidioc_enum_fmt_vid_out: pointer to the function that implements |
| 34 | * :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic |
Boris Brezillon | 7e98b7b | 2019-06-04 03:06:25 -0400 | [diff] [blame] | 35 | * for video output in single and multi plane mode |
Mauro Carvalho Chehab | c91661f | 2016-07-22 16:22:41 -0300 | [diff] [blame] | 36 | * @vidioc_enum_fmt_sdr_cap: pointer to the function that implements |
| 37 | * :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic |
| 38 | * for Software Defined Radio capture |
| 39 | * @vidioc_enum_fmt_sdr_out: pointer to the function that implements |
| 40 | * :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic |
| 41 | * for Software Defined Radio output |
Laurent Pinchart | fb9ffa6 | 2016-04-12 19:40:46 -0300 | [diff] [blame] | 42 | * @vidioc_enum_fmt_meta_cap: pointer to the function that implements |
| 43 | * :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic |
| 44 | * for metadata capture |
Sakari Ailus | 72148d1 | 2017-06-16 08:38:31 -0400 | [diff] [blame] | 45 | * @vidioc_enum_fmt_meta_out: pointer to the function that implements |
| 46 | * :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic |
| 47 | * for metadata output |
Mauro Carvalho Chehab | c91661f | 2016-07-22 16:22:41 -0300 | [diff] [blame] | 48 | * @vidioc_g_fmt_vid_cap: pointer to the function that implements |
| 49 | * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video capture |
| 50 | * in single plane mode |
| 51 | * @vidioc_g_fmt_vid_overlay: pointer to the function that implements |
| 52 | * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video overlay |
| 53 | * @vidioc_g_fmt_vid_out: pointer to the function that implements |
| 54 | * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video out |
| 55 | * in single plane mode |
| 56 | * @vidioc_g_fmt_vid_out_overlay: pointer to the function that implements |
| 57 | * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video overlay output |
| 58 | * @vidioc_g_fmt_vbi_cap: pointer to the function that implements |
| 59 | * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture |
| 60 | * @vidioc_g_fmt_vbi_out: pointer to the function that implements |
| 61 | * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output |
| 62 | * @vidioc_g_fmt_sliced_vbi_cap: pointer to the function that implements |
| 63 | * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI capture |
| 64 | * @vidioc_g_fmt_sliced_vbi_out: pointer to the function that implements |
| 65 | * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output |
| 66 | * @vidioc_g_fmt_vid_cap_mplane: pointer to the function that implements |
| 67 | * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video capture |
| 68 | * in multiple plane mode |
| 69 | * @vidioc_g_fmt_vid_out_mplane: pointer to the function that implements |
| 70 | * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video out |
| 71 | * in multiplane plane mode |
| 72 | * @vidioc_g_fmt_sdr_cap: pointer to the function that implements |
| 73 | * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for Software Defined |
| 74 | * Radio capture |
| 75 | * @vidioc_g_fmt_sdr_out: pointer to the function that implements |
| 76 | * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for Software Defined |
| 77 | * Radio output |
Laurent Pinchart | fb9ffa6 | 2016-04-12 19:40:46 -0300 | [diff] [blame] | 78 | * @vidioc_g_fmt_meta_cap: pointer to the function that implements |
| 79 | * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for metadata capture |
Sakari Ailus | 72148d1 | 2017-06-16 08:38:31 -0400 | [diff] [blame] | 80 | * @vidioc_g_fmt_meta_out: pointer to the function that implements |
| 81 | * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for metadata output |
Mauro Carvalho Chehab | c91661f | 2016-07-22 16:22:41 -0300 | [diff] [blame] | 82 | * @vidioc_s_fmt_vid_cap: pointer to the function that implements |
| 83 | * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video capture |
| 84 | * in single plane mode |
| 85 | * @vidioc_s_fmt_vid_overlay: pointer to the function that implements |
| 86 | * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video overlay |
| 87 | * @vidioc_s_fmt_vid_out: pointer to the function that implements |
| 88 | * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video out |
| 89 | * in single plane mode |
| 90 | * @vidioc_s_fmt_vid_out_overlay: pointer to the function that implements |
| 91 | * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video overlay output |
| 92 | * @vidioc_s_fmt_vbi_cap: pointer to the function that implements |
| 93 | * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture |
| 94 | * @vidioc_s_fmt_vbi_out: pointer to the function that implements |
| 95 | * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output |
| 96 | * @vidioc_s_fmt_sliced_vbi_cap: pointer to the function that implements |
| 97 | * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI capture |
| 98 | * @vidioc_s_fmt_sliced_vbi_out: pointer to the function that implements |
| 99 | * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output |
| 100 | * @vidioc_s_fmt_vid_cap_mplane: pointer to the function that implements |
| 101 | * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video capture |
| 102 | * in multiple plane mode |
| 103 | * @vidioc_s_fmt_vid_out_mplane: pointer to the function that implements |
| 104 | * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video out |
| 105 | * in multiplane plane mode |
| 106 | * @vidioc_s_fmt_sdr_cap: pointer to the function that implements |
| 107 | * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for Software Defined |
| 108 | * Radio capture |
| 109 | * @vidioc_s_fmt_sdr_out: pointer to the function that implements |
| 110 | * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for Software Defined |
| 111 | * Radio output |
Laurent Pinchart | fb9ffa6 | 2016-04-12 19:40:46 -0300 | [diff] [blame] | 112 | * @vidioc_s_fmt_meta_cap: pointer to the function that implements |
| 113 | * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for metadata capture |
Sakari Ailus | 72148d1 | 2017-06-16 08:38:31 -0400 | [diff] [blame] | 114 | * @vidioc_s_fmt_meta_out: pointer to the function that implements |
| 115 | * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for metadata output |
Mauro Carvalho Chehab | c91661f | 2016-07-22 16:22:41 -0300 | [diff] [blame] | 116 | * @vidioc_try_fmt_vid_cap: pointer to the function that implements |
| 117 | * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video capture |
| 118 | * in single plane mode |
| 119 | * @vidioc_try_fmt_vid_overlay: pointer to the function that implements |
| 120 | * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video overlay |
| 121 | * @vidioc_try_fmt_vid_out: pointer to the function that implements |
| 122 | * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video out |
| 123 | * in single plane mode |
| 124 | * @vidioc_try_fmt_vid_out_overlay: pointer to the function that implements |
| 125 | * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video overlay |
| 126 | * output |
| 127 | * @vidioc_try_fmt_vbi_cap: pointer to the function that implements |
| 128 | * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture |
| 129 | * @vidioc_try_fmt_vbi_out: pointer to the function that implements |
| 130 | * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output |
| 131 | * @vidioc_try_fmt_sliced_vbi_cap: pointer to the function that implements |
| 132 | * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI |
| 133 | * capture |
| 134 | * @vidioc_try_fmt_sliced_vbi_out: pointer to the function that implements |
| 135 | * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output |
| 136 | * @vidioc_try_fmt_vid_cap_mplane: pointer to the function that implements |
| 137 | * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video capture |
| 138 | * in multiple plane mode |
| 139 | * @vidioc_try_fmt_vid_out_mplane: pointer to the function that implements |
| 140 | * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video out |
| 141 | * in multiplane plane mode |
| 142 | * @vidioc_try_fmt_sdr_cap: pointer to the function that implements |
| 143 | * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for Software Defined |
| 144 | * Radio capture |
| 145 | * @vidioc_try_fmt_sdr_out: pointer to the function that implements |
| 146 | * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for Software Defined |
| 147 | * Radio output |
Laurent Pinchart | fb9ffa6 | 2016-04-12 19:40:46 -0300 | [diff] [blame] | 148 | * @vidioc_try_fmt_meta_cap: pointer to the function that implements |
| 149 | * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for metadata capture |
Sakari Ailus | 72148d1 | 2017-06-16 08:38:31 -0400 | [diff] [blame] | 150 | * @vidioc_try_fmt_meta_out: pointer to the function that implements |
| 151 | * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for metadata output |
Mauro Carvalho Chehab | c91661f | 2016-07-22 16:22:41 -0300 | [diff] [blame] | 152 | * @vidioc_reqbufs: pointer to the function that implements |
| 153 | * :ref:`VIDIOC_REQBUFS <vidioc_reqbufs>` ioctl |
| 154 | * @vidioc_querybuf: pointer to the function that implements |
| 155 | * :ref:`VIDIOC_QUERYBUF <vidioc_querybuf>` ioctl |
| 156 | * @vidioc_qbuf: pointer to the function that implements |
| 157 | * :ref:`VIDIOC_QBUF <vidioc_qbuf>` ioctl |
| 158 | * @vidioc_expbuf: pointer to the function that implements |
| 159 | * :ref:`VIDIOC_EXPBUF <vidioc_expbuf>` ioctl |
| 160 | * @vidioc_dqbuf: pointer to the function that implements |
| 161 | * :ref:`VIDIOC_DQBUF <vidioc_qbuf>` ioctl |
| 162 | * @vidioc_create_bufs: pointer to the function that implements |
| 163 | * :ref:`VIDIOC_CREATE_BUFS <vidioc_create_bufs>` ioctl |
| 164 | * @vidioc_prepare_buf: pointer to the function that implements |
| 165 | * :ref:`VIDIOC_PREPARE_BUF <vidioc_prepare_buf>` ioctl |
| 166 | * @vidioc_overlay: pointer to the function that implements |
| 167 | * :ref:`VIDIOC_OVERLAY <vidioc_overlay>` ioctl |
| 168 | * @vidioc_g_fbuf: pointer to the function that implements |
| 169 | * :ref:`VIDIOC_G_FBUF <vidioc_g_fbuf>` ioctl |
| 170 | * @vidioc_s_fbuf: pointer to the function that implements |
| 171 | * :ref:`VIDIOC_S_FBUF <vidioc_g_fbuf>` ioctl |
| 172 | * @vidioc_streamon: pointer to the function that implements |
| 173 | * :ref:`VIDIOC_STREAMON <vidioc_streamon>` ioctl |
| 174 | * @vidioc_streamoff: pointer to the function that implements |
| 175 | * :ref:`VIDIOC_STREAMOFF <vidioc_streamon>` ioctl |
| 176 | * @vidioc_g_std: pointer to the function that implements |
| 177 | * :ref:`VIDIOC_G_STD <vidioc_g_std>` ioctl |
| 178 | * @vidioc_s_std: pointer to the function that implements |
| 179 | * :ref:`VIDIOC_S_STD <vidioc_g_std>` ioctl |
| 180 | * @vidioc_querystd: pointer to the function that implements |
| 181 | * :ref:`VIDIOC_QUERYSTD <vidioc_querystd>` ioctl |
| 182 | * @vidioc_enum_input: pointer to the function that implements |
| 183 | * :ref:`VIDIOC_ENUM_INPUT <vidioc_g_input>` ioctl |
| 184 | * @vidioc_g_input: pointer to the function that implements |
| 185 | * :ref:`VIDIOC_G_INPUT <vidioc_g_input>` ioctl |
| 186 | * @vidioc_s_input: pointer to the function that implements |
| 187 | * :ref:`VIDIOC_S_INPUT <vidioc_g_input>` ioctl |
| 188 | * @vidioc_enum_output: pointer to the function that implements |
| 189 | * :ref:`VIDIOC_ENUM_OUTPUT <vidioc_g_output>` ioctl |
| 190 | * @vidioc_g_output: pointer to the function that implements |
| 191 | * :ref:`VIDIOC_G_OUTPUT <vidioc_g_output>` ioctl |
| 192 | * @vidioc_s_output: pointer to the function that implements |
| 193 | * :ref:`VIDIOC_S_OUTPUT <vidioc_g_output>` ioctl |
| 194 | * @vidioc_queryctrl: pointer to the function that implements |
| 195 | * :ref:`VIDIOC_QUERYCTRL <vidioc_queryctrl>` ioctl |
| 196 | * @vidioc_query_ext_ctrl: pointer to the function that implements |
| 197 | * :ref:`VIDIOC_QUERY_EXT_CTRL <vidioc_queryctrl>` ioctl |
| 198 | * @vidioc_g_ctrl: pointer to the function that implements |
| 199 | * :ref:`VIDIOC_G_CTRL <vidioc_g_ctrl>` ioctl |
| 200 | * @vidioc_s_ctrl: pointer to the function that implements |
| 201 | * :ref:`VIDIOC_S_CTRL <vidioc_g_ctrl>` ioctl |
| 202 | * @vidioc_g_ext_ctrls: pointer to the function that implements |
| 203 | * :ref:`VIDIOC_G_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl |
| 204 | * @vidioc_s_ext_ctrls: pointer to the function that implements |
| 205 | * :ref:`VIDIOC_S_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl |
| 206 | * @vidioc_try_ext_ctrls: pointer to the function that implements |
| 207 | * :ref:`VIDIOC_TRY_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl |
| 208 | * @vidioc_querymenu: pointer to the function that implements |
| 209 | * :ref:`VIDIOC_QUERYMENU <vidioc_queryctrl>` ioctl |
| 210 | * @vidioc_enumaudio: pointer to the function that implements |
| 211 | * :ref:`VIDIOC_ENUMAUDIO <vidioc_enumaudio>` ioctl |
| 212 | * @vidioc_g_audio: pointer to the function that implements |
| 213 | * :ref:`VIDIOC_G_AUDIO <vidioc_g_audio>` ioctl |
| 214 | * @vidioc_s_audio: pointer to the function that implements |
| 215 | * :ref:`VIDIOC_S_AUDIO <vidioc_g_audio>` ioctl |
| 216 | * @vidioc_enumaudout: pointer to the function that implements |
| 217 | * :ref:`VIDIOC_ENUMAUDOUT <vidioc_enumaudout>` ioctl |
| 218 | * @vidioc_g_audout: pointer to the function that implements |
| 219 | * :ref:`VIDIOC_G_AUDOUT <vidioc_g_audout>` ioctl |
| 220 | * @vidioc_s_audout: pointer to the function that implements |
| 221 | * :ref:`VIDIOC_S_AUDOUT <vidioc_g_audout>` ioctl |
| 222 | * @vidioc_g_modulator: pointer to the function that implements |
| 223 | * :ref:`VIDIOC_G_MODULATOR <vidioc_g_modulator>` ioctl |
| 224 | * @vidioc_s_modulator: pointer to the function that implements |
| 225 | * :ref:`VIDIOC_S_MODULATOR <vidioc_g_modulator>` ioctl |
Hans Verkuil | 5200ab6 | 2018-10-04 17:38:15 -0400 | [diff] [blame] | 226 | * @vidioc_g_pixelaspect: pointer to the function that implements |
| 227 | * the pixelaspect part of the :ref:`VIDIOC_CROPCAP <vidioc_cropcap>` ioctl |
Mauro Carvalho Chehab | c91661f | 2016-07-22 16:22:41 -0300 | [diff] [blame] | 228 | * @vidioc_g_selection: pointer to the function that implements |
| 229 | * :ref:`VIDIOC_G_SELECTION <vidioc_g_selection>` ioctl |
| 230 | * @vidioc_s_selection: pointer to the function that implements |
| 231 | * :ref:`VIDIOC_S_SELECTION <vidioc_g_selection>` ioctl |
| 232 | * @vidioc_g_jpegcomp: pointer to the function that implements |
| 233 | * :ref:`VIDIOC_G_JPEGCOMP <vidioc_g_jpegcomp>` ioctl |
| 234 | * @vidioc_s_jpegcomp: pointer to the function that implements |
| 235 | * :ref:`VIDIOC_S_JPEGCOMP <vidioc_g_jpegcomp>` ioctl |
| 236 | * @vidioc_g_enc_index: pointer to the function that implements |
| 237 | * :ref:`VIDIOC_G_ENC_INDEX <vidioc_g_enc_index>` ioctl |
| 238 | * @vidioc_encoder_cmd: pointer to the function that implements |
| 239 | * :ref:`VIDIOC_ENCODER_CMD <vidioc_encoder_cmd>` ioctl |
| 240 | * @vidioc_try_encoder_cmd: pointer to the function that implements |
| 241 | * :ref:`VIDIOC_TRY_ENCODER_CMD <vidioc_encoder_cmd>` ioctl |
| 242 | * @vidioc_decoder_cmd: pointer to the function that implements |
| 243 | * :ref:`VIDIOC_DECODER_CMD <vidioc_decoder_cmd>` ioctl |
| 244 | * @vidioc_try_decoder_cmd: pointer to the function that implements |
| 245 | * :ref:`VIDIOC_TRY_DECODER_CMD <vidioc_decoder_cmd>` ioctl |
| 246 | * @vidioc_g_parm: pointer to the function that implements |
| 247 | * :ref:`VIDIOC_G_PARM <vidioc_g_parm>` ioctl |
| 248 | * @vidioc_s_parm: pointer to the function that implements |
| 249 | * :ref:`VIDIOC_S_PARM <vidioc_g_parm>` ioctl |
| 250 | * @vidioc_g_tuner: pointer to the function that implements |
| 251 | * :ref:`VIDIOC_G_TUNER <vidioc_g_tuner>` ioctl |
| 252 | * @vidioc_s_tuner: pointer to the function that implements |
| 253 | * :ref:`VIDIOC_S_TUNER <vidioc_g_tuner>` ioctl |
| 254 | * @vidioc_g_frequency: pointer to the function that implements |
| 255 | * :ref:`VIDIOC_G_FREQUENCY <vidioc_g_frequency>` ioctl |
| 256 | * @vidioc_s_frequency: pointer to the function that implements |
| 257 | * :ref:`VIDIOC_S_FREQUENCY <vidioc_g_frequency>` ioctl |
| 258 | * @vidioc_enum_freq_bands: pointer to the function that implements |
| 259 | * :ref:`VIDIOC_ENUM_FREQ_BANDS <vidioc_enum_freq_bands>` ioctl |
| 260 | * @vidioc_g_sliced_vbi_cap: pointer to the function that implements |
| 261 | * :ref:`VIDIOC_G_SLICED_VBI_CAP <vidioc_g_sliced_vbi_cap>` ioctl |
| 262 | * @vidioc_log_status: pointer to the function that implements |
| 263 | * :ref:`VIDIOC_LOG_STATUS <vidioc_log_status>` ioctl |
| 264 | * @vidioc_s_hw_freq_seek: pointer to the function that implements |
| 265 | * :ref:`VIDIOC_S_HW_FREQ_SEEK <vidioc_s_hw_freq_seek>` ioctl |
| 266 | * @vidioc_g_register: pointer to the function that implements |
| 267 | * :ref:`VIDIOC_DBG_G_REGISTER <vidioc_dbg_g_register>` ioctl |
| 268 | * @vidioc_s_register: pointer to the function that implements |
| 269 | * :ref:`VIDIOC_DBG_S_REGISTER <vidioc_dbg_g_register>` ioctl |
| 270 | * @vidioc_g_chip_info: pointer to the function that implements |
| 271 | * :ref:`VIDIOC_DBG_G_CHIP_INFO <vidioc_dbg_g_chip_info>` ioctl |
| 272 | * @vidioc_enum_framesizes: pointer to the function that implements |
| 273 | * :ref:`VIDIOC_ENUM_FRAMESIZES <vidioc_enum_framesizes>` ioctl |
| 274 | * @vidioc_enum_frameintervals: pointer to the function that implements |
| 275 | * :ref:`VIDIOC_ENUM_FRAMEINTERVALS <vidioc_enum_frameintervals>` ioctl |
| 276 | * @vidioc_s_dv_timings: pointer to the function that implements |
| 277 | * :ref:`VIDIOC_S_DV_TIMINGS <vidioc_g_dv_timings>` ioctl |
| 278 | * @vidioc_g_dv_timings: pointer to the function that implements |
| 279 | * :ref:`VIDIOC_G_DV_TIMINGS <vidioc_g_dv_timings>` ioctl |
| 280 | * @vidioc_query_dv_timings: pointer to the function that implements |
| 281 | * :ref:`VIDIOC_QUERY_DV_TIMINGS <vidioc_query_dv_timings>` ioctl |
| 282 | * @vidioc_enum_dv_timings: pointer to the function that implements |
| 283 | * :ref:`VIDIOC_ENUM_DV_TIMINGS <vidioc_enum_dv_timings>` ioctl |
| 284 | * @vidioc_dv_timings_cap: pointer to the function that implements |
| 285 | * :ref:`VIDIOC_DV_TIMINGS_CAP <vidioc_dv_timings_cap>` ioctl |
| 286 | * @vidioc_g_edid: pointer to the function that implements |
| 287 | * :ref:`VIDIOC_G_EDID <vidioc_g_edid>` ioctl |
| 288 | * @vidioc_s_edid: pointer to the function that implements |
| 289 | * :ref:`VIDIOC_S_EDID <vidioc_g_edid>` ioctl |
| 290 | * @vidioc_subscribe_event: pointer to the function that implements |
| 291 | * :ref:`VIDIOC_SUBSCRIBE_EVENT <vidioc_subscribe_event>` ioctl |
| 292 | * @vidioc_unsubscribe_event: pointer to the function that implements |
| 293 | * :ref:`VIDIOC_UNSUBSCRIBE_EVENT <vidioc_unsubscribe_event>` ioctl |
| 294 | * @vidioc_default: pointed used to allow other ioctls |
| 295 | */ |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 296 | struct v4l2_ioctl_ops { |
| 297 | /* ioctl callbacks */ |
| 298 | |
| 299 | /* VIDIOC_QUERYCAP handler */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 300 | int (*vidioc_querycap)(struct file *file, void *fh, |
| 301 | struct v4l2_capability *cap); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 302 | |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 303 | /* VIDIOC_ENUM_FMT handlers */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 304 | int (*vidioc_enum_fmt_vid_cap)(struct file *file, void *fh, |
| 305 | struct v4l2_fmtdesc *f); |
| 306 | int (*vidioc_enum_fmt_vid_overlay)(struct file *file, void *fh, |
| 307 | struct v4l2_fmtdesc *f); |
| 308 | int (*vidioc_enum_fmt_vid_out)(struct file *file, void *fh, |
| 309 | struct v4l2_fmtdesc *f); |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 310 | int (*vidioc_enum_fmt_sdr_cap)(struct file *file, void *fh, |
| 311 | struct v4l2_fmtdesc *f); |
| 312 | int (*vidioc_enum_fmt_sdr_out)(struct file *file, void *fh, |
| 313 | struct v4l2_fmtdesc *f); |
Laurent Pinchart | fb9ffa6 | 2016-04-12 19:40:46 -0300 | [diff] [blame] | 314 | int (*vidioc_enum_fmt_meta_cap)(struct file *file, void *fh, |
| 315 | struct v4l2_fmtdesc *f); |
Sakari Ailus | 72148d1 | 2017-06-16 08:38:31 -0400 | [diff] [blame] | 316 | int (*vidioc_enum_fmt_meta_out)(struct file *file, void *fh, |
| 317 | struct v4l2_fmtdesc *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 318 | |
| 319 | /* VIDIOC_G_FMT handlers */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 320 | int (*vidioc_g_fmt_vid_cap)(struct file *file, void *fh, |
| 321 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 322 | int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *fh, |
| 323 | struct v4l2_format *f); |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 324 | int (*vidioc_g_fmt_vid_out)(struct file *file, void *fh, |
| 325 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 326 | int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *fh, |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 327 | struct v4l2_format *f); |
| 328 | int (*vidioc_g_fmt_vbi_cap)(struct file *file, void *fh, |
| 329 | struct v4l2_format *f); |
| 330 | int (*vidioc_g_fmt_vbi_out)(struct file *file, void *fh, |
| 331 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 332 | int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *fh, |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 333 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 334 | int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *fh, |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 335 | struct v4l2_format *f); |
Pawel Osciak | d14e6d7 | 2010-12-23 04:15:27 -0300 | [diff] [blame] | 336 | int (*vidioc_g_fmt_vid_cap_mplane)(struct file *file, void *fh, |
| 337 | struct v4l2_format *f); |
| 338 | int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *fh, |
| 339 | struct v4l2_format *f); |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 340 | int (*vidioc_g_fmt_sdr_cap)(struct file *file, void *fh, |
| 341 | struct v4l2_format *f); |
| 342 | int (*vidioc_g_fmt_sdr_out)(struct file *file, void *fh, |
| 343 | struct v4l2_format *f); |
Laurent Pinchart | fb9ffa6 | 2016-04-12 19:40:46 -0300 | [diff] [blame] | 344 | int (*vidioc_g_fmt_meta_cap)(struct file *file, void *fh, |
| 345 | struct v4l2_format *f); |
Sakari Ailus | 72148d1 | 2017-06-16 08:38:31 -0400 | [diff] [blame] | 346 | int (*vidioc_g_fmt_meta_out)(struct file *file, void *fh, |
| 347 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 348 | |
| 349 | /* VIDIOC_S_FMT handlers */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 350 | int (*vidioc_s_fmt_vid_cap)(struct file *file, void *fh, |
| 351 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 352 | int (*vidioc_s_fmt_vid_overlay)(struct file *file, void *fh, |
| 353 | struct v4l2_format *f); |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 354 | int (*vidioc_s_fmt_vid_out)(struct file *file, void *fh, |
| 355 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 356 | int (*vidioc_s_fmt_vid_out_overlay)(struct file *file, void *fh, |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 357 | struct v4l2_format *f); |
| 358 | int (*vidioc_s_fmt_vbi_cap)(struct file *file, void *fh, |
| 359 | struct v4l2_format *f); |
| 360 | int (*vidioc_s_fmt_vbi_out)(struct file *file, void *fh, |
| 361 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 362 | int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *file, void *fh, |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 363 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 364 | int (*vidioc_s_fmt_sliced_vbi_out)(struct file *file, void *fh, |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 365 | struct v4l2_format *f); |
Pawel Osciak | d14e6d7 | 2010-12-23 04:15:27 -0300 | [diff] [blame] | 366 | int (*vidioc_s_fmt_vid_cap_mplane)(struct file *file, void *fh, |
| 367 | struct v4l2_format *f); |
| 368 | int (*vidioc_s_fmt_vid_out_mplane)(struct file *file, void *fh, |
| 369 | struct v4l2_format *f); |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 370 | int (*vidioc_s_fmt_sdr_cap)(struct file *file, void *fh, |
| 371 | struct v4l2_format *f); |
| 372 | int (*vidioc_s_fmt_sdr_out)(struct file *file, void *fh, |
| 373 | struct v4l2_format *f); |
Laurent Pinchart | fb9ffa6 | 2016-04-12 19:40:46 -0300 | [diff] [blame] | 374 | int (*vidioc_s_fmt_meta_cap)(struct file *file, void *fh, |
| 375 | struct v4l2_format *f); |
Sakari Ailus | 72148d1 | 2017-06-16 08:38:31 -0400 | [diff] [blame] | 376 | int (*vidioc_s_fmt_meta_out)(struct file *file, void *fh, |
| 377 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 378 | |
| 379 | /* VIDIOC_TRY_FMT handlers */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 380 | int (*vidioc_try_fmt_vid_cap)(struct file *file, void *fh, |
| 381 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 382 | int (*vidioc_try_fmt_vid_overlay)(struct file *file, void *fh, |
| 383 | struct v4l2_format *f); |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 384 | int (*vidioc_try_fmt_vid_out)(struct file *file, void *fh, |
| 385 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 386 | int (*vidioc_try_fmt_vid_out_overlay)(struct file *file, void *fh, |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 387 | struct v4l2_format *f); |
| 388 | int (*vidioc_try_fmt_vbi_cap)(struct file *file, void *fh, |
| 389 | struct v4l2_format *f); |
| 390 | int (*vidioc_try_fmt_vbi_out)(struct file *file, void *fh, |
| 391 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 392 | int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *file, void *fh, |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 393 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 394 | int (*vidioc_try_fmt_sliced_vbi_out)(struct file *file, void *fh, |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 395 | struct v4l2_format *f); |
Pawel Osciak | d14e6d7 | 2010-12-23 04:15:27 -0300 | [diff] [blame] | 396 | int (*vidioc_try_fmt_vid_cap_mplane)(struct file *file, void *fh, |
| 397 | struct v4l2_format *f); |
| 398 | int (*vidioc_try_fmt_vid_out_mplane)(struct file *file, void *fh, |
| 399 | struct v4l2_format *f); |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 400 | int (*vidioc_try_fmt_sdr_cap)(struct file *file, void *fh, |
| 401 | struct v4l2_format *f); |
| 402 | int (*vidioc_try_fmt_sdr_out)(struct file *file, void *fh, |
| 403 | struct v4l2_format *f); |
Laurent Pinchart | fb9ffa6 | 2016-04-12 19:40:46 -0300 | [diff] [blame] | 404 | int (*vidioc_try_fmt_meta_cap)(struct file *file, void *fh, |
| 405 | struct v4l2_format *f); |
Sakari Ailus | 72148d1 | 2017-06-16 08:38:31 -0400 | [diff] [blame] | 406 | int (*vidioc_try_fmt_meta_out)(struct file *file, void *fh, |
| 407 | struct v4l2_format *f); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 408 | |
| 409 | /* Buffer handlers */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 410 | int (*vidioc_reqbufs)(struct file *file, void *fh, |
| 411 | struct v4l2_requestbuffers *b); |
| 412 | int (*vidioc_querybuf)(struct file *file, void *fh, |
| 413 | struct v4l2_buffer *b); |
| 414 | int (*vidioc_qbuf)(struct file *file, void *fh, |
| 415 | struct v4l2_buffer *b); |
| 416 | int (*vidioc_expbuf)(struct file *file, void *fh, |
| 417 | struct v4l2_exportbuffer *e); |
| 418 | int (*vidioc_dqbuf)(struct file *file, void *fh, |
| 419 | struct v4l2_buffer *b); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 420 | |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 421 | int (*vidioc_create_bufs)(struct file *file, void *fh, |
| 422 | struct v4l2_create_buffers *b); |
| 423 | int (*vidioc_prepare_buf)(struct file *file, void *fh, |
| 424 | struct v4l2_buffer *b); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 425 | |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 426 | int (*vidioc_overlay)(struct file *file, void *fh, unsigned int i); |
| 427 | int (*vidioc_g_fbuf)(struct file *file, void *fh, |
| 428 | struct v4l2_framebuffer *a); |
| 429 | int (*vidioc_s_fbuf)(struct file *file, void *fh, |
| 430 | const struct v4l2_framebuffer *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 431 | |
| 432 | /* Stream on/off */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 433 | int (*vidioc_streamon)(struct file *file, void *fh, |
| 434 | enum v4l2_buf_type i); |
| 435 | int (*vidioc_streamoff)(struct file *file, void *fh, |
| 436 | enum v4l2_buf_type i); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 437 | |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 438 | /* |
| 439 | * Standard handling |
| 440 | * |
| 441 | * Note: ENUMSTD is handled by videodev.c |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 442 | */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 443 | int (*vidioc_g_std)(struct file *file, void *fh, v4l2_std_id *norm); |
| 444 | int (*vidioc_s_std)(struct file *file, void *fh, v4l2_std_id norm); |
| 445 | int (*vidioc_querystd)(struct file *file, void *fh, v4l2_std_id *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 446 | |
| 447 | /* Input handling */ |
| 448 | int (*vidioc_enum_input)(struct file *file, void *fh, |
| 449 | struct v4l2_input *inp); |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 450 | int (*vidioc_g_input)(struct file *file, void *fh, unsigned int *i); |
| 451 | int (*vidioc_s_input)(struct file *file, void *fh, unsigned int i); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 452 | |
| 453 | /* Output handling */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 454 | int (*vidioc_enum_output)(struct file *file, void *fh, |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 455 | struct v4l2_output *a); |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 456 | int (*vidioc_g_output)(struct file *file, void *fh, unsigned int *i); |
| 457 | int (*vidioc_s_output)(struct file *file, void *fh, unsigned int i); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 458 | |
| 459 | /* Control handling */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 460 | int (*vidioc_queryctrl)(struct file *file, void *fh, |
| 461 | struct v4l2_queryctrl *a); |
| 462 | int (*vidioc_query_ext_ctrl)(struct file *file, void *fh, |
| 463 | struct v4l2_query_ext_ctrl *a); |
| 464 | int (*vidioc_g_ctrl)(struct file *file, void *fh, |
| 465 | struct v4l2_control *a); |
| 466 | int (*vidioc_s_ctrl)(struct file *file, void *fh, |
| 467 | struct v4l2_control *a); |
| 468 | int (*vidioc_g_ext_ctrls)(struct file *file, void *fh, |
| 469 | struct v4l2_ext_controls *a); |
| 470 | int (*vidioc_s_ext_ctrls)(struct file *file, void *fh, |
| 471 | struct v4l2_ext_controls *a); |
| 472 | int (*vidioc_try_ext_ctrls)(struct file *file, void *fh, |
| 473 | struct v4l2_ext_controls *a); |
| 474 | int (*vidioc_querymenu)(struct file *file, void *fh, |
| 475 | struct v4l2_querymenu *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 476 | |
| 477 | /* Audio ioctls */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 478 | int (*vidioc_enumaudio)(struct file *file, void *fh, |
| 479 | struct v4l2_audio *a); |
| 480 | int (*vidioc_g_audio)(struct file *file, void *fh, |
| 481 | struct v4l2_audio *a); |
| 482 | int (*vidioc_s_audio)(struct file *file, void *fh, |
| 483 | const struct v4l2_audio *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 484 | |
| 485 | /* Audio out ioctls */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 486 | int (*vidioc_enumaudout)(struct file *file, void *fh, |
| 487 | struct v4l2_audioout *a); |
| 488 | int (*vidioc_g_audout)(struct file *file, void *fh, |
| 489 | struct v4l2_audioout *a); |
| 490 | int (*vidioc_s_audout)(struct file *file, void *fh, |
| 491 | const struct v4l2_audioout *a); |
| 492 | int (*vidioc_g_modulator)(struct file *file, void *fh, |
| 493 | struct v4l2_modulator *a); |
| 494 | int (*vidioc_s_modulator)(struct file *file, void *fh, |
| 495 | const struct v4l2_modulator *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 496 | /* Crop ioctls */ |
Hans Verkuil | 5200ab6 | 2018-10-04 17:38:15 -0400 | [diff] [blame] | 497 | int (*vidioc_g_pixelaspect)(struct file *file, void *fh, |
| 498 | int buf_type, struct v4l2_fract *aspect); |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 499 | int (*vidioc_g_selection)(struct file *file, void *fh, |
| 500 | struct v4l2_selection *s); |
| 501 | int (*vidioc_s_selection)(struct file *file, void *fh, |
| 502 | struct v4l2_selection *s); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 503 | /* Compression ioctls */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 504 | int (*vidioc_g_jpegcomp)(struct file *file, void *fh, |
| 505 | struct v4l2_jpegcompression *a); |
| 506 | int (*vidioc_s_jpegcomp)(struct file *file, void *fh, |
| 507 | const struct v4l2_jpegcompression *a); |
| 508 | int (*vidioc_g_enc_index)(struct file *file, void *fh, |
| 509 | struct v4l2_enc_idx *a); |
| 510 | int (*vidioc_encoder_cmd)(struct file *file, void *fh, |
| 511 | struct v4l2_encoder_cmd *a); |
| 512 | int (*vidioc_try_encoder_cmd)(struct file *file, void *fh, |
| 513 | struct v4l2_encoder_cmd *a); |
| 514 | int (*vidioc_decoder_cmd)(struct file *file, void *fh, |
| 515 | struct v4l2_decoder_cmd *a); |
| 516 | int (*vidioc_try_decoder_cmd)(struct file *file, void *fh, |
| 517 | struct v4l2_decoder_cmd *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 518 | |
| 519 | /* Stream type-dependent parameter ioctls */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 520 | int (*vidioc_g_parm)(struct file *file, void *fh, |
| 521 | struct v4l2_streamparm *a); |
| 522 | int (*vidioc_s_parm)(struct file *file, void *fh, |
| 523 | struct v4l2_streamparm *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 524 | |
| 525 | /* Tuner ioctls */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 526 | int (*vidioc_g_tuner)(struct file *file, void *fh, |
| 527 | struct v4l2_tuner *a); |
| 528 | int (*vidioc_s_tuner)(struct file *file, void *fh, |
| 529 | const struct v4l2_tuner *a); |
| 530 | int (*vidioc_g_frequency)(struct file *file, void *fh, |
| 531 | struct v4l2_frequency *a); |
| 532 | int (*vidioc_s_frequency)(struct file *file, void *fh, |
| 533 | const struct v4l2_frequency *a); |
| 534 | int (*vidioc_enum_freq_bands)(struct file *file, void *fh, |
| 535 | struct v4l2_frequency_band *band); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 536 | |
| 537 | /* Sliced VBI cap */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 538 | int (*vidioc_g_sliced_vbi_cap)(struct file *file, void *fh, |
| 539 | struct v4l2_sliced_vbi_cap *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 540 | |
| 541 | /* Log status ioctl */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 542 | int (*vidioc_log_status)(struct file *file, void *fh); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 543 | |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 544 | int (*vidioc_s_hw_freq_seek)(struct file *file, void *fh, |
| 545 | const struct v4l2_hw_freq_seek *a); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 546 | |
| 547 | /* Debugging ioctls */ |
| 548 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 549 | int (*vidioc_g_register)(struct file *file, void *fh, |
| 550 | struct v4l2_dbg_register *reg); |
| 551 | int (*vidioc_s_register)(struct file *file, void *fh, |
| 552 | const struct v4l2_dbg_register *reg); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 553 | |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 554 | int (*vidioc_g_chip_info)(struct file *file, void *fh, |
| 555 | struct v4l2_dbg_chip_info *chip); |
Hans Verkuil | cd634f1 | 2013-03-27 08:04:23 -0300 | [diff] [blame] | 556 | #endif |
Hans Verkuil | 79b0c64 | 2013-03-18 12:16:34 -0300 | [diff] [blame] | 557 | |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 558 | int (*vidioc_enum_framesizes)(struct file *file, void *fh, |
| 559 | struct v4l2_frmsizeenum *fsize); |
Mauro Carvalho Chehab | 74d83fa | 2008-11-11 21:13:47 -0300 | [diff] [blame] | 560 | |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 561 | int (*vidioc_enum_frameintervals)(struct file *file, void *fh, |
| 562 | struct v4l2_frmivalenum *fival); |
Mauro Carvalho Chehab | 74d83fa | 2008-11-11 21:13:47 -0300 | [diff] [blame] | 563 | |
Muralidharan Karicheri | b6456c0 | 2009-11-19 12:00:31 -0300 | [diff] [blame] | 564 | /* DV Timings IOCTLs */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 565 | int (*vidioc_s_dv_timings)(struct file *file, void *fh, |
| 566 | struct v4l2_dv_timings *timings); |
| 567 | int (*vidioc_g_dv_timings)(struct file *file, void *fh, |
| 568 | struct v4l2_dv_timings *timings); |
| 569 | int (*vidioc_query_dv_timings)(struct file *file, void *fh, |
| 570 | struct v4l2_dv_timings *timings); |
| 571 | int (*vidioc_enum_dv_timings)(struct file *file, void *fh, |
| 572 | struct v4l2_enum_dv_timings *timings); |
| 573 | int (*vidioc_dv_timings_cap)(struct file *file, void *fh, |
| 574 | struct v4l2_dv_timings_cap *cap); |
| 575 | int (*vidioc_g_edid)(struct file *file, void *fh, |
| 576 | struct v4l2_edid *edid); |
| 577 | int (*vidioc_s_edid)(struct file *file, void *fh, |
| 578 | struct v4l2_edid *edid); |
Muralidharan Karicheri | b6456c0 | 2009-11-19 12:00:31 -0300 | [diff] [blame] | 579 | |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 580 | int (*vidioc_subscribe_event)(struct v4l2_fh *fh, |
| 581 | const struct v4l2_event_subscription *sub); |
Sakari Ailus | d3d7c96 | 2010-03-27 11:02:10 -0300 | [diff] [blame] | 582 | int (*vidioc_unsubscribe_event)(struct v4l2_fh *fh, |
Hans Verkuil | 85f5fe3 | 2012-09-04 11:46:09 -0300 | [diff] [blame] | 583 | const struct v4l2_event_subscription *sub); |
Sakari Ailus | d3d7c96 | 2010-03-27 11:02:10 -0300 | [diff] [blame] | 584 | |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 585 | /* For other private ioctls */ |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 586 | long (*vidioc_default)(struct file *file, void *fh, |
| 587 | bool valid_prio, unsigned int cmd, void *arg); |
Hans Verkuil | a399810 | 2008-07-21 02:57:38 -0300 | [diff] [blame] | 588 | }; |
| 589 | |
| 590 | |
Mauro Carvalho Chehab | 2864462 | 2008-07-20 20:26:54 -0300 | [diff] [blame] | 591 | /* v4l debugging and diagnostics */ |
| 592 | |
Hans Verkuil | 17028cd | 2014-12-01 10:10:44 -0300 | [diff] [blame] | 593 | /* Device debug flags to be used with the video device debug attribute */ |
| 594 | |
| 595 | /* Just log the ioctl name + error code */ |
| 596 | #define V4L2_DEV_DEBUG_IOCTL 0x01 |
| 597 | /* Log the ioctl name arguments + error code */ |
| 598 | #define V4L2_DEV_DEBUG_IOCTL_ARG 0x02 |
| 599 | /* Log the file operations open, release, mmap and get_unmapped_area */ |
| 600 | #define V4L2_DEV_DEBUG_FOP 0x04 |
| 601 | /* Log the read and write file operations and the VIDIOC_(D)QBUF ioctls */ |
| 602 | #define V4L2_DEV_DEBUG_STREAMING 0x08 |
| 603 | /* Log poll() */ |
| 604 | #define V4L2_DEV_DEBUG_POLL 0x10 |
Ezequiel Garcia | 173f6ea | 2019-07-20 07:47:07 -0400 | [diff] [blame] | 605 | /* Log controls */ |
| 606 | #define V4L2_DEV_DEBUG_CTRL 0x20 |
Mauro Carvalho Chehab | 2864462 | 2008-07-20 20:26:54 -0300 | [diff] [blame] | 607 | |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 608 | /* Video standard functions */ |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 609 | |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 610 | /** |
| 611 | * v4l2_norm_to_name - Ancillary routine to analog TV standard name from its ID. |
| 612 | * |
| 613 | * @id: analog TV standard ID. |
| 614 | * |
| 615 | * Return: returns a string with the name of the analog TV standard. |
| 616 | * If the standard is not found or if @id points to multiple standard, |
| 617 | * it returns "Unknown". |
| 618 | */ |
| 619 | const char *v4l2_norm_to_name(v4l2_std_id id); |
| 620 | |
| 621 | /** |
| 622 | * v4l2_video_std_frame_period - Ancillary routine that fills a |
| 623 | * struct &v4l2_fract pointer with the default framerate fraction. |
| 624 | * |
Niklas Söderlund | aa2f887 | 2018-05-17 10:30:15 -0400 | [diff] [blame] | 625 | * @id: analog TV standard ID. |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 626 | * @frameperiod: struct &v4l2_fract pointer to be filled |
| 627 | * |
| 628 | */ |
| 629 | void v4l2_video_std_frame_period(int id, struct v4l2_fract *frameperiod); |
| 630 | |
| 631 | /** |
| 632 | * v4l2_video_std_construct - Ancillary routine that fills in the fields of |
| 633 | * a &v4l2_standard structure according to the @id parameter. |
| 634 | * |
| 635 | * @vs: struct &v4l2_standard pointer to be filled |
Niklas Söderlund | aa2f887 | 2018-05-17 10:30:15 -0400 | [diff] [blame] | 636 | * @id: analog TV standard ID. |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 637 | * @name: name of the standard to be used |
| 638 | * |
| 639 | * .. note:: |
| 640 | * |
| 641 | * This ancillary routine is obsolete. Shouldn't be used on newer drivers. |
| 642 | */ |
| 643 | int v4l2_video_std_construct(struct v4l2_standard *vs, |
| 644 | int id, const char *name); |
| 645 | |
| 646 | /** |
Niklas Söderlund | aa2f887 | 2018-05-17 10:30:15 -0400 | [diff] [blame] | 647 | * v4l_video_std_enumstd - Ancillary routine that fills in the fields of |
| 648 | * a &v4l2_standard structure according to the @id and @vs->index |
| 649 | * parameters. |
| 650 | * |
| 651 | * @vs: struct &v4l2_standard pointer to be filled. |
| 652 | * @id: analog TV standard ID. |
| 653 | * |
| 654 | */ |
| 655 | int v4l_video_std_enumstd(struct v4l2_standard *vs, v4l2_std_id id); |
| 656 | |
| 657 | /** |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 658 | * v4l_printk_ioctl - Ancillary routine that prints the ioctl in a |
| 659 | * human-readable format. |
| 660 | * |
| 661 | * @prefix: prefix to be added at the ioctl prints. |
| 662 | * @cmd: ioctl name |
| 663 | * |
| 664 | * .. note:: |
| 665 | * |
| 666 | * If prefix != %NULL, then it will issue a |
| 667 | * ``printk(KERN_DEBUG "%s: ", prefix)`` first. |
| 668 | */ |
| 669 | void v4l_printk_ioctl(const char *prefix, unsigned int cmd); |
| 670 | |
Hans Verkuil | 5a5adf6 | 2012-06-22 07:29:35 -0300 | [diff] [blame] | 671 | struct video_device; |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 672 | |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 673 | /* names for fancy debug output */ |
| 674 | extern const char *v4l2_field_names[]; |
| 675 | extern const char *v4l2_type_names[]; |
| 676 | |
Hans Verkuil | bec4366 | 2008-12-30 06:58:20 -0300 | [diff] [blame] | 677 | #ifdef CONFIG_COMPAT |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 678 | /** |
| 679 | * v4l2_compat_ioctl32 -32 Bits compatibility layer for 64 bits processors |
| 680 | * |
| 681 | * @file: Pointer to struct &file. |
| 682 | * @cmd: Ioctl name. |
| 683 | * @arg: Ioctl argument. |
| 684 | */ |
| 685 | long int v4l2_compat_ioctl32(struct file *file, unsigned int cmd, |
| 686 | unsigned long arg); |
Hans Verkuil | bec4366 | 2008-12-30 06:58:20 -0300 | [diff] [blame] | 687 | #endif |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 688 | |
Arnd Bergmann | 8dbcc3fa | 2020-10-30 17:55:22 +0100 | [diff] [blame] | 689 | unsigned int v4l2_compat_translate_cmd(unsigned int cmd); |
| 690 | int v4l2_compat_get_user(void __user *arg, void *parg, unsigned int cmd); |
| 691 | int v4l2_compat_put_user(void __user *arg, void *parg, unsigned int cmd); |
| 692 | int v4l2_compat_get_array_args(struct file *file, void *mbuf, |
| 693 | void __user *user_ptr, size_t array_size, |
| 694 | unsigned int cmd, void *arg); |
| 695 | int v4l2_compat_put_array_args(struct file *file, void __user *user_ptr, |
| 696 | void *mbuf, size_t array_size, |
| 697 | unsigned int cmd, void *arg); |
| 698 | |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 699 | /** |
| 700 | * typedef v4l2_kioctl - Typedef used to pass an ioctl handler. |
| 701 | * |
| 702 | * @file: Pointer to struct &file. |
| 703 | * @cmd: Ioctl name. |
| 704 | * @arg: Ioctl argument. |
| 705 | */ |
| 706 | typedef long (*v4l2_kioctl)(struct file *file, unsigned int cmd, void *arg); |
Hans Verkuil | 08af245 | 2010-12-24 10:33:19 -0300 | [diff] [blame] | 707 | |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 708 | /** |
| 709 | * video_usercopy - copies data from/to userspace memory when an ioctl is |
| 710 | * issued. |
| 711 | * |
| 712 | * @file: Pointer to struct &file. |
| 713 | * @cmd: Ioctl name. |
| 714 | * @arg: Ioctl argument. |
| 715 | * @func: function that will handle the ioctl |
| 716 | * |
| 717 | * .. note:: |
| 718 | * |
| 719 | * This routine should be used only inside the V4L2 core. |
| 720 | */ |
| 721 | long int video_usercopy(struct file *file, unsigned int cmd, |
| 722 | unsigned long int arg, v4l2_kioctl func); |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 723 | |
Mauro Carvalho Chehab | bba65c1 | 2016-08-30 12:18:09 -0300 | [diff] [blame] | 724 | /** |
| 725 | * video_ioctl2 - Handles a V4L2 ioctl. |
| 726 | * |
| 727 | * @file: Pointer to struct &file. |
| 728 | * @cmd: Ioctl name. |
| 729 | * @arg: Ioctl argument. |
| 730 | * |
| 731 | * Method used to hancle an ioctl. Should be used to fill the |
| 732 | * &v4l2_ioctl_ops.unlocked_ioctl on all V4L2 drivers. |
| 733 | */ |
| 734 | long int video_ioctl2(struct file *file, |
| 735 | unsigned int cmd, unsigned long int arg); |
Mauro Carvalho Chehab | 8a522c9 | 2008-10-21 11:58:39 -0300 | [diff] [blame] | 736 | |
Arnd Bergmann | 1a6c0b3 | 2019-12-16 15:15:03 +0100 | [diff] [blame] | 737 | /* |
| 738 | * The user space interpretation of the 'v4l2_event' differs |
| 739 | * based on the 'time_t' definition on 32-bit architectures, so |
| 740 | * the kernel has to handle both. |
| 741 | * This is the old version for 32-bit architectures. |
| 742 | */ |
| 743 | struct v4l2_event_time32 { |
| 744 | __u32 type; |
| 745 | union { |
| 746 | struct v4l2_event_vsync vsync; |
| 747 | struct v4l2_event_ctrl ctrl; |
| 748 | struct v4l2_event_frame_sync frame_sync; |
| 749 | struct v4l2_event_src_change src_change; |
| 750 | struct v4l2_event_motion_det motion_det; |
| 751 | __u8 data[64]; |
| 752 | } u; |
| 753 | __u32 pending; |
| 754 | __u32 sequence; |
| 755 | struct old_timespec32 timestamp; |
| 756 | __u32 id; |
| 757 | __u32 reserved[8]; |
| 758 | }; |
| 759 | |
| 760 | #define VIDIOC_DQEVENT_TIME32 _IOR('V', 89, struct v4l2_event_time32) |
| 761 | |
Arnd Bergmann | 577c89b | 2019-12-16 15:15:04 +0100 | [diff] [blame] | 762 | struct v4l2_buffer_time32 { |
| 763 | __u32 index; |
| 764 | __u32 type; |
| 765 | __u32 bytesused; |
| 766 | __u32 flags; |
| 767 | __u32 field; |
| 768 | struct old_timeval32 timestamp; |
| 769 | struct v4l2_timecode timecode; |
| 770 | __u32 sequence; |
| 771 | |
| 772 | /* memory location */ |
| 773 | __u32 memory; |
| 774 | union { |
| 775 | __u32 offset; |
| 776 | unsigned long userptr; |
| 777 | struct v4l2_plane *planes; |
| 778 | __s32 fd; |
| 779 | } m; |
| 780 | __u32 length; |
| 781 | __u32 reserved2; |
| 782 | union { |
| 783 | __s32 request_fd; |
| 784 | __u32 reserved; |
| 785 | }; |
| 786 | }; |
| 787 | #define VIDIOC_QUERYBUF_TIME32 _IOWR('V', 9, struct v4l2_buffer_time32) |
| 788 | #define VIDIOC_QBUF_TIME32 _IOWR('V', 15, struct v4l2_buffer_time32) |
| 789 | #define VIDIOC_DQBUF_TIME32 _IOWR('V', 17, struct v4l2_buffer_time32) |
| 790 | #define VIDIOC_PREPARE_BUF_TIME32 _IOWR('V', 93, struct v4l2_buffer_time32) |
| 791 | |
Hans Verkuil | 35ea11f | 2008-07-20 08:12:02 -0300 | [diff] [blame] | 792 | #endif /* _V4L2_IOCTL_H */ |