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