/* SPDX-License-Identifier: GPL-2.0 */1/*2*3* V 4 L 2 D R I V E R H E L P E R A P I4*5* Moved from videodev2.h6*7* Some commonly needed functions for drivers (v4l2-common.o module)8*/9#ifndef _V4L2_IOCTL_H10#define _V4L2_IOCTL_H1112#include <linux/poll.h>13#include <linux/fs.h>14#include <linux/mutex.h>15#include <linux/sched/signal.h>16#include <linux/compiler.h> /* need __user */17#include <linux/videodev2.h>1819struct v4l2_fh;2021/**22* struct v4l2_ioctl_ops - describe operations for each V4L2 ioctl23*24* @vidioc_querycap: pointer to the function that implements25* :ref:`VIDIOC_QUERYCAP <vidioc_querycap>` ioctl26* @vidioc_enum_fmt_vid_cap: pointer to the function that implements27* :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic28* for video capture in single and multi plane mode29* @vidioc_enum_fmt_vid_overlay: pointer to the function that implements30* :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic31* for video overlay32* @vidioc_enum_fmt_vid_out: pointer to the function that implements33* :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic34* for video output in single and multi plane mode35* @vidioc_enum_fmt_sdr_cap: pointer to the function that implements36* :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic37* for Software Defined Radio capture38* @vidioc_enum_fmt_sdr_out: pointer to the function that implements39* :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic40* for Software Defined Radio output41* @vidioc_enum_fmt_meta_cap: pointer to the function that implements42* :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic43* for metadata capture44* @vidioc_enum_fmt_meta_out: pointer to the function that implements45* :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic46* for metadata output47* @vidioc_g_fmt_vid_cap: pointer to the function that implements48* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video capture49* in single plane mode50* @vidioc_g_fmt_vid_overlay: pointer to the function that implements51* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video overlay52* @vidioc_g_fmt_vid_out: pointer to the function that implements53* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video out54* in single plane mode55* @vidioc_g_fmt_vid_out_overlay: pointer to the function that implements56* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video overlay output57* @vidioc_g_fmt_vbi_cap: pointer to the function that implements58* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture59* @vidioc_g_fmt_vbi_out: pointer to the function that implements60* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output61* @vidioc_g_fmt_sliced_vbi_cap: pointer to the function that implements62* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI capture63* @vidioc_g_fmt_sliced_vbi_out: pointer to the function that implements64* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output65* @vidioc_g_fmt_vid_cap_mplane: pointer to the function that implements66* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video capture67* in multiple plane mode68* @vidioc_g_fmt_vid_out_mplane: pointer to the function that implements69* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video out70* in multiplane plane mode71* @vidioc_g_fmt_sdr_cap: pointer to the function that implements72* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for Software Defined73* Radio capture74* @vidioc_g_fmt_sdr_out: pointer to the function that implements75* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for Software Defined76* Radio output77* @vidioc_g_fmt_meta_cap: pointer to the function that implements78* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for metadata capture79* @vidioc_g_fmt_meta_out: pointer to the function that implements80* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for metadata output81* @vidioc_s_fmt_vid_cap: pointer to the function that implements82* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video capture83* in single plane mode84* @vidioc_s_fmt_vid_overlay: pointer to the function that implements85* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video overlay86* @vidioc_s_fmt_vid_out: pointer to the function that implements87* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video out88* in single plane mode89* @vidioc_s_fmt_vid_out_overlay: pointer to the function that implements90* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video overlay output91* @vidioc_s_fmt_vbi_cap: pointer to the function that implements92* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture93* @vidioc_s_fmt_vbi_out: pointer to the function that implements94* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output95* @vidioc_s_fmt_sliced_vbi_cap: pointer to the function that implements96* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI capture97* @vidioc_s_fmt_sliced_vbi_out: pointer to the function that implements98* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output99* @vidioc_s_fmt_vid_cap_mplane: pointer to the function that implements100* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video capture101* in multiple plane mode102* @vidioc_s_fmt_vid_out_mplane: pointer to the function that implements103* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video out104* in multiplane plane mode105* @vidioc_s_fmt_sdr_cap: pointer to the function that implements106* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for Software Defined107* Radio capture108* @vidioc_s_fmt_sdr_out: pointer to the function that implements109* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for Software Defined110* Radio output111* @vidioc_s_fmt_meta_cap: pointer to the function that implements112* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for metadata capture113* @vidioc_s_fmt_meta_out: pointer to the function that implements114* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for metadata output115* @vidioc_try_fmt_vid_cap: pointer to the function that implements116* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video capture117* in single plane mode118* @vidioc_try_fmt_vid_overlay: pointer to the function that implements119* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video overlay120* @vidioc_try_fmt_vid_out: pointer to the function that implements121* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video out122* in single plane mode123* @vidioc_try_fmt_vid_out_overlay: pointer to the function that implements124* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video overlay125* output126* @vidioc_try_fmt_vbi_cap: pointer to the function that implements127* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture128* @vidioc_try_fmt_vbi_out: pointer to the function that implements129* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output130* @vidioc_try_fmt_sliced_vbi_cap: pointer to the function that implements131* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI132* capture133* @vidioc_try_fmt_sliced_vbi_out: pointer to the function that implements134* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output135* @vidioc_try_fmt_vid_cap_mplane: pointer to the function that implements136* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video capture137* in multiple plane mode138* @vidioc_try_fmt_vid_out_mplane: pointer to the function that implements139* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video out140* in multiplane plane mode141* @vidioc_try_fmt_sdr_cap: pointer to the function that implements142* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for Software Defined143* Radio capture144* @vidioc_try_fmt_sdr_out: pointer to the function that implements145* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for Software Defined146* Radio output147* @vidioc_try_fmt_meta_cap: pointer to the function that implements148* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for metadata capture149* @vidioc_try_fmt_meta_out: pointer to the function that implements150* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for metadata output151* @vidioc_reqbufs: pointer to the function that implements152* :ref:`VIDIOC_REQBUFS <vidioc_reqbufs>` ioctl153* @vidioc_querybuf: pointer to the function that implements154* :ref:`VIDIOC_QUERYBUF <vidioc_querybuf>` ioctl155* @vidioc_qbuf: pointer to the function that implements156* :ref:`VIDIOC_QBUF <vidioc_qbuf>` ioctl157* @vidioc_expbuf: pointer to the function that implements158* :ref:`VIDIOC_EXPBUF <vidioc_expbuf>` ioctl159* @vidioc_dqbuf: pointer to the function that implements160* :ref:`VIDIOC_DQBUF <vidioc_qbuf>` ioctl161* @vidioc_create_bufs: pointer to the function that implements162* :ref:`VIDIOC_CREATE_BUFS <vidioc_create_bufs>` ioctl163* @vidioc_prepare_buf: pointer to the function that implements164* :ref:`VIDIOC_PREPARE_BUF <vidioc_prepare_buf>` ioctl165* @vidioc_remove_bufs: pointer to the function that implements166* :ref:`VIDIOC_REMOVE_BUFS <vidioc_remove_bufs>` ioctl167* @vidioc_overlay: pointer to the function that implements168* :ref:`VIDIOC_OVERLAY <vidioc_overlay>` ioctl169* @vidioc_g_fbuf: pointer to the function that implements170* :ref:`VIDIOC_G_FBUF <vidioc_g_fbuf>` ioctl171* @vidioc_s_fbuf: pointer to the function that implements172* :ref:`VIDIOC_S_FBUF <vidioc_g_fbuf>` ioctl173* @vidioc_streamon: pointer to the function that implements174* :ref:`VIDIOC_STREAMON <vidioc_streamon>` ioctl175* @vidioc_streamoff: pointer to the function that implements176* :ref:`VIDIOC_STREAMOFF <vidioc_streamon>` ioctl177* @vidioc_g_std: pointer to the function that implements178* :ref:`VIDIOC_G_STD <vidioc_g_std>` ioctl179* @vidioc_s_std: pointer to the function that implements180* :ref:`VIDIOC_S_STD <vidioc_g_std>` ioctl181* @vidioc_querystd: pointer to the function that implements182* :ref:`VIDIOC_QUERYSTD <vidioc_querystd>` ioctl183* @vidioc_enum_input: pointer to the function that implements184* :ref:`VIDIOC_ENUM_INPUT <vidioc_g_input>` ioctl185* @vidioc_g_input: pointer to the function that implements186* :ref:`VIDIOC_G_INPUT <vidioc_g_input>` ioctl187* @vidioc_s_input: pointer to the function that implements188* :ref:`VIDIOC_S_INPUT <vidioc_g_input>` ioctl189* @vidioc_enum_output: pointer to the function that implements190* :ref:`VIDIOC_ENUM_OUTPUT <vidioc_g_output>` ioctl191* @vidioc_g_output: pointer to the function that implements192* :ref:`VIDIOC_G_OUTPUT <vidioc_g_output>` ioctl193* @vidioc_s_output: pointer to the function that implements194* :ref:`VIDIOC_S_OUTPUT <vidioc_g_output>` ioctl195* @vidioc_query_ext_ctrl: pointer to the function that implements196* :ref:`VIDIOC_QUERY_EXT_CTRL <vidioc_queryctrl>` ioctl197* @vidioc_g_ext_ctrls: pointer to the function that implements198* :ref:`VIDIOC_G_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl199* @vidioc_s_ext_ctrls: pointer to the function that implements200* :ref:`VIDIOC_S_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl201* @vidioc_try_ext_ctrls: pointer to the function that implements202* :ref:`VIDIOC_TRY_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl203* @vidioc_querymenu: pointer to the function that implements204* :ref:`VIDIOC_QUERYMENU <vidioc_queryctrl>` ioctl205* @vidioc_enumaudio: pointer to the function that implements206* :ref:`VIDIOC_ENUMAUDIO <vidioc_enumaudio>` ioctl207* @vidioc_g_audio: pointer to the function that implements208* :ref:`VIDIOC_G_AUDIO <vidioc_g_audio>` ioctl209* @vidioc_s_audio: pointer to the function that implements210* :ref:`VIDIOC_S_AUDIO <vidioc_g_audio>` ioctl211* @vidioc_enumaudout: pointer to the function that implements212* :ref:`VIDIOC_ENUMAUDOUT <vidioc_enumaudout>` ioctl213* @vidioc_g_audout: pointer to the function that implements214* :ref:`VIDIOC_G_AUDOUT <vidioc_g_audout>` ioctl215* @vidioc_s_audout: pointer to the function that implements216* :ref:`VIDIOC_S_AUDOUT <vidioc_g_audout>` ioctl217* @vidioc_g_modulator: pointer to the function that implements218* :ref:`VIDIOC_G_MODULATOR <vidioc_g_modulator>` ioctl219* @vidioc_s_modulator: pointer to the function that implements220* :ref:`VIDIOC_S_MODULATOR <vidioc_g_modulator>` ioctl221* @vidioc_g_pixelaspect: pointer to the function that implements222* the pixelaspect part of the :ref:`VIDIOC_CROPCAP <vidioc_cropcap>` ioctl223* @vidioc_g_selection: pointer to the function that implements224* :ref:`VIDIOC_G_SELECTION <vidioc_g_selection>` ioctl225* @vidioc_s_selection: pointer to the function that implements226* :ref:`VIDIOC_S_SELECTION <vidioc_g_selection>` ioctl227* @vidioc_g_jpegcomp: pointer to the function that implements228* :ref:`VIDIOC_G_JPEGCOMP <vidioc_g_jpegcomp>` ioctl229* @vidioc_s_jpegcomp: pointer to the function that implements230* :ref:`VIDIOC_S_JPEGCOMP <vidioc_g_jpegcomp>` ioctl231* @vidioc_g_enc_index: pointer to the function that implements232* :ref:`VIDIOC_G_ENC_INDEX <vidioc_g_enc_index>` ioctl233* @vidioc_encoder_cmd: pointer to the function that implements234* :ref:`VIDIOC_ENCODER_CMD <vidioc_encoder_cmd>` ioctl235* @vidioc_try_encoder_cmd: pointer to the function that implements236* :ref:`VIDIOC_TRY_ENCODER_CMD <vidioc_encoder_cmd>` ioctl237* @vidioc_decoder_cmd: pointer to the function that implements238* :ref:`VIDIOC_DECODER_CMD <vidioc_decoder_cmd>` ioctl239* @vidioc_try_decoder_cmd: pointer to the function that implements240* :ref:`VIDIOC_TRY_DECODER_CMD <vidioc_decoder_cmd>` ioctl241* @vidioc_g_parm: pointer to the function that implements242* :ref:`VIDIOC_G_PARM <vidioc_g_parm>` ioctl243* @vidioc_s_parm: pointer to the function that implements244* :ref:`VIDIOC_S_PARM <vidioc_g_parm>` ioctl245* @vidioc_g_tuner: pointer to the function that implements246* :ref:`VIDIOC_G_TUNER <vidioc_g_tuner>` ioctl247* @vidioc_s_tuner: pointer to the function that implements248* :ref:`VIDIOC_S_TUNER <vidioc_g_tuner>` ioctl249* @vidioc_g_frequency: pointer to the function that implements250* :ref:`VIDIOC_G_FREQUENCY <vidioc_g_frequency>` ioctl251* @vidioc_s_frequency: pointer to the function that implements252* :ref:`VIDIOC_S_FREQUENCY <vidioc_g_frequency>` ioctl253* @vidioc_enum_freq_bands: pointer to the function that implements254* :ref:`VIDIOC_ENUM_FREQ_BANDS <vidioc_enum_freq_bands>` ioctl255* @vidioc_g_sliced_vbi_cap: pointer to the function that implements256* :ref:`VIDIOC_G_SLICED_VBI_CAP <vidioc_g_sliced_vbi_cap>` ioctl257* @vidioc_log_status: pointer to the function that implements258* :ref:`VIDIOC_LOG_STATUS <vidioc_log_status>` ioctl259* @vidioc_s_hw_freq_seek: pointer to the function that implements260* :ref:`VIDIOC_S_HW_FREQ_SEEK <vidioc_s_hw_freq_seek>` ioctl261* @vidioc_g_register: pointer to the function that implements262* :ref:`VIDIOC_DBG_G_REGISTER <vidioc_dbg_g_register>` ioctl263* @vidioc_s_register: pointer to the function that implements264* :ref:`VIDIOC_DBG_S_REGISTER <vidioc_dbg_g_register>` ioctl265* @vidioc_g_chip_info: pointer to the function that implements266* :ref:`VIDIOC_DBG_G_CHIP_INFO <vidioc_dbg_g_chip_info>` ioctl267* @vidioc_enum_framesizes: pointer to the function that implements268* :ref:`VIDIOC_ENUM_FRAMESIZES <vidioc_enum_framesizes>` ioctl269* @vidioc_enum_frameintervals: pointer to the function that implements270* :ref:`VIDIOC_ENUM_FRAMEINTERVALS <vidioc_enum_frameintervals>` ioctl271* @vidioc_s_dv_timings: pointer to the function that implements272* :ref:`VIDIOC_S_DV_TIMINGS <vidioc_g_dv_timings>` ioctl273* @vidioc_g_dv_timings: pointer to the function that implements274* :ref:`VIDIOC_G_DV_TIMINGS <vidioc_g_dv_timings>` ioctl275* @vidioc_query_dv_timings: pointer to the function that implements276* :ref:`VIDIOC_QUERY_DV_TIMINGS <vidioc_query_dv_timings>` ioctl277* @vidioc_enum_dv_timings: pointer to the function that implements278* :ref:`VIDIOC_ENUM_DV_TIMINGS <vidioc_enum_dv_timings>` ioctl279* @vidioc_dv_timings_cap: pointer to the function that implements280* :ref:`VIDIOC_DV_TIMINGS_CAP <vidioc_dv_timings_cap>` ioctl281* @vidioc_g_edid: pointer to the function that implements282* :ref:`VIDIOC_G_EDID <vidioc_g_edid>` ioctl283* @vidioc_s_edid: pointer to the function that implements284* :ref:`VIDIOC_S_EDID <vidioc_g_edid>` ioctl285* @vidioc_subscribe_event: pointer to the function that implements286* :ref:`VIDIOC_SUBSCRIBE_EVENT <vidioc_subscribe_event>` ioctl287* @vidioc_unsubscribe_event: pointer to the function that implements288* :ref:`VIDIOC_UNSUBSCRIBE_EVENT <vidioc_unsubscribe_event>` ioctl289* @vidioc_default: pointed used to allow other ioctls290*/291struct v4l2_ioctl_ops {292/* ioctl callbacks */293294/* VIDIOC_QUERYCAP handler */295int (*vidioc_querycap)(struct file *file, void *fh,296struct v4l2_capability *cap);297298/* VIDIOC_ENUM_FMT handlers */299int (*vidioc_enum_fmt_vid_cap)(struct file *file, void *fh,300struct v4l2_fmtdesc *f);301int (*vidioc_enum_fmt_vid_overlay)(struct file *file, void *fh,302struct v4l2_fmtdesc *f);303int (*vidioc_enum_fmt_vid_out)(struct file *file, void *fh,304struct v4l2_fmtdesc *f);305int (*vidioc_enum_fmt_sdr_cap)(struct file *file, void *fh,306struct v4l2_fmtdesc *f);307int (*vidioc_enum_fmt_sdr_out)(struct file *file, void *fh,308struct v4l2_fmtdesc *f);309int (*vidioc_enum_fmt_meta_cap)(struct file *file, void *fh,310struct v4l2_fmtdesc *f);311int (*vidioc_enum_fmt_meta_out)(struct file *file, void *fh,312struct v4l2_fmtdesc *f);313314/* VIDIOC_G_FMT handlers */315int (*vidioc_g_fmt_vid_cap)(struct file *file, void *fh,316struct v4l2_format *f);317int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *fh,318struct v4l2_format *f);319int (*vidioc_g_fmt_vid_out)(struct file *file, void *fh,320struct v4l2_format *f);321int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *fh,322struct v4l2_format *f);323int (*vidioc_g_fmt_vbi_cap)(struct file *file, void *fh,324struct v4l2_format *f);325int (*vidioc_g_fmt_vbi_out)(struct file *file, void *fh,326struct v4l2_format *f);327int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *fh,328struct v4l2_format *f);329int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *fh,330struct v4l2_format *f);331int (*vidioc_g_fmt_vid_cap_mplane)(struct file *file, void *fh,332struct v4l2_format *f);333int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *fh,334struct v4l2_format *f);335int (*vidioc_g_fmt_sdr_cap)(struct file *file, void *fh,336struct v4l2_format *f);337int (*vidioc_g_fmt_sdr_out)(struct file *file, void *fh,338struct v4l2_format *f);339int (*vidioc_g_fmt_meta_cap)(struct file *file, void *fh,340struct v4l2_format *f);341int (*vidioc_g_fmt_meta_out)(struct file *file, void *fh,342struct v4l2_format *f);343344/* VIDIOC_S_FMT handlers */345int (*vidioc_s_fmt_vid_cap)(struct file *file, void *fh,346struct v4l2_format *f);347int (*vidioc_s_fmt_vid_overlay)(struct file *file, void *fh,348struct v4l2_format *f);349int (*vidioc_s_fmt_vid_out)(struct file *file, void *fh,350struct v4l2_format *f);351int (*vidioc_s_fmt_vid_out_overlay)(struct file *file, void *fh,352struct v4l2_format *f);353int (*vidioc_s_fmt_vbi_cap)(struct file *file, void *fh,354struct v4l2_format *f);355int (*vidioc_s_fmt_vbi_out)(struct file *file, void *fh,356struct v4l2_format *f);357int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *file, void *fh,358struct v4l2_format *f);359int (*vidioc_s_fmt_sliced_vbi_out)(struct file *file, void *fh,360struct v4l2_format *f);361int (*vidioc_s_fmt_vid_cap_mplane)(struct file *file, void *fh,362struct v4l2_format *f);363int (*vidioc_s_fmt_vid_out_mplane)(struct file *file, void *fh,364struct v4l2_format *f);365int (*vidioc_s_fmt_sdr_cap)(struct file *file, void *fh,366struct v4l2_format *f);367int (*vidioc_s_fmt_sdr_out)(struct file *file, void *fh,368struct v4l2_format *f);369int (*vidioc_s_fmt_meta_cap)(struct file *file, void *fh,370struct v4l2_format *f);371int (*vidioc_s_fmt_meta_out)(struct file *file, void *fh,372struct v4l2_format *f);373374/* VIDIOC_TRY_FMT handlers */375int (*vidioc_try_fmt_vid_cap)(struct file *file, void *fh,376struct v4l2_format *f);377int (*vidioc_try_fmt_vid_overlay)(struct file *file, void *fh,378struct v4l2_format *f);379int (*vidioc_try_fmt_vid_out)(struct file *file, void *fh,380struct v4l2_format *f);381int (*vidioc_try_fmt_vid_out_overlay)(struct file *file, void *fh,382struct v4l2_format *f);383int (*vidioc_try_fmt_vbi_cap)(struct file *file, void *fh,384struct v4l2_format *f);385int (*vidioc_try_fmt_vbi_out)(struct file *file, void *fh,386struct v4l2_format *f);387int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *file, void *fh,388struct v4l2_format *f);389int (*vidioc_try_fmt_sliced_vbi_out)(struct file *file, void *fh,390struct v4l2_format *f);391int (*vidioc_try_fmt_vid_cap_mplane)(struct file *file, void *fh,392struct v4l2_format *f);393int (*vidioc_try_fmt_vid_out_mplane)(struct file *file, void *fh,394struct v4l2_format *f);395int (*vidioc_try_fmt_sdr_cap)(struct file *file, void *fh,396struct v4l2_format *f);397int (*vidioc_try_fmt_sdr_out)(struct file *file, void *fh,398struct v4l2_format *f);399int (*vidioc_try_fmt_meta_cap)(struct file *file, void *fh,400struct v4l2_format *f);401int (*vidioc_try_fmt_meta_out)(struct file *file, void *fh,402struct v4l2_format *f);403404/* Buffer handlers */405int (*vidioc_reqbufs)(struct file *file, void *fh,406struct v4l2_requestbuffers *b);407int (*vidioc_querybuf)(struct file *file, void *fh,408struct v4l2_buffer *b);409int (*vidioc_qbuf)(struct file *file, void *fh,410struct v4l2_buffer *b);411int (*vidioc_expbuf)(struct file *file, void *fh,412struct v4l2_exportbuffer *e);413int (*vidioc_dqbuf)(struct file *file, void *fh,414struct v4l2_buffer *b);415416int (*vidioc_create_bufs)(struct file *file, void *fh,417struct v4l2_create_buffers *b);418int (*vidioc_prepare_buf)(struct file *file, void *fh,419struct v4l2_buffer *b);420int (*vidioc_remove_bufs)(struct file *file, void *fh,421struct v4l2_remove_buffers *d);422423int (*vidioc_overlay)(struct file *file, void *fh, unsigned int i);424int (*vidioc_g_fbuf)(struct file *file, void *fh,425struct v4l2_framebuffer *a);426int (*vidioc_s_fbuf)(struct file *file, void *fh,427const struct v4l2_framebuffer *a);428429/* Stream on/off */430int (*vidioc_streamon)(struct file *file, void *fh,431enum v4l2_buf_type i);432int (*vidioc_streamoff)(struct file *file, void *fh,433enum v4l2_buf_type i);434435/*436* Standard handling437*438* Note: ENUMSTD is handled by videodev.c439*/440int (*vidioc_g_std)(struct file *file, void *fh, v4l2_std_id *norm);441int (*vidioc_s_std)(struct file *file, void *fh, v4l2_std_id norm);442int (*vidioc_querystd)(struct file *file, void *fh, v4l2_std_id *a);443444/* Input handling */445int (*vidioc_enum_input)(struct file *file, void *fh,446struct v4l2_input *inp);447int (*vidioc_g_input)(struct file *file, void *fh, unsigned int *i);448int (*vidioc_s_input)(struct file *file, void *fh, unsigned int i);449450/* Output handling */451int (*vidioc_enum_output)(struct file *file, void *fh,452struct v4l2_output *a);453int (*vidioc_g_output)(struct file *file, void *fh, unsigned int *i);454int (*vidioc_s_output)(struct file *file, void *fh, unsigned int i);455456/* Control handling */457int (*vidioc_query_ext_ctrl)(struct file *file, void *fh,458struct v4l2_query_ext_ctrl *a);459int (*vidioc_g_ext_ctrls)(struct file *file, void *fh,460struct v4l2_ext_controls *a);461int (*vidioc_s_ext_ctrls)(struct file *file, void *fh,462struct v4l2_ext_controls *a);463int (*vidioc_try_ext_ctrls)(struct file *file, void *fh,464struct v4l2_ext_controls *a);465int (*vidioc_querymenu)(struct file *file, void *fh,466struct v4l2_querymenu *a);467468/* Audio ioctls */469int (*vidioc_enumaudio)(struct file *file, void *fh,470struct v4l2_audio *a);471int (*vidioc_g_audio)(struct file *file, void *fh,472struct v4l2_audio *a);473int (*vidioc_s_audio)(struct file *file, void *fh,474const struct v4l2_audio *a);475476/* Audio out ioctls */477int (*vidioc_enumaudout)(struct file *file, void *fh,478struct v4l2_audioout *a);479int (*vidioc_g_audout)(struct file *file, void *fh,480struct v4l2_audioout *a);481int (*vidioc_s_audout)(struct file *file, void *fh,482const struct v4l2_audioout *a);483int (*vidioc_g_modulator)(struct file *file, void *fh,484struct v4l2_modulator *a);485int (*vidioc_s_modulator)(struct file *file, void *fh,486const struct v4l2_modulator *a);487/* Crop ioctls */488int (*vidioc_g_pixelaspect)(struct file *file, void *fh,489int buf_type, struct v4l2_fract *aspect);490int (*vidioc_g_selection)(struct file *file, void *fh,491struct v4l2_selection *s);492int (*vidioc_s_selection)(struct file *file, void *fh,493struct v4l2_selection *s);494/* Compression ioctls */495int (*vidioc_g_jpegcomp)(struct file *file, void *fh,496struct v4l2_jpegcompression *a);497int (*vidioc_s_jpegcomp)(struct file *file, void *fh,498const struct v4l2_jpegcompression *a);499int (*vidioc_g_enc_index)(struct file *file, void *fh,500struct v4l2_enc_idx *a);501int (*vidioc_encoder_cmd)(struct file *file, void *fh,502struct v4l2_encoder_cmd *a);503int (*vidioc_try_encoder_cmd)(struct file *file, void *fh,504struct v4l2_encoder_cmd *a);505int (*vidioc_decoder_cmd)(struct file *file, void *fh,506struct v4l2_decoder_cmd *a);507int (*vidioc_try_decoder_cmd)(struct file *file, void *fh,508struct v4l2_decoder_cmd *a);509510/* Stream type-dependent parameter ioctls */511int (*vidioc_g_parm)(struct file *file, void *fh,512struct v4l2_streamparm *a);513int (*vidioc_s_parm)(struct file *file, void *fh,514struct v4l2_streamparm *a);515516/* Tuner ioctls */517int (*vidioc_g_tuner)(struct file *file, void *fh,518struct v4l2_tuner *a);519int (*vidioc_s_tuner)(struct file *file, void *fh,520const struct v4l2_tuner *a);521int (*vidioc_g_frequency)(struct file *file, void *fh,522struct v4l2_frequency *a);523int (*vidioc_s_frequency)(struct file *file, void *fh,524const struct v4l2_frequency *a);525int (*vidioc_enum_freq_bands)(struct file *file, void *fh,526struct v4l2_frequency_band *band);527528/* Sliced VBI cap */529int (*vidioc_g_sliced_vbi_cap)(struct file *file, void *fh,530struct v4l2_sliced_vbi_cap *a);531532/* Log status ioctl */533int (*vidioc_log_status)(struct file *file, void *fh);534535int (*vidioc_s_hw_freq_seek)(struct file *file, void *fh,536const struct v4l2_hw_freq_seek *a);537538/* Debugging ioctls */539#ifdef CONFIG_VIDEO_ADV_DEBUG540int (*vidioc_g_register)(struct file *file, void *fh,541struct v4l2_dbg_register *reg);542int (*vidioc_s_register)(struct file *file, void *fh,543const struct v4l2_dbg_register *reg);544545int (*vidioc_g_chip_info)(struct file *file, void *fh,546struct v4l2_dbg_chip_info *chip);547#endif548549int (*vidioc_enum_framesizes)(struct file *file, void *fh,550struct v4l2_frmsizeenum *fsize);551552int (*vidioc_enum_frameintervals)(struct file *file, void *fh,553struct v4l2_frmivalenum *fival);554555/* DV Timings IOCTLs */556int (*vidioc_s_dv_timings)(struct file *file, void *fh,557struct v4l2_dv_timings *timings);558int (*vidioc_g_dv_timings)(struct file *file, void *fh,559struct v4l2_dv_timings *timings);560int (*vidioc_query_dv_timings)(struct file *file, void *fh,561struct v4l2_dv_timings *timings);562int (*vidioc_enum_dv_timings)(struct file *file, void *fh,563struct v4l2_enum_dv_timings *timings);564int (*vidioc_dv_timings_cap)(struct file *file, void *fh,565struct v4l2_dv_timings_cap *cap);566int (*vidioc_g_edid)(struct file *file, void *fh,567struct v4l2_edid *edid);568int (*vidioc_s_edid)(struct file *file, void *fh,569struct v4l2_edid *edid);570571int (*vidioc_subscribe_event)(struct v4l2_fh *fh,572const struct v4l2_event_subscription *sub);573int (*vidioc_unsubscribe_event)(struct v4l2_fh *fh,574const struct v4l2_event_subscription *sub);575576/* For other private ioctls */577long (*vidioc_default)(struct file *file, void *fh,578bool valid_prio, unsigned int cmd, void *arg);579};580581582/* v4l debugging and diagnostics */583584/* Device debug flags to be used with the video device debug attribute */585586/* Just log the ioctl name + error code */587#define V4L2_DEV_DEBUG_IOCTL 0x01588/* Log the ioctl name arguments + error code */589#define V4L2_DEV_DEBUG_IOCTL_ARG 0x02590/* Log the file operations open, release, mmap and get_unmapped_area */591#define V4L2_DEV_DEBUG_FOP 0x04592/* Log the read and write file operations and the VIDIOC_(D)QBUF ioctls */593#define V4L2_DEV_DEBUG_STREAMING 0x08594/* Log poll() */595#define V4L2_DEV_DEBUG_POLL 0x10596/* Log controls */597#define V4L2_DEV_DEBUG_CTRL 0x20598599/* Video standard functions */600601/**602* v4l2_norm_to_name - Ancillary routine to analog TV standard name from its ID.603*604* @id: analog TV standard ID.605*606* Return: returns a string with the name of the analog TV standard.607* If the standard is not found or if @id points to multiple standard,608* it returns "Unknown".609*/610const char *v4l2_norm_to_name(v4l2_std_id id);611612/**613* v4l2_video_std_frame_period - Ancillary routine that fills a614* struct &v4l2_fract pointer with the default framerate fraction.615*616* @id: analog TV standard ID.617* @frameperiod: struct &v4l2_fract pointer to be filled618*619*/620void v4l2_video_std_frame_period(int id, struct v4l2_fract *frameperiod);621622/**623* v4l2_video_std_construct - Ancillary routine that fills in the fields of624* a &v4l2_standard structure according to the @id parameter.625*626* @vs: struct &v4l2_standard pointer to be filled627* @id: analog TV standard ID.628* @name: name of the standard to be used629*630* .. note::631*632* This ancillary routine is obsolete. Shouldn't be used on newer drivers.633*/634int v4l2_video_std_construct(struct v4l2_standard *vs,635int id, const char *name);636637/**638* v4l_video_std_enumstd - Ancillary routine that fills in the fields of639* a &v4l2_standard structure according to the @id and @vs->index640* parameters.641*642* @vs: struct &v4l2_standard pointer to be filled.643* @id: analog TV standard ID.644*645*/646int v4l_video_std_enumstd(struct v4l2_standard *vs, v4l2_std_id id);647648/**649* v4l_printk_ioctl - Ancillary routine that prints the ioctl in a650* human-readable format.651*652* @prefix: prefix to be added at the ioctl prints.653* @cmd: ioctl name654*655* .. note::656*657* If prefix != %NULL, then it will issue a658* ``printk(KERN_DEBUG "%s: ", prefix)`` first.659*/660void v4l_printk_ioctl(const char *prefix, unsigned int cmd);661662struct video_device;663664/* names for fancy debug output */665extern const char *v4l2_field_names[];666extern const char *v4l2_type_names[];667668#ifdef CONFIG_COMPAT669/**670* v4l2_compat_ioctl32 -32 Bits compatibility layer for 64 bits processors671*672* @file: Pointer to struct &file.673* @cmd: Ioctl name.674* @arg: Ioctl argument.675*/676long int v4l2_compat_ioctl32(struct file *file, unsigned int cmd,677unsigned long arg);678#endif679680unsigned int v4l2_compat_translate_cmd(unsigned int cmd);681unsigned int v4l2_translate_cmd(unsigned int cmd);682int v4l2_compat_get_user(void __user *arg, void *parg, unsigned int cmd);683int v4l2_compat_put_user(void __user *arg, void *parg, unsigned int cmd);684int v4l2_compat_get_array_args(struct file *file, void *mbuf,685void __user *user_ptr, size_t array_size,686unsigned int cmd, void *arg);687int v4l2_compat_put_array_args(struct file *file, void __user *user_ptr,688void *mbuf, size_t array_size,689unsigned int cmd, void *arg);690691/**692* typedef v4l2_kioctl - Typedef used to pass an ioctl handler.693*694* @file: Pointer to struct &file.695* @cmd: Ioctl name.696* @arg: Ioctl argument.697*/698typedef long (*v4l2_kioctl)(struct file *file, unsigned int cmd, void *arg);699700/**701* video_usercopy - copies data from/to userspace memory when an ioctl is702* issued.703*704* @file: Pointer to struct &file.705* @cmd: Ioctl name.706* @arg: Ioctl argument.707* @func: function that will handle the ioctl708*709* .. note::710*711* This routine should be used only inside the V4L2 core.712*/713long int video_usercopy(struct file *file, unsigned int cmd,714unsigned long int arg, v4l2_kioctl func);715716/**717* video_ioctl2 - Handles a V4L2 ioctl.718*719* @file: Pointer to struct &file.720* @cmd: Ioctl name.721* @arg: Ioctl argument.722*723* Method used to hancle an ioctl. Should be used to fill the724* &v4l2_ioctl_ops.unlocked_ioctl on all V4L2 drivers.725*/726long int video_ioctl2(struct file *file,727unsigned int cmd, unsigned long int arg);728729/*730* The user space interpretation of the 'v4l2_event' differs731* based on the 'time_t' definition on 32-bit architectures, so732* the kernel has to handle both.733* This is the old version for 32-bit architectures.734*/735struct v4l2_event_time32 {736__u32 type;737union {738struct v4l2_event_vsync vsync;739struct v4l2_event_ctrl ctrl;740struct v4l2_event_frame_sync frame_sync;741struct v4l2_event_src_change src_change;742struct v4l2_event_motion_det motion_det;743__u8 data[64];744} u;745__u32 pending;746__u32 sequence;747struct old_timespec32 timestamp;748__u32 id;749__u32 reserved[8];750};751752#define VIDIOC_DQEVENT_TIME32 _IOR('V', 89, struct v4l2_event_time32)753754struct v4l2_buffer_time32 {755__u32 index;756__u32 type;757__u32 bytesused;758__u32 flags;759__u32 field;760struct old_timeval32 timestamp;761struct v4l2_timecode timecode;762__u32 sequence;763764/* memory location */765__u32 memory;766union {767__u32 offset;768unsigned long userptr;769struct v4l2_plane *planes;770__s32 fd;771} m;772__u32 length;773__u32 reserved2;774union {775__s32 request_fd;776__u32 reserved;777};778};779#define VIDIOC_QUERYBUF_TIME32 _IOWR('V', 9, struct v4l2_buffer_time32)780#define VIDIOC_QBUF_TIME32 _IOWR('V', 15, struct v4l2_buffer_time32)781#define VIDIOC_DQBUF_TIME32 _IOWR('V', 17, struct v4l2_buffer_time32)782#define VIDIOC_PREPARE_BUF_TIME32 _IOWR('V', 93, struct v4l2_buffer_time32)783784#endif /* _V4L2_IOCTL_H */785786787