162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci *	V 4 L 2   D R I V E R   H E L P E R   A P I
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Moved from videodev2.h
762306a36Sopenharmony_ci *
862306a36Sopenharmony_ci *	Some commonly needed functions for drivers (v4l2-common.o module)
962306a36Sopenharmony_ci */
1062306a36Sopenharmony_ci#ifndef _V4L2_IOCTL_H
1162306a36Sopenharmony_ci#define _V4L2_IOCTL_H
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#include <linux/poll.h>
1462306a36Sopenharmony_ci#include <linux/fs.h>
1562306a36Sopenharmony_ci#include <linux/mutex.h>
1662306a36Sopenharmony_ci#include <linux/sched/signal.h>
1762306a36Sopenharmony_ci#include <linux/compiler.h> /* need __user */
1862306a36Sopenharmony_ci#include <linux/videodev2.h>
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_cistruct v4l2_fh;
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci/**
2362306a36Sopenharmony_ci * struct v4l2_ioctl_ops - describe operations for each V4L2 ioctl
2462306a36Sopenharmony_ci *
2562306a36Sopenharmony_ci * @vidioc_querycap: pointer to the function that implements
2662306a36Sopenharmony_ci *	:ref:`VIDIOC_QUERYCAP <vidioc_querycap>` ioctl
2762306a36Sopenharmony_ci * @vidioc_enum_fmt_vid_cap: pointer to the function that implements
2862306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
2962306a36Sopenharmony_ci *	for video capture in single and multi plane mode
3062306a36Sopenharmony_ci * @vidioc_enum_fmt_vid_overlay: pointer to the function that implements
3162306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
3262306a36Sopenharmony_ci *	for video overlay
3362306a36Sopenharmony_ci * @vidioc_enum_fmt_vid_out: pointer to the function that implements
3462306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
3562306a36Sopenharmony_ci *	for video output in single and multi plane mode
3662306a36Sopenharmony_ci * @vidioc_enum_fmt_sdr_cap: pointer to the function that implements
3762306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
3862306a36Sopenharmony_ci *	for Software Defined Radio capture
3962306a36Sopenharmony_ci * @vidioc_enum_fmt_sdr_out: pointer to the function that implements
4062306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
4162306a36Sopenharmony_ci *	for Software Defined Radio output
4262306a36Sopenharmony_ci * @vidioc_enum_fmt_meta_cap: pointer to the function that implements
4362306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
4462306a36Sopenharmony_ci *	for metadata capture
4562306a36Sopenharmony_ci * @vidioc_enum_fmt_meta_out: pointer to the function that implements
4662306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
4762306a36Sopenharmony_ci *	for metadata output
4862306a36Sopenharmony_ci * @vidioc_g_fmt_vid_cap: pointer to the function that implements
4962306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video capture
5062306a36Sopenharmony_ci *	in single plane mode
5162306a36Sopenharmony_ci * @vidioc_g_fmt_vid_overlay: pointer to the function that implements
5262306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video overlay
5362306a36Sopenharmony_ci * @vidioc_g_fmt_vid_out: pointer to the function that implements
5462306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video out
5562306a36Sopenharmony_ci *	in single plane mode
5662306a36Sopenharmony_ci * @vidioc_g_fmt_vid_out_overlay: pointer to the function that implements
5762306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video overlay output
5862306a36Sopenharmony_ci * @vidioc_g_fmt_vbi_cap: pointer to the function that implements
5962306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture
6062306a36Sopenharmony_ci * @vidioc_g_fmt_vbi_out: pointer to the function that implements
6162306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output
6262306a36Sopenharmony_ci * @vidioc_g_fmt_sliced_vbi_cap: pointer to the function that implements
6362306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI capture
6462306a36Sopenharmony_ci * @vidioc_g_fmt_sliced_vbi_out: pointer to the function that implements
6562306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output
6662306a36Sopenharmony_ci * @vidioc_g_fmt_vid_cap_mplane: pointer to the function that implements
6762306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video capture
6862306a36Sopenharmony_ci *	in multiple plane mode
6962306a36Sopenharmony_ci * @vidioc_g_fmt_vid_out_mplane: pointer to the function that implements
7062306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video out
7162306a36Sopenharmony_ci *	in multiplane plane mode
7262306a36Sopenharmony_ci * @vidioc_g_fmt_sdr_cap: pointer to the function that implements
7362306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
7462306a36Sopenharmony_ci *	Radio capture
7562306a36Sopenharmony_ci * @vidioc_g_fmt_sdr_out: pointer to the function that implements
7662306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
7762306a36Sopenharmony_ci *	Radio output
7862306a36Sopenharmony_ci * @vidioc_g_fmt_meta_cap: pointer to the function that implements
7962306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for metadata capture
8062306a36Sopenharmony_ci * @vidioc_g_fmt_meta_out: pointer to the function that implements
8162306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for metadata output
8262306a36Sopenharmony_ci * @vidioc_s_fmt_vid_cap: pointer to the function that implements
8362306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video capture
8462306a36Sopenharmony_ci *	in single plane mode
8562306a36Sopenharmony_ci * @vidioc_s_fmt_vid_overlay: pointer to the function that implements
8662306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video overlay
8762306a36Sopenharmony_ci * @vidioc_s_fmt_vid_out: pointer to the function that implements
8862306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video out
8962306a36Sopenharmony_ci *	in single plane mode
9062306a36Sopenharmony_ci * @vidioc_s_fmt_vid_out_overlay: pointer to the function that implements
9162306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video overlay output
9262306a36Sopenharmony_ci * @vidioc_s_fmt_vbi_cap: pointer to the function that implements
9362306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture
9462306a36Sopenharmony_ci * @vidioc_s_fmt_vbi_out: pointer to the function that implements
9562306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output
9662306a36Sopenharmony_ci * @vidioc_s_fmt_sliced_vbi_cap: pointer to the function that implements
9762306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI capture
9862306a36Sopenharmony_ci * @vidioc_s_fmt_sliced_vbi_out: pointer to the function that implements
9962306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output
10062306a36Sopenharmony_ci * @vidioc_s_fmt_vid_cap_mplane: pointer to the function that implements
10162306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video capture
10262306a36Sopenharmony_ci *	in multiple plane mode
10362306a36Sopenharmony_ci * @vidioc_s_fmt_vid_out_mplane: pointer to the function that implements
10462306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video out
10562306a36Sopenharmony_ci *	in multiplane plane mode
10662306a36Sopenharmony_ci * @vidioc_s_fmt_sdr_cap: pointer to the function that implements
10762306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
10862306a36Sopenharmony_ci *	Radio capture
10962306a36Sopenharmony_ci * @vidioc_s_fmt_sdr_out: pointer to the function that implements
11062306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
11162306a36Sopenharmony_ci *	Radio output
11262306a36Sopenharmony_ci * @vidioc_s_fmt_meta_cap: pointer to the function that implements
11362306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for metadata capture
11462306a36Sopenharmony_ci * @vidioc_s_fmt_meta_out: pointer to the function that implements
11562306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for metadata output
11662306a36Sopenharmony_ci * @vidioc_try_fmt_vid_cap: pointer to the function that implements
11762306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video capture
11862306a36Sopenharmony_ci *	in single plane mode
11962306a36Sopenharmony_ci * @vidioc_try_fmt_vid_overlay: pointer to the function that implements
12062306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video overlay
12162306a36Sopenharmony_ci * @vidioc_try_fmt_vid_out: pointer to the function that implements
12262306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video out
12362306a36Sopenharmony_ci *	in single plane mode
12462306a36Sopenharmony_ci * @vidioc_try_fmt_vid_out_overlay: pointer to the function that implements
12562306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video overlay
12662306a36Sopenharmony_ci *	output
12762306a36Sopenharmony_ci * @vidioc_try_fmt_vbi_cap: pointer to the function that implements
12862306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture
12962306a36Sopenharmony_ci * @vidioc_try_fmt_vbi_out: pointer to the function that implements
13062306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output
13162306a36Sopenharmony_ci * @vidioc_try_fmt_sliced_vbi_cap: pointer to the function that implements
13262306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI
13362306a36Sopenharmony_ci *	capture
13462306a36Sopenharmony_ci * @vidioc_try_fmt_sliced_vbi_out: pointer to the function that implements
13562306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output
13662306a36Sopenharmony_ci * @vidioc_try_fmt_vid_cap_mplane: pointer to the function that implements
13762306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video capture
13862306a36Sopenharmony_ci *	in multiple plane mode
13962306a36Sopenharmony_ci * @vidioc_try_fmt_vid_out_mplane: pointer to the function that implements
14062306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video out
14162306a36Sopenharmony_ci *	in multiplane plane mode
14262306a36Sopenharmony_ci * @vidioc_try_fmt_sdr_cap: pointer to the function that implements
14362306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
14462306a36Sopenharmony_ci *	Radio capture
14562306a36Sopenharmony_ci * @vidioc_try_fmt_sdr_out: pointer to the function that implements
14662306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
14762306a36Sopenharmony_ci *	Radio output
14862306a36Sopenharmony_ci * @vidioc_try_fmt_meta_cap: pointer to the function that implements
14962306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for metadata capture
15062306a36Sopenharmony_ci * @vidioc_try_fmt_meta_out: pointer to the function that implements
15162306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for metadata output
15262306a36Sopenharmony_ci * @vidioc_reqbufs: pointer to the function that implements
15362306a36Sopenharmony_ci *	:ref:`VIDIOC_REQBUFS <vidioc_reqbufs>` ioctl
15462306a36Sopenharmony_ci * @vidioc_querybuf: pointer to the function that implements
15562306a36Sopenharmony_ci *	:ref:`VIDIOC_QUERYBUF <vidioc_querybuf>` ioctl
15662306a36Sopenharmony_ci * @vidioc_qbuf: pointer to the function that implements
15762306a36Sopenharmony_ci *	:ref:`VIDIOC_QBUF <vidioc_qbuf>` ioctl
15862306a36Sopenharmony_ci * @vidioc_expbuf: pointer to the function that implements
15962306a36Sopenharmony_ci *	:ref:`VIDIOC_EXPBUF <vidioc_expbuf>` ioctl
16062306a36Sopenharmony_ci * @vidioc_dqbuf: pointer to the function that implements
16162306a36Sopenharmony_ci *	:ref:`VIDIOC_DQBUF <vidioc_qbuf>` ioctl
16262306a36Sopenharmony_ci * @vidioc_create_bufs: pointer to the function that implements
16362306a36Sopenharmony_ci *	:ref:`VIDIOC_CREATE_BUFS <vidioc_create_bufs>` ioctl
16462306a36Sopenharmony_ci * @vidioc_prepare_buf: pointer to the function that implements
16562306a36Sopenharmony_ci *	:ref:`VIDIOC_PREPARE_BUF <vidioc_prepare_buf>` ioctl
16662306a36Sopenharmony_ci * @vidioc_overlay: pointer to the function that implements
16762306a36Sopenharmony_ci *	:ref:`VIDIOC_OVERLAY <vidioc_overlay>` ioctl
16862306a36Sopenharmony_ci * @vidioc_g_fbuf: pointer to the function that implements
16962306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FBUF <vidioc_g_fbuf>` ioctl
17062306a36Sopenharmony_ci * @vidioc_s_fbuf: pointer to the function that implements
17162306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FBUF <vidioc_g_fbuf>` ioctl
17262306a36Sopenharmony_ci * @vidioc_streamon: pointer to the function that implements
17362306a36Sopenharmony_ci *	:ref:`VIDIOC_STREAMON <vidioc_streamon>` ioctl
17462306a36Sopenharmony_ci * @vidioc_streamoff: pointer to the function that implements
17562306a36Sopenharmony_ci *	:ref:`VIDIOC_STREAMOFF <vidioc_streamon>` ioctl
17662306a36Sopenharmony_ci * @vidioc_g_std: pointer to the function that implements
17762306a36Sopenharmony_ci *	:ref:`VIDIOC_G_STD <vidioc_g_std>` ioctl
17862306a36Sopenharmony_ci * @vidioc_s_std: pointer to the function that implements
17962306a36Sopenharmony_ci *	:ref:`VIDIOC_S_STD <vidioc_g_std>` ioctl
18062306a36Sopenharmony_ci * @vidioc_querystd: pointer to the function that implements
18162306a36Sopenharmony_ci *	:ref:`VIDIOC_QUERYSTD <vidioc_querystd>` ioctl
18262306a36Sopenharmony_ci * @vidioc_enum_input: pointer to the function that implements
18362306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUM_INPUT <vidioc_g_input>` ioctl
18462306a36Sopenharmony_ci * @vidioc_g_input: pointer to the function that implements
18562306a36Sopenharmony_ci *	:ref:`VIDIOC_G_INPUT <vidioc_g_input>` ioctl
18662306a36Sopenharmony_ci * @vidioc_s_input: pointer to the function that implements
18762306a36Sopenharmony_ci *	:ref:`VIDIOC_S_INPUT <vidioc_g_input>` ioctl
18862306a36Sopenharmony_ci * @vidioc_enum_output: pointer to the function that implements
18962306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUM_OUTPUT <vidioc_g_output>` ioctl
19062306a36Sopenharmony_ci * @vidioc_g_output: pointer to the function that implements
19162306a36Sopenharmony_ci *	:ref:`VIDIOC_G_OUTPUT <vidioc_g_output>` ioctl
19262306a36Sopenharmony_ci * @vidioc_s_output: pointer to the function that implements
19362306a36Sopenharmony_ci *	:ref:`VIDIOC_S_OUTPUT <vidioc_g_output>` ioctl
19462306a36Sopenharmony_ci * @vidioc_queryctrl: pointer to the function that implements
19562306a36Sopenharmony_ci *	:ref:`VIDIOC_QUERYCTRL <vidioc_queryctrl>` ioctl
19662306a36Sopenharmony_ci * @vidioc_query_ext_ctrl: pointer to the function that implements
19762306a36Sopenharmony_ci *	:ref:`VIDIOC_QUERY_EXT_CTRL <vidioc_queryctrl>` ioctl
19862306a36Sopenharmony_ci * @vidioc_g_ctrl: pointer to the function that implements
19962306a36Sopenharmony_ci *	:ref:`VIDIOC_G_CTRL <vidioc_g_ctrl>` ioctl
20062306a36Sopenharmony_ci * @vidioc_s_ctrl: pointer to the function that implements
20162306a36Sopenharmony_ci *	:ref:`VIDIOC_S_CTRL <vidioc_g_ctrl>` ioctl
20262306a36Sopenharmony_ci * @vidioc_g_ext_ctrls: pointer to the function that implements
20362306a36Sopenharmony_ci *	:ref:`VIDIOC_G_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl
20462306a36Sopenharmony_ci * @vidioc_s_ext_ctrls: pointer to the function that implements
20562306a36Sopenharmony_ci *	:ref:`VIDIOC_S_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl
20662306a36Sopenharmony_ci * @vidioc_try_ext_ctrls: pointer to the function that implements
20762306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl
20862306a36Sopenharmony_ci * @vidioc_querymenu: pointer to the function that implements
20962306a36Sopenharmony_ci *	:ref:`VIDIOC_QUERYMENU <vidioc_queryctrl>` ioctl
21062306a36Sopenharmony_ci * @vidioc_enumaudio: pointer to the function that implements
21162306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUMAUDIO <vidioc_enumaudio>` ioctl
21262306a36Sopenharmony_ci * @vidioc_g_audio: pointer to the function that implements
21362306a36Sopenharmony_ci *	:ref:`VIDIOC_G_AUDIO <vidioc_g_audio>` ioctl
21462306a36Sopenharmony_ci * @vidioc_s_audio: pointer to the function that implements
21562306a36Sopenharmony_ci *	:ref:`VIDIOC_S_AUDIO <vidioc_g_audio>` ioctl
21662306a36Sopenharmony_ci * @vidioc_enumaudout: pointer to the function that implements
21762306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUMAUDOUT <vidioc_enumaudout>` ioctl
21862306a36Sopenharmony_ci * @vidioc_g_audout: pointer to the function that implements
21962306a36Sopenharmony_ci *	:ref:`VIDIOC_G_AUDOUT <vidioc_g_audout>` ioctl
22062306a36Sopenharmony_ci * @vidioc_s_audout: pointer to the function that implements
22162306a36Sopenharmony_ci *	:ref:`VIDIOC_S_AUDOUT <vidioc_g_audout>` ioctl
22262306a36Sopenharmony_ci * @vidioc_g_modulator: pointer to the function that implements
22362306a36Sopenharmony_ci *	:ref:`VIDIOC_G_MODULATOR <vidioc_g_modulator>` ioctl
22462306a36Sopenharmony_ci * @vidioc_s_modulator: pointer to the function that implements
22562306a36Sopenharmony_ci *	:ref:`VIDIOC_S_MODULATOR <vidioc_g_modulator>` ioctl
22662306a36Sopenharmony_ci * @vidioc_g_pixelaspect: pointer to the function that implements
22762306a36Sopenharmony_ci *	the pixelaspect part of the :ref:`VIDIOC_CROPCAP <vidioc_cropcap>` ioctl
22862306a36Sopenharmony_ci * @vidioc_g_selection: pointer to the function that implements
22962306a36Sopenharmony_ci *	:ref:`VIDIOC_G_SELECTION <vidioc_g_selection>` ioctl
23062306a36Sopenharmony_ci * @vidioc_s_selection: pointer to the function that implements
23162306a36Sopenharmony_ci *	:ref:`VIDIOC_S_SELECTION <vidioc_g_selection>` ioctl
23262306a36Sopenharmony_ci * @vidioc_g_jpegcomp: pointer to the function that implements
23362306a36Sopenharmony_ci *	:ref:`VIDIOC_G_JPEGCOMP <vidioc_g_jpegcomp>` ioctl
23462306a36Sopenharmony_ci * @vidioc_s_jpegcomp: pointer to the function that implements
23562306a36Sopenharmony_ci *	:ref:`VIDIOC_S_JPEGCOMP <vidioc_g_jpegcomp>` ioctl
23662306a36Sopenharmony_ci * @vidioc_g_enc_index: pointer to the function that implements
23762306a36Sopenharmony_ci *	:ref:`VIDIOC_G_ENC_INDEX <vidioc_g_enc_index>` ioctl
23862306a36Sopenharmony_ci * @vidioc_encoder_cmd: pointer to the function that implements
23962306a36Sopenharmony_ci *	:ref:`VIDIOC_ENCODER_CMD <vidioc_encoder_cmd>` ioctl
24062306a36Sopenharmony_ci * @vidioc_try_encoder_cmd: pointer to the function that implements
24162306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_ENCODER_CMD <vidioc_encoder_cmd>` ioctl
24262306a36Sopenharmony_ci * @vidioc_decoder_cmd: pointer to the function that implements
24362306a36Sopenharmony_ci *	:ref:`VIDIOC_DECODER_CMD <vidioc_decoder_cmd>` ioctl
24462306a36Sopenharmony_ci * @vidioc_try_decoder_cmd: pointer to the function that implements
24562306a36Sopenharmony_ci *	:ref:`VIDIOC_TRY_DECODER_CMD <vidioc_decoder_cmd>` ioctl
24662306a36Sopenharmony_ci * @vidioc_g_parm: pointer to the function that implements
24762306a36Sopenharmony_ci *	:ref:`VIDIOC_G_PARM <vidioc_g_parm>` ioctl
24862306a36Sopenharmony_ci * @vidioc_s_parm: pointer to the function that implements
24962306a36Sopenharmony_ci *	:ref:`VIDIOC_S_PARM <vidioc_g_parm>` ioctl
25062306a36Sopenharmony_ci * @vidioc_g_tuner: pointer to the function that implements
25162306a36Sopenharmony_ci *	:ref:`VIDIOC_G_TUNER <vidioc_g_tuner>` ioctl
25262306a36Sopenharmony_ci * @vidioc_s_tuner: pointer to the function that implements
25362306a36Sopenharmony_ci *	:ref:`VIDIOC_S_TUNER <vidioc_g_tuner>` ioctl
25462306a36Sopenharmony_ci * @vidioc_g_frequency: pointer to the function that implements
25562306a36Sopenharmony_ci *	:ref:`VIDIOC_G_FREQUENCY <vidioc_g_frequency>` ioctl
25662306a36Sopenharmony_ci * @vidioc_s_frequency: pointer to the function that implements
25762306a36Sopenharmony_ci *	:ref:`VIDIOC_S_FREQUENCY <vidioc_g_frequency>` ioctl
25862306a36Sopenharmony_ci * @vidioc_enum_freq_bands: pointer to the function that implements
25962306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUM_FREQ_BANDS <vidioc_enum_freq_bands>` ioctl
26062306a36Sopenharmony_ci * @vidioc_g_sliced_vbi_cap: pointer to the function that implements
26162306a36Sopenharmony_ci *	:ref:`VIDIOC_G_SLICED_VBI_CAP <vidioc_g_sliced_vbi_cap>` ioctl
26262306a36Sopenharmony_ci * @vidioc_log_status: pointer to the function that implements
26362306a36Sopenharmony_ci *	:ref:`VIDIOC_LOG_STATUS <vidioc_log_status>` ioctl
26462306a36Sopenharmony_ci * @vidioc_s_hw_freq_seek: pointer to the function that implements
26562306a36Sopenharmony_ci *	:ref:`VIDIOC_S_HW_FREQ_SEEK <vidioc_s_hw_freq_seek>` ioctl
26662306a36Sopenharmony_ci * @vidioc_g_register: pointer to the function that implements
26762306a36Sopenharmony_ci *	:ref:`VIDIOC_DBG_G_REGISTER <vidioc_dbg_g_register>` ioctl
26862306a36Sopenharmony_ci * @vidioc_s_register: pointer to the function that implements
26962306a36Sopenharmony_ci *	:ref:`VIDIOC_DBG_S_REGISTER <vidioc_dbg_g_register>` ioctl
27062306a36Sopenharmony_ci * @vidioc_g_chip_info: pointer to the function that implements
27162306a36Sopenharmony_ci *	:ref:`VIDIOC_DBG_G_CHIP_INFO <vidioc_dbg_g_chip_info>` ioctl
27262306a36Sopenharmony_ci * @vidioc_enum_framesizes: pointer to the function that implements
27362306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUM_FRAMESIZES <vidioc_enum_framesizes>` ioctl
27462306a36Sopenharmony_ci * @vidioc_enum_frameintervals: pointer to the function that implements
27562306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUM_FRAMEINTERVALS <vidioc_enum_frameintervals>` ioctl
27662306a36Sopenharmony_ci * @vidioc_s_dv_timings: pointer to the function that implements
27762306a36Sopenharmony_ci *	:ref:`VIDIOC_S_DV_TIMINGS <vidioc_g_dv_timings>` ioctl
27862306a36Sopenharmony_ci * @vidioc_g_dv_timings: pointer to the function that implements
27962306a36Sopenharmony_ci *	:ref:`VIDIOC_G_DV_TIMINGS <vidioc_g_dv_timings>` ioctl
28062306a36Sopenharmony_ci * @vidioc_query_dv_timings: pointer to the function that implements
28162306a36Sopenharmony_ci *	:ref:`VIDIOC_QUERY_DV_TIMINGS <vidioc_query_dv_timings>` ioctl
28262306a36Sopenharmony_ci * @vidioc_enum_dv_timings: pointer to the function that implements
28362306a36Sopenharmony_ci *	:ref:`VIDIOC_ENUM_DV_TIMINGS <vidioc_enum_dv_timings>` ioctl
28462306a36Sopenharmony_ci * @vidioc_dv_timings_cap: pointer to the function that implements
28562306a36Sopenharmony_ci *	:ref:`VIDIOC_DV_TIMINGS_CAP <vidioc_dv_timings_cap>` ioctl
28662306a36Sopenharmony_ci * @vidioc_g_edid: pointer to the function that implements
28762306a36Sopenharmony_ci *	:ref:`VIDIOC_G_EDID <vidioc_g_edid>` ioctl
28862306a36Sopenharmony_ci * @vidioc_s_edid: pointer to the function that implements
28962306a36Sopenharmony_ci *	:ref:`VIDIOC_S_EDID <vidioc_g_edid>` ioctl
29062306a36Sopenharmony_ci * @vidioc_subscribe_event: pointer to the function that implements
29162306a36Sopenharmony_ci *	:ref:`VIDIOC_SUBSCRIBE_EVENT <vidioc_subscribe_event>` ioctl
29262306a36Sopenharmony_ci * @vidioc_unsubscribe_event: pointer to the function that implements
29362306a36Sopenharmony_ci *	:ref:`VIDIOC_UNSUBSCRIBE_EVENT <vidioc_unsubscribe_event>` ioctl
29462306a36Sopenharmony_ci * @vidioc_default: pointed used to allow other ioctls
29562306a36Sopenharmony_ci */
29662306a36Sopenharmony_cistruct v4l2_ioctl_ops {
29762306a36Sopenharmony_ci	/* ioctl callbacks */
29862306a36Sopenharmony_ci
29962306a36Sopenharmony_ci	/* VIDIOC_QUERYCAP handler */
30062306a36Sopenharmony_ci	int (*vidioc_querycap)(struct file *file, void *fh,
30162306a36Sopenharmony_ci			       struct v4l2_capability *cap);
30262306a36Sopenharmony_ci
30362306a36Sopenharmony_ci	/* VIDIOC_ENUM_FMT handlers */
30462306a36Sopenharmony_ci	int (*vidioc_enum_fmt_vid_cap)(struct file *file, void *fh,
30562306a36Sopenharmony_ci				       struct v4l2_fmtdesc *f);
30662306a36Sopenharmony_ci	int (*vidioc_enum_fmt_vid_overlay)(struct file *file, void *fh,
30762306a36Sopenharmony_ci					   struct v4l2_fmtdesc *f);
30862306a36Sopenharmony_ci	int (*vidioc_enum_fmt_vid_out)(struct file *file, void *fh,
30962306a36Sopenharmony_ci				       struct v4l2_fmtdesc *f);
31062306a36Sopenharmony_ci	int (*vidioc_enum_fmt_sdr_cap)(struct file *file, void *fh,
31162306a36Sopenharmony_ci				       struct v4l2_fmtdesc *f);
31262306a36Sopenharmony_ci	int (*vidioc_enum_fmt_sdr_out)(struct file *file, void *fh,
31362306a36Sopenharmony_ci				       struct v4l2_fmtdesc *f);
31462306a36Sopenharmony_ci	int (*vidioc_enum_fmt_meta_cap)(struct file *file, void *fh,
31562306a36Sopenharmony_ci					struct v4l2_fmtdesc *f);
31662306a36Sopenharmony_ci	int (*vidioc_enum_fmt_meta_out)(struct file *file, void *fh,
31762306a36Sopenharmony_ci					struct v4l2_fmtdesc *f);
31862306a36Sopenharmony_ci
31962306a36Sopenharmony_ci	/* VIDIOC_G_FMT handlers */
32062306a36Sopenharmony_ci	int (*vidioc_g_fmt_vid_cap)(struct file *file, void *fh,
32162306a36Sopenharmony_ci				    struct v4l2_format *f);
32262306a36Sopenharmony_ci	int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *fh,
32362306a36Sopenharmony_ci					struct v4l2_format *f);
32462306a36Sopenharmony_ci	int (*vidioc_g_fmt_vid_out)(struct file *file, void *fh,
32562306a36Sopenharmony_ci				    struct v4l2_format *f);
32662306a36Sopenharmony_ci	int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *fh,
32762306a36Sopenharmony_ci					    struct v4l2_format *f);
32862306a36Sopenharmony_ci	int (*vidioc_g_fmt_vbi_cap)(struct file *file, void *fh,
32962306a36Sopenharmony_ci				    struct v4l2_format *f);
33062306a36Sopenharmony_ci	int (*vidioc_g_fmt_vbi_out)(struct file *file, void *fh,
33162306a36Sopenharmony_ci				    struct v4l2_format *f);
33262306a36Sopenharmony_ci	int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *fh,
33362306a36Sopenharmony_ci					   struct v4l2_format *f);
33462306a36Sopenharmony_ci	int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *fh,
33562306a36Sopenharmony_ci					   struct v4l2_format *f);
33662306a36Sopenharmony_ci	int (*vidioc_g_fmt_vid_cap_mplane)(struct file *file, void *fh,
33762306a36Sopenharmony_ci					   struct v4l2_format *f);
33862306a36Sopenharmony_ci	int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *fh,
33962306a36Sopenharmony_ci					   struct v4l2_format *f);
34062306a36Sopenharmony_ci	int (*vidioc_g_fmt_sdr_cap)(struct file *file, void *fh,
34162306a36Sopenharmony_ci				    struct v4l2_format *f);
34262306a36Sopenharmony_ci	int (*vidioc_g_fmt_sdr_out)(struct file *file, void *fh,
34362306a36Sopenharmony_ci				    struct v4l2_format *f);
34462306a36Sopenharmony_ci	int (*vidioc_g_fmt_meta_cap)(struct file *file, void *fh,
34562306a36Sopenharmony_ci				     struct v4l2_format *f);
34662306a36Sopenharmony_ci	int (*vidioc_g_fmt_meta_out)(struct file *file, void *fh,
34762306a36Sopenharmony_ci				     struct v4l2_format *f);
34862306a36Sopenharmony_ci
34962306a36Sopenharmony_ci	/* VIDIOC_S_FMT handlers */
35062306a36Sopenharmony_ci	int (*vidioc_s_fmt_vid_cap)(struct file *file, void *fh,
35162306a36Sopenharmony_ci				    struct v4l2_format *f);
35262306a36Sopenharmony_ci	int (*vidioc_s_fmt_vid_overlay)(struct file *file, void *fh,
35362306a36Sopenharmony_ci					struct v4l2_format *f);
35462306a36Sopenharmony_ci	int (*vidioc_s_fmt_vid_out)(struct file *file, void *fh,
35562306a36Sopenharmony_ci				    struct v4l2_format *f);
35662306a36Sopenharmony_ci	int (*vidioc_s_fmt_vid_out_overlay)(struct file *file, void *fh,
35762306a36Sopenharmony_ci					    struct v4l2_format *f);
35862306a36Sopenharmony_ci	int (*vidioc_s_fmt_vbi_cap)(struct file *file, void *fh,
35962306a36Sopenharmony_ci				    struct v4l2_format *f);
36062306a36Sopenharmony_ci	int (*vidioc_s_fmt_vbi_out)(struct file *file, void *fh,
36162306a36Sopenharmony_ci				    struct v4l2_format *f);
36262306a36Sopenharmony_ci	int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *file, void *fh,
36362306a36Sopenharmony_ci					   struct v4l2_format *f);
36462306a36Sopenharmony_ci	int (*vidioc_s_fmt_sliced_vbi_out)(struct file *file, void *fh,
36562306a36Sopenharmony_ci					   struct v4l2_format *f);
36662306a36Sopenharmony_ci	int (*vidioc_s_fmt_vid_cap_mplane)(struct file *file, void *fh,
36762306a36Sopenharmony_ci					   struct v4l2_format *f);
36862306a36Sopenharmony_ci	int (*vidioc_s_fmt_vid_out_mplane)(struct file *file, void *fh,
36962306a36Sopenharmony_ci					   struct v4l2_format *f);
37062306a36Sopenharmony_ci	int (*vidioc_s_fmt_sdr_cap)(struct file *file, void *fh,
37162306a36Sopenharmony_ci				    struct v4l2_format *f);
37262306a36Sopenharmony_ci	int (*vidioc_s_fmt_sdr_out)(struct file *file, void *fh,
37362306a36Sopenharmony_ci				    struct v4l2_format *f);
37462306a36Sopenharmony_ci	int (*vidioc_s_fmt_meta_cap)(struct file *file, void *fh,
37562306a36Sopenharmony_ci				     struct v4l2_format *f);
37662306a36Sopenharmony_ci	int (*vidioc_s_fmt_meta_out)(struct file *file, void *fh,
37762306a36Sopenharmony_ci				     struct v4l2_format *f);
37862306a36Sopenharmony_ci
37962306a36Sopenharmony_ci	/* VIDIOC_TRY_FMT handlers */
38062306a36Sopenharmony_ci	int (*vidioc_try_fmt_vid_cap)(struct file *file, void *fh,
38162306a36Sopenharmony_ci				      struct v4l2_format *f);
38262306a36Sopenharmony_ci	int (*vidioc_try_fmt_vid_overlay)(struct file *file, void *fh,
38362306a36Sopenharmony_ci					  struct v4l2_format *f);
38462306a36Sopenharmony_ci	int (*vidioc_try_fmt_vid_out)(struct file *file, void *fh,
38562306a36Sopenharmony_ci				      struct v4l2_format *f);
38662306a36Sopenharmony_ci	int (*vidioc_try_fmt_vid_out_overlay)(struct file *file, void *fh,
38762306a36Sopenharmony_ci					     struct v4l2_format *f);
38862306a36Sopenharmony_ci	int (*vidioc_try_fmt_vbi_cap)(struct file *file, void *fh,
38962306a36Sopenharmony_ci				      struct v4l2_format *f);
39062306a36Sopenharmony_ci	int (*vidioc_try_fmt_vbi_out)(struct file *file, void *fh,
39162306a36Sopenharmony_ci				      struct v4l2_format *f);
39262306a36Sopenharmony_ci	int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *file, void *fh,
39362306a36Sopenharmony_ci					     struct v4l2_format *f);
39462306a36Sopenharmony_ci	int (*vidioc_try_fmt_sliced_vbi_out)(struct file *file, void *fh,
39562306a36Sopenharmony_ci					     struct v4l2_format *f);
39662306a36Sopenharmony_ci	int (*vidioc_try_fmt_vid_cap_mplane)(struct file *file, void *fh,
39762306a36Sopenharmony_ci					     struct v4l2_format *f);
39862306a36Sopenharmony_ci	int (*vidioc_try_fmt_vid_out_mplane)(struct file *file, void *fh,
39962306a36Sopenharmony_ci					     struct v4l2_format *f);
40062306a36Sopenharmony_ci	int (*vidioc_try_fmt_sdr_cap)(struct file *file, void *fh,
40162306a36Sopenharmony_ci				      struct v4l2_format *f);
40262306a36Sopenharmony_ci	int (*vidioc_try_fmt_sdr_out)(struct file *file, void *fh,
40362306a36Sopenharmony_ci				      struct v4l2_format *f);
40462306a36Sopenharmony_ci	int (*vidioc_try_fmt_meta_cap)(struct file *file, void *fh,
40562306a36Sopenharmony_ci				       struct v4l2_format *f);
40662306a36Sopenharmony_ci	int (*vidioc_try_fmt_meta_out)(struct file *file, void *fh,
40762306a36Sopenharmony_ci				       struct v4l2_format *f);
40862306a36Sopenharmony_ci
40962306a36Sopenharmony_ci	/* Buffer handlers */
41062306a36Sopenharmony_ci	int (*vidioc_reqbufs)(struct file *file, void *fh,
41162306a36Sopenharmony_ci			      struct v4l2_requestbuffers *b);
41262306a36Sopenharmony_ci	int (*vidioc_querybuf)(struct file *file, void *fh,
41362306a36Sopenharmony_ci			       struct v4l2_buffer *b);
41462306a36Sopenharmony_ci	int (*vidioc_qbuf)(struct file *file, void *fh,
41562306a36Sopenharmony_ci			   struct v4l2_buffer *b);
41662306a36Sopenharmony_ci	int (*vidioc_expbuf)(struct file *file, void *fh,
41762306a36Sopenharmony_ci			     struct v4l2_exportbuffer *e);
41862306a36Sopenharmony_ci	int (*vidioc_dqbuf)(struct file *file, void *fh,
41962306a36Sopenharmony_ci			    struct v4l2_buffer *b);
42062306a36Sopenharmony_ci
42162306a36Sopenharmony_ci	int (*vidioc_create_bufs)(struct file *file, void *fh,
42262306a36Sopenharmony_ci				  struct v4l2_create_buffers *b);
42362306a36Sopenharmony_ci	int (*vidioc_prepare_buf)(struct file *file, void *fh,
42462306a36Sopenharmony_ci				  struct v4l2_buffer *b);
42562306a36Sopenharmony_ci
42662306a36Sopenharmony_ci	int (*vidioc_overlay)(struct file *file, void *fh, unsigned int i);
42762306a36Sopenharmony_ci	int (*vidioc_g_fbuf)(struct file *file, void *fh,
42862306a36Sopenharmony_ci			     struct v4l2_framebuffer *a);
42962306a36Sopenharmony_ci	int (*vidioc_s_fbuf)(struct file *file, void *fh,
43062306a36Sopenharmony_ci			     const struct v4l2_framebuffer *a);
43162306a36Sopenharmony_ci
43262306a36Sopenharmony_ci		/* Stream on/off */
43362306a36Sopenharmony_ci	int (*vidioc_streamon)(struct file *file, void *fh,
43462306a36Sopenharmony_ci			       enum v4l2_buf_type i);
43562306a36Sopenharmony_ci	int (*vidioc_streamoff)(struct file *file, void *fh,
43662306a36Sopenharmony_ci				enum v4l2_buf_type i);
43762306a36Sopenharmony_ci
43862306a36Sopenharmony_ci		/*
43962306a36Sopenharmony_ci		 * Standard handling
44062306a36Sopenharmony_ci		 *
44162306a36Sopenharmony_ci		 * Note: ENUMSTD is handled by videodev.c
44262306a36Sopenharmony_ci		 */
44362306a36Sopenharmony_ci	int (*vidioc_g_std)(struct file *file, void *fh, v4l2_std_id *norm);
44462306a36Sopenharmony_ci	int (*vidioc_s_std)(struct file *file, void *fh, v4l2_std_id norm);
44562306a36Sopenharmony_ci	int (*vidioc_querystd)(struct file *file, void *fh, v4l2_std_id *a);
44662306a36Sopenharmony_ci
44762306a36Sopenharmony_ci		/* Input handling */
44862306a36Sopenharmony_ci	int (*vidioc_enum_input)(struct file *file, void *fh,
44962306a36Sopenharmony_ci				 struct v4l2_input *inp);
45062306a36Sopenharmony_ci	int (*vidioc_g_input)(struct file *file, void *fh, unsigned int *i);
45162306a36Sopenharmony_ci	int (*vidioc_s_input)(struct file *file, void *fh, unsigned int i);
45262306a36Sopenharmony_ci
45362306a36Sopenharmony_ci		/* Output handling */
45462306a36Sopenharmony_ci	int (*vidioc_enum_output)(struct file *file, void *fh,
45562306a36Sopenharmony_ci				  struct v4l2_output *a);
45662306a36Sopenharmony_ci	int (*vidioc_g_output)(struct file *file, void *fh, unsigned int *i);
45762306a36Sopenharmony_ci	int (*vidioc_s_output)(struct file *file, void *fh, unsigned int i);
45862306a36Sopenharmony_ci
45962306a36Sopenharmony_ci		/* Control handling */
46062306a36Sopenharmony_ci	int (*vidioc_queryctrl)(struct file *file, void *fh,
46162306a36Sopenharmony_ci				struct v4l2_queryctrl *a);
46262306a36Sopenharmony_ci	int (*vidioc_query_ext_ctrl)(struct file *file, void *fh,
46362306a36Sopenharmony_ci				     struct v4l2_query_ext_ctrl *a);
46462306a36Sopenharmony_ci	int (*vidioc_g_ctrl)(struct file *file, void *fh,
46562306a36Sopenharmony_ci			     struct v4l2_control *a);
46662306a36Sopenharmony_ci	int (*vidioc_s_ctrl)(struct file *file, void *fh,
46762306a36Sopenharmony_ci			     struct v4l2_control *a);
46862306a36Sopenharmony_ci	int (*vidioc_g_ext_ctrls)(struct file *file, void *fh,
46962306a36Sopenharmony_ci				  struct v4l2_ext_controls *a);
47062306a36Sopenharmony_ci	int (*vidioc_s_ext_ctrls)(struct file *file, void *fh,
47162306a36Sopenharmony_ci				  struct v4l2_ext_controls *a);
47262306a36Sopenharmony_ci	int (*vidioc_try_ext_ctrls)(struct file *file, void *fh,
47362306a36Sopenharmony_ci				    struct v4l2_ext_controls *a);
47462306a36Sopenharmony_ci	int (*vidioc_querymenu)(struct file *file, void *fh,
47562306a36Sopenharmony_ci				struct v4l2_querymenu *a);
47662306a36Sopenharmony_ci
47762306a36Sopenharmony_ci	/* Audio ioctls */
47862306a36Sopenharmony_ci	int (*vidioc_enumaudio)(struct file *file, void *fh,
47962306a36Sopenharmony_ci				struct v4l2_audio *a);
48062306a36Sopenharmony_ci	int (*vidioc_g_audio)(struct file *file, void *fh,
48162306a36Sopenharmony_ci			      struct v4l2_audio *a);
48262306a36Sopenharmony_ci	int (*vidioc_s_audio)(struct file *file, void *fh,
48362306a36Sopenharmony_ci			      const struct v4l2_audio *a);
48462306a36Sopenharmony_ci
48562306a36Sopenharmony_ci	/* Audio out ioctls */
48662306a36Sopenharmony_ci	int (*vidioc_enumaudout)(struct file *file, void *fh,
48762306a36Sopenharmony_ci				 struct v4l2_audioout *a);
48862306a36Sopenharmony_ci	int (*vidioc_g_audout)(struct file *file, void *fh,
48962306a36Sopenharmony_ci			       struct v4l2_audioout *a);
49062306a36Sopenharmony_ci	int (*vidioc_s_audout)(struct file *file, void *fh,
49162306a36Sopenharmony_ci			       const struct v4l2_audioout *a);
49262306a36Sopenharmony_ci	int (*vidioc_g_modulator)(struct file *file, void *fh,
49362306a36Sopenharmony_ci				  struct v4l2_modulator *a);
49462306a36Sopenharmony_ci	int (*vidioc_s_modulator)(struct file *file, void *fh,
49562306a36Sopenharmony_ci				  const struct v4l2_modulator *a);
49662306a36Sopenharmony_ci	/* Crop ioctls */
49762306a36Sopenharmony_ci	int (*vidioc_g_pixelaspect)(struct file *file, void *fh,
49862306a36Sopenharmony_ci				    int buf_type, struct v4l2_fract *aspect);
49962306a36Sopenharmony_ci	int (*vidioc_g_selection)(struct file *file, void *fh,
50062306a36Sopenharmony_ci				  struct v4l2_selection *s);
50162306a36Sopenharmony_ci	int (*vidioc_s_selection)(struct file *file, void *fh,
50262306a36Sopenharmony_ci				  struct v4l2_selection *s);
50362306a36Sopenharmony_ci	/* Compression ioctls */
50462306a36Sopenharmony_ci	int (*vidioc_g_jpegcomp)(struct file *file, void *fh,
50562306a36Sopenharmony_ci				 struct v4l2_jpegcompression *a);
50662306a36Sopenharmony_ci	int (*vidioc_s_jpegcomp)(struct file *file, void *fh,
50762306a36Sopenharmony_ci				 const struct v4l2_jpegcompression *a);
50862306a36Sopenharmony_ci	int (*vidioc_g_enc_index)(struct file *file, void *fh,
50962306a36Sopenharmony_ci				  struct v4l2_enc_idx *a);
51062306a36Sopenharmony_ci	int (*vidioc_encoder_cmd)(struct file *file, void *fh,
51162306a36Sopenharmony_ci				  struct v4l2_encoder_cmd *a);
51262306a36Sopenharmony_ci	int (*vidioc_try_encoder_cmd)(struct file *file, void *fh,
51362306a36Sopenharmony_ci				      struct v4l2_encoder_cmd *a);
51462306a36Sopenharmony_ci	int (*vidioc_decoder_cmd)(struct file *file, void *fh,
51562306a36Sopenharmony_ci				  struct v4l2_decoder_cmd *a);
51662306a36Sopenharmony_ci	int (*vidioc_try_decoder_cmd)(struct file *file, void *fh,
51762306a36Sopenharmony_ci				      struct v4l2_decoder_cmd *a);
51862306a36Sopenharmony_ci
51962306a36Sopenharmony_ci	/* Stream type-dependent parameter ioctls */
52062306a36Sopenharmony_ci	int (*vidioc_g_parm)(struct file *file, void *fh,
52162306a36Sopenharmony_ci			     struct v4l2_streamparm *a);
52262306a36Sopenharmony_ci	int (*vidioc_s_parm)(struct file *file, void *fh,
52362306a36Sopenharmony_ci			     struct v4l2_streamparm *a);
52462306a36Sopenharmony_ci
52562306a36Sopenharmony_ci	/* Tuner ioctls */
52662306a36Sopenharmony_ci	int (*vidioc_g_tuner)(struct file *file, void *fh,
52762306a36Sopenharmony_ci			      struct v4l2_tuner *a);
52862306a36Sopenharmony_ci	int (*vidioc_s_tuner)(struct file *file, void *fh,
52962306a36Sopenharmony_ci			      const struct v4l2_tuner *a);
53062306a36Sopenharmony_ci	int (*vidioc_g_frequency)(struct file *file, void *fh,
53162306a36Sopenharmony_ci				  struct v4l2_frequency *a);
53262306a36Sopenharmony_ci	int (*vidioc_s_frequency)(struct file *file, void *fh,
53362306a36Sopenharmony_ci				  const struct v4l2_frequency *a);
53462306a36Sopenharmony_ci	int (*vidioc_enum_freq_bands)(struct file *file, void *fh,
53562306a36Sopenharmony_ci				      struct v4l2_frequency_band *band);
53662306a36Sopenharmony_ci
53762306a36Sopenharmony_ci	/* Sliced VBI cap */
53862306a36Sopenharmony_ci	int (*vidioc_g_sliced_vbi_cap)(struct file *file, void *fh,
53962306a36Sopenharmony_ci				       struct v4l2_sliced_vbi_cap *a);
54062306a36Sopenharmony_ci
54162306a36Sopenharmony_ci	/* Log status ioctl */
54262306a36Sopenharmony_ci	int (*vidioc_log_status)(struct file *file, void *fh);
54362306a36Sopenharmony_ci
54462306a36Sopenharmony_ci	int (*vidioc_s_hw_freq_seek)(struct file *file, void *fh,
54562306a36Sopenharmony_ci				     const struct v4l2_hw_freq_seek *a);
54662306a36Sopenharmony_ci
54762306a36Sopenharmony_ci	/* Debugging ioctls */
54862306a36Sopenharmony_ci#ifdef CONFIG_VIDEO_ADV_DEBUG
54962306a36Sopenharmony_ci	int (*vidioc_g_register)(struct file *file, void *fh,
55062306a36Sopenharmony_ci				 struct v4l2_dbg_register *reg);
55162306a36Sopenharmony_ci	int (*vidioc_s_register)(struct file *file, void *fh,
55262306a36Sopenharmony_ci				 const struct v4l2_dbg_register *reg);
55362306a36Sopenharmony_ci
55462306a36Sopenharmony_ci	int (*vidioc_g_chip_info)(struct file *file, void *fh,
55562306a36Sopenharmony_ci				  struct v4l2_dbg_chip_info *chip);
55662306a36Sopenharmony_ci#endif
55762306a36Sopenharmony_ci
55862306a36Sopenharmony_ci	int (*vidioc_enum_framesizes)(struct file *file, void *fh,
55962306a36Sopenharmony_ci				      struct v4l2_frmsizeenum *fsize);
56062306a36Sopenharmony_ci
56162306a36Sopenharmony_ci	int (*vidioc_enum_frameintervals)(struct file *file, void *fh,
56262306a36Sopenharmony_ci					  struct v4l2_frmivalenum *fival);
56362306a36Sopenharmony_ci
56462306a36Sopenharmony_ci	/* DV Timings IOCTLs */
56562306a36Sopenharmony_ci	int (*vidioc_s_dv_timings)(struct file *file, void *fh,
56662306a36Sopenharmony_ci				   struct v4l2_dv_timings *timings);
56762306a36Sopenharmony_ci	int (*vidioc_g_dv_timings)(struct file *file, void *fh,
56862306a36Sopenharmony_ci				   struct v4l2_dv_timings *timings);
56962306a36Sopenharmony_ci	int (*vidioc_query_dv_timings)(struct file *file, void *fh,
57062306a36Sopenharmony_ci				       struct v4l2_dv_timings *timings);
57162306a36Sopenharmony_ci	int (*vidioc_enum_dv_timings)(struct file *file, void *fh,
57262306a36Sopenharmony_ci				      struct v4l2_enum_dv_timings *timings);
57362306a36Sopenharmony_ci	int (*vidioc_dv_timings_cap)(struct file *file, void *fh,
57462306a36Sopenharmony_ci				     struct v4l2_dv_timings_cap *cap);
57562306a36Sopenharmony_ci	int (*vidioc_g_edid)(struct file *file, void *fh,
57662306a36Sopenharmony_ci			     struct v4l2_edid *edid);
57762306a36Sopenharmony_ci	int (*vidioc_s_edid)(struct file *file, void *fh,
57862306a36Sopenharmony_ci			     struct v4l2_edid *edid);
57962306a36Sopenharmony_ci
58062306a36Sopenharmony_ci	int (*vidioc_subscribe_event)(struct v4l2_fh *fh,
58162306a36Sopenharmony_ci				      const struct v4l2_event_subscription *sub);
58262306a36Sopenharmony_ci	int (*vidioc_unsubscribe_event)(struct v4l2_fh *fh,
58362306a36Sopenharmony_ci					const struct v4l2_event_subscription *sub);
58462306a36Sopenharmony_ci
58562306a36Sopenharmony_ci	/* For other private ioctls */
58662306a36Sopenharmony_ci	long (*vidioc_default)(struct file *file, void *fh,
58762306a36Sopenharmony_ci			       bool valid_prio, unsigned int cmd, void *arg);
58862306a36Sopenharmony_ci};
58962306a36Sopenharmony_ci
59062306a36Sopenharmony_ci
59162306a36Sopenharmony_ci/* v4l debugging and diagnostics */
59262306a36Sopenharmony_ci
59362306a36Sopenharmony_ci/* Device debug flags to be used with the video device debug attribute */
59462306a36Sopenharmony_ci
59562306a36Sopenharmony_ci/* Just log the ioctl name + error code */
59662306a36Sopenharmony_ci#define V4L2_DEV_DEBUG_IOCTL		0x01
59762306a36Sopenharmony_ci/* Log the ioctl name arguments + error code */
59862306a36Sopenharmony_ci#define V4L2_DEV_DEBUG_IOCTL_ARG	0x02
59962306a36Sopenharmony_ci/* Log the file operations open, release, mmap and get_unmapped_area */
60062306a36Sopenharmony_ci#define V4L2_DEV_DEBUG_FOP		0x04
60162306a36Sopenharmony_ci/* Log the read and write file operations and the VIDIOC_(D)QBUF ioctls */
60262306a36Sopenharmony_ci#define V4L2_DEV_DEBUG_STREAMING	0x08
60362306a36Sopenharmony_ci/* Log poll() */
60462306a36Sopenharmony_ci#define V4L2_DEV_DEBUG_POLL		0x10
60562306a36Sopenharmony_ci/* Log controls */
60662306a36Sopenharmony_ci#define V4L2_DEV_DEBUG_CTRL		0x20
60762306a36Sopenharmony_ci
60862306a36Sopenharmony_ci/*  Video standard functions  */
60962306a36Sopenharmony_ci
61062306a36Sopenharmony_ci/**
61162306a36Sopenharmony_ci * v4l2_norm_to_name - Ancillary routine to analog TV standard name from its ID.
61262306a36Sopenharmony_ci *
61362306a36Sopenharmony_ci * @id:	analog TV standard ID.
61462306a36Sopenharmony_ci *
61562306a36Sopenharmony_ci * Return: returns a string with the name of the analog TV standard.
61662306a36Sopenharmony_ci * If the standard is not found or if @id points to multiple standard,
61762306a36Sopenharmony_ci * it returns "Unknown".
61862306a36Sopenharmony_ci */
61962306a36Sopenharmony_ciconst char *v4l2_norm_to_name(v4l2_std_id id);
62062306a36Sopenharmony_ci
62162306a36Sopenharmony_ci/**
62262306a36Sopenharmony_ci * v4l2_video_std_frame_period - Ancillary routine that fills a
62362306a36Sopenharmony_ci *	struct &v4l2_fract pointer with the default framerate fraction.
62462306a36Sopenharmony_ci *
62562306a36Sopenharmony_ci * @id: analog TV standard ID.
62662306a36Sopenharmony_ci * @frameperiod: struct &v4l2_fract pointer to be filled
62762306a36Sopenharmony_ci *
62862306a36Sopenharmony_ci */
62962306a36Sopenharmony_civoid v4l2_video_std_frame_period(int id, struct v4l2_fract *frameperiod);
63062306a36Sopenharmony_ci
63162306a36Sopenharmony_ci/**
63262306a36Sopenharmony_ci * v4l2_video_std_construct - Ancillary routine that fills in the fields of
63362306a36Sopenharmony_ci *	a &v4l2_standard structure according to the @id parameter.
63462306a36Sopenharmony_ci *
63562306a36Sopenharmony_ci * @vs: struct &v4l2_standard pointer to be filled
63662306a36Sopenharmony_ci * @id: analog TV standard ID.
63762306a36Sopenharmony_ci * @name: name of the standard to be used
63862306a36Sopenharmony_ci *
63962306a36Sopenharmony_ci * .. note::
64062306a36Sopenharmony_ci *
64162306a36Sopenharmony_ci *    This ancillary routine is obsolete. Shouldn't be used on newer drivers.
64262306a36Sopenharmony_ci */
64362306a36Sopenharmony_ciint v4l2_video_std_construct(struct v4l2_standard *vs,
64462306a36Sopenharmony_ci				    int id, const char *name);
64562306a36Sopenharmony_ci
64662306a36Sopenharmony_ci/**
64762306a36Sopenharmony_ci * v4l_video_std_enumstd - Ancillary routine that fills in the fields of
64862306a36Sopenharmony_ci *	a &v4l2_standard structure according to the @id and @vs->index
64962306a36Sopenharmony_ci *	parameters.
65062306a36Sopenharmony_ci *
65162306a36Sopenharmony_ci * @vs: struct &v4l2_standard pointer to be filled.
65262306a36Sopenharmony_ci * @id: analog TV standard ID.
65362306a36Sopenharmony_ci *
65462306a36Sopenharmony_ci */
65562306a36Sopenharmony_ciint v4l_video_std_enumstd(struct v4l2_standard *vs, v4l2_std_id id);
65662306a36Sopenharmony_ci
65762306a36Sopenharmony_ci/**
65862306a36Sopenharmony_ci * v4l_printk_ioctl - Ancillary routine that prints the ioctl in a
65962306a36Sopenharmony_ci *	human-readable format.
66062306a36Sopenharmony_ci *
66162306a36Sopenharmony_ci * @prefix: prefix to be added at the ioctl prints.
66262306a36Sopenharmony_ci * @cmd: ioctl name
66362306a36Sopenharmony_ci *
66462306a36Sopenharmony_ci * .. note::
66562306a36Sopenharmony_ci *
66662306a36Sopenharmony_ci *    If prefix != %NULL, then it will issue a
66762306a36Sopenharmony_ci *    ``printk(KERN_DEBUG "%s: ", prefix)`` first.
66862306a36Sopenharmony_ci */
66962306a36Sopenharmony_civoid v4l_printk_ioctl(const char *prefix, unsigned int cmd);
67062306a36Sopenharmony_ci
67162306a36Sopenharmony_cistruct video_device;
67262306a36Sopenharmony_ci
67362306a36Sopenharmony_ci/* names for fancy debug output */
67462306a36Sopenharmony_ciextern const char *v4l2_field_names[];
67562306a36Sopenharmony_ciextern const char *v4l2_type_names[];
67662306a36Sopenharmony_ci
67762306a36Sopenharmony_ci#ifdef CONFIG_COMPAT
67862306a36Sopenharmony_ci/**
67962306a36Sopenharmony_ci * v4l2_compat_ioctl32 -32 Bits compatibility layer for 64 bits processors
68062306a36Sopenharmony_ci *
68162306a36Sopenharmony_ci * @file: Pointer to struct &file.
68262306a36Sopenharmony_ci * @cmd: Ioctl name.
68362306a36Sopenharmony_ci * @arg: Ioctl argument.
68462306a36Sopenharmony_ci */
68562306a36Sopenharmony_cilong int v4l2_compat_ioctl32(struct file *file, unsigned int cmd,
68662306a36Sopenharmony_ci			     unsigned long arg);
68762306a36Sopenharmony_ci#endif
68862306a36Sopenharmony_ci
68962306a36Sopenharmony_ciunsigned int v4l2_compat_translate_cmd(unsigned int cmd);
69062306a36Sopenharmony_ciint v4l2_compat_get_user(void __user *arg, void *parg, unsigned int cmd);
69162306a36Sopenharmony_ciint v4l2_compat_put_user(void __user *arg, void *parg, unsigned int cmd);
69262306a36Sopenharmony_ciint v4l2_compat_get_array_args(struct file *file, void *mbuf,
69362306a36Sopenharmony_ci			       void __user *user_ptr, size_t array_size,
69462306a36Sopenharmony_ci			       unsigned int cmd, void *arg);
69562306a36Sopenharmony_ciint v4l2_compat_put_array_args(struct file *file, void __user *user_ptr,
69662306a36Sopenharmony_ci			       void *mbuf, size_t array_size,
69762306a36Sopenharmony_ci			       unsigned int cmd, void *arg);
69862306a36Sopenharmony_ci
69962306a36Sopenharmony_ci/**
70062306a36Sopenharmony_ci * typedef v4l2_kioctl - Typedef used to pass an ioctl handler.
70162306a36Sopenharmony_ci *
70262306a36Sopenharmony_ci * @file: Pointer to struct &file.
70362306a36Sopenharmony_ci * @cmd: Ioctl name.
70462306a36Sopenharmony_ci * @arg: Ioctl argument.
70562306a36Sopenharmony_ci */
70662306a36Sopenharmony_citypedef long (*v4l2_kioctl)(struct file *file, unsigned int cmd, void *arg);
70762306a36Sopenharmony_ci
70862306a36Sopenharmony_ci/**
70962306a36Sopenharmony_ci * video_usercopy - copies data from/to userspace memory when an ioctl is
71062306a36Sopenharmony_ci *	issued.
71162306a36Sopenharmony_ci *
71262306a36Sopenharmony_ci * @file: Pointer to struct &file.
71362306a36Sopenharmony_ci * @cmd: Ioctl name.
71462306a36Sopenharmony_ci * @arg: Ioctl argument.
71562306a36Sopenharmony_ci * @func: function that will handle the ioctl
71662306a36Sopenharmony_ci *
71762306a36Sopenharmony_ci * .. note::
71862306a36Sopenharmony_ci *
71962306a36Sopenharmony_ci *    This routine should be used only inside the V4L2 core.
72062306a36Sopenharmony_ci */
72162306a36Sopenharmony_cilong int video_usercopy(struct file *file, unsigned int cmd,
72262306a36Sopenharmony_ci			unsigned long int arg, v4l2_kioctl func);
72362306a36Sopenharmony_ci
72462306a36Sopenharmony_ci/**
72562306a36Sopenharmony_ci * video_ioctl2 - Handles a V4L2 ioctl.
72662306a36Sopenharmony_ci *
72762306a36Sopenharmony_ci * @file: Pointer to struct &file.
72862306a36Sopenharmony_ci * @cmd: Ioctl name.
72962306a36Sopenharmony_ci * @arg: Ioctl argument.
73062306a36Sopenharmony_ci *
73162306a36Sopenharmony_ci * Method used to hancle an ioctl. Should be used to fill the
73262306a36Sopenharmony_ci * &v4l2_ioctl_ops.unlocked_ioctl on all V4L2 drivers.
73362306a36Sopenharmony_ci */
73462306a36Sopenharmony_cilong int video_ioctl2(struct file *file,
73562306a36Sopenharmony_ci		      unsigned int cmd, unsigned long int arg);
73662306a36Sopenharmony_ci
73762306a36Sopenharmony_ci/*
73862306a36Sopenharmony_ci * The user space interpretation of the 'v4l2_event' differs
73962306a36Sopenharmony_ci * based on the 'time_t' definition on 32-bit architectures, so
74062306a36Sopenharmony_ci * the kernel has to handle both.
74162306a36Sopenharmony_ci * This is the old version for 32-bit architectures.
74262306a36Sopenharmony_ci */
74362306a36Sopenharmony_cistruct v4l2_event_time32 {
74462306a36Sopenharmony_ci	__u32				type;
74562306a36Sopenharmony_ci	union {
74662306a36Sopenharmony_ci		struct v4l2_event_vsync		vsync;
74762306a36Sopenharmony_ci		struct v4l2_event_ctrl		ctrl;
74862306a36Sopenharmony_ci		struct v4l2_event_frame_sync	frame_sync;
74962306a36Sopenharmony_ci		struct v4l2_event_src_change	src_change;
75062306a36Sopenharmony_ci		struct v4l2_event_motion_det	motion_det;
75162306a36Sopenharmony_ci		__u8				data[64];
75262306a36Sopenharmony_ci	} u;
75362306a36Sopenharmony_ci	__u32				pending;
75462306a36Sopenharmony_ci	__u32				sequence;
75562306a36Sopenharmony_ci	struct old_timespec32		timestamp;
75662306a36Sopenharmony_ci	__u32				id;
75762306a36Sopenharmony_ci	__u32				reserved[8];
75862306a36Sopenharmony_ci};
75962306a36Sopenharmony_ci
76062306a36Sopenharmony_ci#define	VIDIOC_DQEVENT_TIME32	 _IOR('V', 89, struct v4l2_event_time32)
76162306a36Sopenharmony_ci
76262306a36Sopenharmony_cistruct v4l2_buffer_time32 {
76362306a36Sopenharmony_ci	__u32			index;
76462306a36Sopenharmony_ci	__u32			type;
76562306a36Sopenharmony_ci	__u32			bytesused;
76662306a36Sopenharmony_ci	__u32			flags;
76762306a36Sopenharmony_ci	__u32			field;
76862306a36Sopenharmony_ci	struct old_timeval32	timestamp;
76962306a36Sopenharmony_ci	struct v4l2_timecode	timecode;
77062306a36Sopenharmony_ci	__u32			sequence;
77162306a36Sopenharmony_ci
77262306a36Sopenharmony_ci	/* memory location */
77362306a36Sopenharmony_ci	__u32			memory;
77462306a36Sopenharmony_ci	union {
77562306a36Sopenharmony_ci		__u32           offset;
77662306a36Sopenharmony_ci		unsigned long   userptr;
77762306a36Sopenharmony_ci		struct v4l2_plane *planes;
77862306a36Sopenharmony_ci		__s32		fd;
77962306a36Sopenharmony_ci	} m;
78062306a36Sopenharmony_ci	__u32			length;
78162306a36Sopenharmony_ci	__u32			reserved2;
78262306a36Sopenharmony_ci	union {
78362306a36Sopenharmony_ci		__s32		request_fd;
78462306a36Sopenharmony_ci		__u32		reserved;
78562306a36Sopenharmony_ci	};
78662306a36Sopenharmony_ci};
78762306a36Sopenharmony_ci#define VIDIOC_QUERYBUF_TIME32	_IOWR('V',  9, struct v4l2_buffer_time32)
78862306a36Sopenharmony_ci#define VIDIOC_QBUF_TIME32	_IOWR('V', 15, struct v4l2_buffer_time32)
78962306a36Sopenharmony_ci#define VIDIOC_DQBUF_TIME32	_IOWR('V', 17, struct v4l2_buffer_time32)
79062306a36Sopenharmony_ci#define VIDIOC_PREPARE_BUF_TIME32 _IOWR('V', 93, struct v4l2_buffer_time32)
79162306a36Sopenharmony_ci
79262306a36Sopenharmony_ci#endif /* _V4L2_IOCTL_H */
793