License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 22:07:57 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2008-07-20 19:12:02 +08:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* V 4 L 2 D R I V E R H E L P E R A P I
|
|
|
|
*
|
|
|
|
* Moved from videodev2.h
|
|
|
|
*
|
|
|
|
* Some commonly needed functions for drivers (v4l2-common.o module)
|
|
|
|
*/
|
|
|
|
#ifndef _V4L2_IOCTL_H
|
|
|
|
#define _V4L2_IOCTL_H
|
|
|
|
|
|
|
|
#include <linux/poll.h>
|
|
|
|
#include <linux/fs.h>
|
|
|
|
#include <linux/mutex.h>
|
2017-02-03 02:15:33 +08:00
|
|
|
#include <linux/sched/signal.h>
|
2008-07-20 19:12:02 +08:00
|
|
|
#include <linux/compiler.h> /* need __user */
|
|
|
|
#include <linux/videodev2.h>
|
|
|
|
|
2010-03-27 22:02:10 +08:00
|
|
|
struct v4l2_fh;
|
|
|
|
|
2016-07-23 03:22:41 +08:00
|
|
|
/**
|
|
|
|
* struct v4l2_ioctl_ops - describe operations for each V4L2 ioctl
|
|
|
|
*
|
|
|
|
* @vidioc_querycap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_QUERYCAP <vidioc_querycap>` ioctl
|
|
|
|
* @vidioc_enum_fmt_vid_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
|
2019-06-04 15:06:25 +08:00
|
|
|
* for video capture in single and multi plane mode
|
2016-07-23 03:22:41 +08:00
|
|
|
* @vidioc_enum_fmt_vid_overlay: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
|
|
|
|
* for video overlay
|
|
|
|
* @vidioc_enum_fmt_vid_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
|
2019-06-04 15:06:25 +08:00
|
|
|
* for video output in single and multi plane mode
|
2016-07-23 03:22:41 +08:00
|
|
|
* @vidioc_enum_fmt_sdr_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
|
|
|
|
* for Software Defined Radio capture
|
|
|
|
* @vidioc_enum_fmt_sdr_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
|
|
|
|
* for Software Defined Radio output
|
2016-04-13 06:40:46 +08:00
|
|
|
* @vidioc_enum_fmt_meta_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
|
|
|
|
* for metadata capture
|
2017-06-16 20:38:31 +08:00
|
|
|
* @vidioc_enum_fmt_meta_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
|
|
|
|
* for metadata output
|
2016-07-23 03:22:41 +08:00
|
|
|
* @vidioc_g_fmt_vid_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video capture
|
|
|
|
* in single plane mode
|
|
|
|
* @vidioc_g_fmt_vid_overlay: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video overlay
|
|
|
|
* @vidioc_g_fmt_vid_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video out
|
|
|
|
* in single plane mode
|
|
|
|
* @vidioc_g_fmt_vid_out_overlay: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video overlay output
|
|
|
|
* @vidioc_g_fmt_vbi_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture
|
|
|
|
* @vidioc_g_fmt_vbi_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output
|
|
|
|
* @vidioc_g_fmt_sliced_vbi_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI capture
|
|
|
|
* @vidioc_g_fmt_sliced_vbi_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output
|
|
|
|
* @vidioc_g_fmt_vid_cap_mplane: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video capture
|
|
|
|
* in multiple plane mode
|
|
|
|
* @vidioc_g_fmt_vid_out_mplane: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video out
|
|
|
|
* in multiplane plane mode
|
|
|
|
* @vidioc_g_fmt_sdr_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
|
|
|
|
* Radio capture
|
|
|
|
* @vidioc_g_fmt_sdr_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
|
|
|
|
* Radio output
|
2016-04-13 06:40:46 +08:00
|
|
|
* @vidioc_g_fmt_meta_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for metadata capture
|
2017-06-16 20:38:31 +08:00
|
|
|
* @vidioc_g_fmt_meta_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for metadata output
|
2016-07-23 03:22:41 +08:00
|
|
|
* @vidioc_s_fmt_vid_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video capture
|
|
|
|
* in single plane mode
|
|
|
|
* @vidioc_s_fmt_vid_overlay: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video overlay
|
|
|
|
* @vidioc_s_fmt_vid_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video out
|
|
|
|
* in single plane mode
|
|
|
|
* @vidioc_s_fmt_vid_out_overlay: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video overlay output
|
|
|
|
* @vidioc_s_fmt_vbi_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture
|
|
|
|
* @vidioc_s_fmt_vbi_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output
|
|
|
|
* @vidioc_s_fmt_sliced_vbi_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI capture
|
|
|
|
* @vidioc_s_fmt_sliced_vbi_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output
|
|
|
|
* @vidioc_s_fmt_vid_cap_mplane: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video capture
|
|
|
|
* in multiple plane mode
|
|
|
|
* @vidioc_s_fmt_vid_out_mplane: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video out
|
|
|
|
* in multiplane plane mode
|
|
|
|
* @vidioc_s_fmt_sdr_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
|
|
|
|
* Radio capture
|
|
|
|
* @vidioc_s_fmt_sdr_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
|
|
|
|
* Radio output
|
2016-04-13 06:40:46 +08:00
|
|
|
* @vidioc_s_fmt_meta_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for metadata capture
|
2017-06-16 20:38:31 +08:00
|
|
|
* @vidioc_s_fmt_meta_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for metadata output
|
2016-07-23 03:22:41 +08:00
|
|
|
* @vidioc_try_fmt_vid_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video capture
|
|
|
|
* in single plane mode
|
|
|
|
* @vidioc_try_fmt_vid_overlay: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video overlay
|
|
|
|
* @vidioc_try_fmt_vid_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video out
|
|
|
|
* in single plane mode
|
|
|
|
* @vidioc_try_fmt_vid_out_overlay: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video overlay
|
|
|
|
* output
|
|
|
|
* @vidioc_try_fmt_vbi_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture
|
|
|
|
* @vidioc_try_fmt_vbi_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output
|
|
|
|
* @vidioc_try_fmt_sliced_vbi_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI
|
|
|
|
* capture
|
|
|
|
* @vidioc_try_fmt_sliced_vbi_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output
|
|
|
|
* @vidioc_try_fmt_vid_cap_mplane: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video capture
|
|
|
|
* in multiple plane mode
|
|
|
|
* @vidioc_try_fmt_vid_out_mplane: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video out
|
|
|
|
* in multiplane plane mode
|
|
|
|
* @vidioc_try_fmt_sdr_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
|
|
|
|
* Radio capture
|
|
|
|
* @vidioc_try_fmt_sdr_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
|
|
|
|
* Radio output
|
2016-04-13 06:40:46 +08:00
|
|
|
* @vidioc_try_fmt_meta_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for metadata capture
|
2017-06-16 20:38:31 +08:00
|
|
|
* @vidioc_try_fmt_meta_out: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for metadata output
|
2016-07-23 03:22:41 +08:00
|
|
|
* @vidioc_reqbufs: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_REQBUFS <vidioc_reqbufs>` ioctl
|
|
|
|
* @vidioc_querybuf: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_QUERYBUF <vidioc_querybuf>` ioctl
|
|
|
|
* @vidioc_qbuf: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_QBUF <vidioc_qbuf>` ioctl
|
|
|
|
* @vidioc_expbuf: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_EXPBUF <vidioc_expbuf>` ioctl
|
|
|
|
* @vidioc_dqbuf: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_DQBUF <vidioc_qbuf>` ioctl
|
|
|
|
* @vidioc_create_bufs: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_CREATE_BUFS <vidioc_create_bufs>` ioctl
|
|
|
|
* @vidioc_prepare_buf: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_PREPARE_BUF <vidioc_prepare_buf>` ioctl
|
2024-03-14 23:32:24 +08:00
|
|
|
* @vidioc_remove_bufs: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_REMOVE_BUFS <vidioc_remove_bufs>` ioctl
|
2016-07-23 03:22:41 +08:00
|
|
|
* @vidioc_overlay: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_OVERLAY <vidioc_overlay>` ioctl
|
|
|
|
* @vidioc_g_fbuf: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FBUF <vidioc_g_fbuf>` ioctl
|
|
|
|
* @vidioc_s_fbuf: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FBUF <vidioc_g_fbuf>` ioctl
|
|
|
|
* @vidioc_streamon: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_STREAMON <vidioc_streamon>` ioctl
|
|
|
|
* @vidioc_streamoff: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_STREAMOFF <vidioc_streamon>` ioctl
|
|
|
|
* @vidioc_g_std: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_STD <vidioc_g_std>` ioctl
|
|
|
|
* @vidioc_s_std: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_STD <vidioc_g_std>` ioctl
|
|
|
|
* @vidioc_querystd: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_QUERYSTD <vidioc_querystd>` ioctl
|
|
|
|
* @vidioc_enum_input: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUM_INPUT <vidioc_g_input>` ioctl
|
|
|
|
* @vidioc_g_input: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_INPUT <vidioc_g_input>` ioctl
|
|
|
|
* @vidioc_s_input: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_INPUT <vidioc_g_input>` ioctl
|
|
|
|
* @vidioc_enum_output: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUM_OUTPUT <vidioc_g_output>` ioctl
|
|
|
|
* @vidioc_g_output: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_OUTPUT <vidioc_g_output>` ioctl
|
|
|
|
* @vidioc_s_output: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_OUTPUT <vidioc_g_output>` ioctl
|
|
|
|
* @vidioc_queryctrl: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_QUERYCTRL <vidioc_queryctrl>` ioctl
|
|
|
|
* @vidioc_query_ext_ctrl: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_QUERY_EXT_CTRL <vidioc_queryctrl>` ioctl
|
|
|
|
* @vidioc_g_ctrl: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_CTRL <vidioc_g_ctrl>` ioctl
|
|
|
|
* @vidioc_s_ctrl: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_CTRL <vidioc_g_ctrl>` ioctl
|
|
|
|
* @vidioc_g_ext_ctrls: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl
|
|
|
|
* @vidioc_s_ext_ctrls: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl
|
|
|
|
* @vidioc_try_ext_ctrls: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl
|
|
|
|
* @vidioc_querymenu: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_QUERYMENU <vidioc_queryctrl>` ioctl
|
|
|
|
* @vidioc_enumaudio: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUMAUDIO <vidioc_enumaudio>` ioctl
|
|
|
|
* @vidioc_g_audio: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_AUDIO <vidioc_g_audio>` ioctl
|
|
|
|
* @vidioc_s_audio: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_AUDIO <vidioc_g_audio>` ioctl
|
|
|
|
* @vidioc_enumaudout: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUMAUDOUT <vidioc_enumaudout>` ioctl
|
|
|
|
* @vidioc_g_audout: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_AUDOUT <vidioc_g_audout>` ioctl
|
|
|
|
* @vidioc_s_audout: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_AUDOUT <vidioc_g_audout>` ioctl
|
|
|
|
* @vidioc_g_modulator: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_MODULATOR <vidioc_g_modulator>` ioctl
|
|
|
|
* @vidioc_s_modulator: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_MODULATOR <vidioc_g_modulator>` ioctl
|
2018-10-05 05:38:15 +08:00
|
|
|
* @vidioc_g_pixelaspect: pointer to the function that implements
|
|
|
|
* the pixelaspect part of the :ref:`VIDIOC_CROPCAP <vidioc_cropcap>` ioctl
|
2016-07-23 03:22:41 +08:00
|
|
|
* @vidioc_g_selection: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_SELECTION <vidioc_g_selection>` ioctl
|
|
|
|
* @vidioc_s_selection: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_SELECTION <vidioc_g_selection>` ioctl
|
|
|
|
* @vidioc_g_jpegcomp: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_JPEGCOMP <vidioc_g_jpegcomp>` ioctl
|
|
|
|
* @vidioc_s_jpegcomp: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_JPEGCOMP <vidioc_g_jpegcomp>` ioctl
|
|
|
|
* @vidioc_g_enc_index: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_ENC_INDEX <vidioc_g_enc_index>` ioctl
|
|
|
|
* @vidioc_encoder_cmd: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENCODER_CMD <vidioc_encoder_cmd>` ioctl
|
|
|
|
* @vidioc_try_encoder_cmd: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_ENCODER_CMD <vidioc_encoder_cmd>` ioctl
|
|
|
|
* @vidioc_decoder_cmd: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_DECODER_CMD <vidioc_decoder_cmd>` ioctl
|
|
|
|
* @vidioc_try_decoder_cmd: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_TRY_DECODER_CMD <vidioc_decoder_cmd>` ioctl
|
|
|
|
* @vidioc_g_parm: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_PARM <vidioc_g_parm>` ioctl
|
|
|
|
* @vidioc_s_parm: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_PARM <vidioc_g_parm>` ioctl
|
|
|
|
* @vidioc_g_tuner: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_TUNER <vidioc_g_tuner>` ioctl
|
|
|
|
* @vidioc_s_tuner: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_TUNER <vidioc_g_tuner>` ioctl
|
|
|
|
* @vidioc_g_frequency: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_FREQUENCY <vidioc_g_frequency>` ioctl
|
|
|
|
* @vidioc_s_frequency: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_FREQUENCY <vidioc_g_frequency>` ioctl
|
|
|
|
* @vidioc_enum_freq_bands: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUM_FREQ_BANDS <vidioc_enum_freq_bands>` ioctl
|
|
|
|
* @vidioc_g_sliced_vbi_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_SLICED_VBI_CAP <vidioc_g_sliced_vbi_cap>` ioctl
|
|
|
|
* @vidioc_log_status: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_LOG_STATUS <vidioc_log_status>` ioctl
|
|
|
|
* @vidioc_s_hw_freq_seek: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_HW_FREQ_SEEK <vidioc_s_hw_freq_seek>` ioctl
|
|
|
|
* @vidioc_g_register: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_DBG_G_REGISTER <vidioc_dbg_g_register>` ioctl
|
|
|
|
* @vidioc_s_register: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_DBG_S_REGISTER <vidioc_dbg_g_register>` ioctl
|
|
|
|
* @vidioc_g_chip_info: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_DBG_G_CHIP_INFO <vidioc_dbg_g_chip_info>` ioctl
|
|
|
|
* @vidioc_enum_framesizes: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUM_FRAMESIZES <vidioc_enum_framesizes>` ioctl
|
|
|
|
* @vidioc_enum_frameintervals: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUM_FRAMEINTERVALS <vidioc_enum_frameintervals>` ioctl
|
|
|
|
* @vidioc_s_dv_timings: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_DV_TIMINGS <vidioc_g_dv_timings>` ioctl
|
|
|
|
* @vidioc_g_dv_timings: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_DV_TIMINGS <vidioc_g_dv_timings>` ioctl
|
|
|
|
* @vidioc_query_dv_timings: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_QUERY_DV_TIMINGS <vidioc_query_dv_timings>` ioctl
|
|
|
|
* @vidioc_enum_dv_timings: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_ENUM_DV_TIMINGS <vidioc_enum_dv_timings>` ioctl
|
|
|
|
* @vidioc_dv_timings_cap: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_DV_TIMINGS_CAP <vidioc_dv_timings_cap>` ioctl
|
|
|
|
* @vidioc_g_edid: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_G_EDID <vidioc_g_edid>` ioctl
|
|
|
|
* @vidioc_s_edid: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_S_EDID <vidioc_g_edid>` ioctl
|
|
|
|
* @vidioc_subscribe_event: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_SUBSCRIBE_EVENT <vidioc_subscribe_event>` ioctl
|
|
|
|
* @vidioc_unsubscribe_event: pointer to the function that implements
|
|
|
|
* :ref:`VIDIOC_UNSUBSCRIBE_EVENT <vidioc_unsubscribe_event>` ioctl
|
|
|
|
* @vidioc_default: pointed used to allow other ioctls
|
|
|
|
*/
|
2008-07-21 13:57:38 +08:00
|
|
|
struct v4l2_ioctl_ops {
|
|
|
|
/* ioctl callbacks */
|
|
|
|
|
|
|
|
/* VIDIOC_QUERYCAP handler */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_querycap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_capability *cap);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* VIDIOC_ENUM_FMT handlers */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_enum_fmt_vid_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_fmtdesc *f);
|
|
|
|
int (*vidioc_enum_fmt_vid_overlay)(struct file *file, void *fh,
|
|
|
|
struct v4l2_fmtdesc *f);
|
|
|
|
int (*vidioc_enum_fmt_vid_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_fmtdesc *f);
|
|
|
|
int (*vidioc_enum_fmt_sdr_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_fmtdesc *f);
|
|
|
|
int (*vidioc_enum_fmt_sdr_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_fmtdesc *f);
|
2016-04-13 06:40:46 +08:00
|
|
|
int (*vidioc_enum_fmt_meta_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_fmtdesc *f);
|
2017-06-16 20:38:31 +08:00
|
|
|
int (*vidioc_enum_fmt_meta_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_fmtdesc *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* VIDIOC_G_FMT handlers */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_g_fmt_vid_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_g_fmt_vid_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *fh,
|
2016-08-30 23:18:09 +08:00
|
|
|
struct v4l2_format *f);
|
|
|
|
int (*vidioc_g_fmt_vbi_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
|
|
|
int (*vidioc_g_fmt_vbi_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *fh,
|
2016-08-30 23:18:09 +08:00
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *fh,
|
2016-08-30 23:18:09 +08:00
|
|
|
struct v4l2_format *f);
|
2010-12-23 15:15:27 +08:00
|
|
|
int (*vidioc_g_fmt_vid_cap_mplane)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
|
|
|
int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_g_fmt_sdr_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
|
|
|
int (*vidioc_g_fmt_sdr_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2016-04-13 06:40:46 +08:00
|
|
|
int (*vidioc_g_fmt_meta_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2017-06-16 20:38:31 +08:00
|
|
|
int (*vidioc_g_fmt_meta_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* VIDIOC_S_FMT handlers */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_s_fmt_vid_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
int (*vidioc_s_fmt_vid_overlay)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_s_fmt_vid_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
int (*vidioc_s_fmt_vid_out_overlay)(struct file *file, void *fh,
|
2016-08-30 23:18:09 +08:00
|
|
|
struct v4l2_format *f);
|
|
|
|
int (*vidioc_s_fmt_vbi_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
|
|
|
int (*vidioc_s_fmt_vbi_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *file, void *fh,
|
2016-08-30 23:18:09 +08:00
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
int (*vidioc_s_fmt_sliced_vbi_out)(struct file *file, void *fh,
|
2016-08-30 23:18:09 +08:00
|
|
|
struct v4l2_format *f);
|
2010-12-23 15:15:27 +08:00
|
|
|
int (*vidioc_s_fmt_vid_cap_mplane)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
|
|
|
int (*vidioc_s_fmt_vid_out_mplane)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_s_fmt_sdr_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
|
|
|
int (*vidioc_s_fmt_sdr_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2016-04-13 06:40:46 +08:00
|
|
|
int (*vidioc_s_fmt_meta_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2017-06-16 20:38:31 +08:00
|
|
|
int (*vidioc_s_fmt_meta_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* VIDIOC_TRY_FMT handlers */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_try_fmt_vid_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
int (*vidioc_try_fmt_vid_overlay)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_try_fmt_vid_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
int (*vidioc_try_fmt_vid_out_overlay)(struct file *file, void *fh,
|
2016-08-30 23:18:09 +08:00
|
|
|
struct v4l2_format *f);
|
|
|
|
int (*vidioc_try_fmt_vbi_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
|
|
|
int (*vidioc_try_fmt_vbi_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *file, void *fh,
|
2016-08-30 23:18:09 +08:00
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
int (*vidioc_try_fmt_sliced_vbi_out)(struct file *file, void *fh,
|
2016-08-30 23:18:09 +08:00
|
|
|
struct v4l2_format *f);
|
2010-12-23 15:15:27 +08:00
|
|
|
int (*vidioc_try_fmt_vid_cap_mplane)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
|
|
|
int (*vidioc_try_fmt_vid_out_mplane)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_try_fmt_sdr_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
|
|
|
int (*vidioc_try_fmt_sdr_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2016-04-13 06:40:46 +08:00
|
|
|
int (*vidioc_try_fmt_meta_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2017-06-16 20:38:31 +08:00
|
|
|
int (*vidioc_try_fmt_meta_out)(struct file *file, void *fh,
|
|
|
|
struct v4l2_format *f);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* Buffer handlers */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_reqbufs)(struct file *file, void *fh,
|
|
|
|
struct v4l2_requestbuffers *b);
|
|
|
|
int (*vidioc_querybuf)(struct file *file, void *fh,
|
|
|
|
struct v4l2_buffer *b);
|
|
|
|
int (*vidioc_qbuf)(struct file *file, void *fh,
|
|
|
|
struct v4l2_buffer *b);
|
|
|
|
int (*vidioc_expbuf)(struct file *file, void *fh,
|
|
|
|
struct v4l2_exportbuffer *e);
|
|
|
|
int (*vidioc_dqbuf)(struct file *file, void *fh,
|
|
|
|
struct v4l2_buffer *b);
|
|
|
|
|
|
|
|
int (*vidioc_create_bufs)(struct file *file, void *fh,
|
|
|
|
struct v4l2_create_buffers *b);
|
|
|
|
int (*vidioc_prepare_buf)(struct file *file, void *fh,
|
|
|
|
struct v4l2_buffer *b);
|
2024-03-14 23:32:24 +08:00
|
|
|
int (*vidioc_remove_bufs)(struct file *file, void *fh,
|
|
|
|
struct v4l2_remove_buffers *d);
|
2016-08-30 23:18:09 +08:00
|
|
|
|
|
|
|
int (*vidioc_overlay)(struct file *file, void *fh, unsigned int i);
|
|
|
|
int (*vidioc_g_fbuf)(struct file *file, void *fh,
|
|
|
|
struct v4l2_framebuffer *a);
|
|
|
|
int (*vidioc_s_fbuf)(struct file *file, void *fh,
|
|
|
|
const struct v4l2_framebuffer *a);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* Stream on/off */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_streamon)(struct file *file, void *fh,
|
|
|
|
enum v4l2_buf_type i);
|
|
|
|
int (*vidioc_streamoff)(struct file *file, void *fh,
|
|
|
|
enum v4l2_buf_type i);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Standard handling
|
|
|
|
*
|
|
|
|
* Note: ENUMSTD is handled by videodev.c
|
2008-07-21 13:57:38 +08:00
|
|
|
*/
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_g_std)(struct file *file, void *fh, v4l2_std_id *norm);
|
|
|
|
int (*vidioc_s_std)(struct file *file, void *fh, v4l2_std_id norm);
|
|
|
|
int (*vidioc_querystd)(struct file *file, void *fh, v4l2_std_id *a);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* Input handling */
|
|
|
|
int (*vidioc_enum_input)(struct file *file, void *fh,
|
|
|
|
struct v4l2_input *inp);
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_g_input)(struct file *file, void *fh, unsigned int *i);
|
|
|
|
int (*vidioc_s_input)(struct file *file, void *fh, unsigned int i);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* Output handling */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_enum_output)(struct file *file, void *fh,
|
2008-07-21 13:57:38 +08:00
|
|
|
struct v4l2_output *a);
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_g_output)(struct file *file, void *fh, unsigned int *i);
|
|
|
|
int (*vidioc_s_output)(struct file *file, void *fh, unsigned int i);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* Control handling */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_queryctrl)(struct file *file, void *fh,
|
|
|
|
struct v4l2_queryctrl *a);
|
|
|
|
int (*vidioc_query_ext_ctrl)(struct file *file, void *fh,
|
|
|
|
struct v4l2_query_ext_ctrl *a);
|
|
|
|
int (*vidioc_g_ctrl)(struct file *file, void *fh,
|
|
|
|
struct v4l2_control *a);
|
|
|
|
int (*vidioc_s_ctrl)(struct file *file, void *fh,
|
|
|
|
struct v4l2_control *a);
|
|
|
|
int (*vidioc_g_ext_ctrls)(struct file *file, void *fh,
|
|
|
|
struct v4l2_ext_controls *a);
|
|
|
|
int (*vidioc_s_ext_ctrls)(struct file *file, void *fh,
|
|
|
|
struct v4l2_ext_controls *a);
|
|
|
|
int (*vidioc_try_ext_ctrls)(struct file *file, void *fh,
|
|
|
|
struct v4l2_ext_controls *a);
|
|
|
|
int (*vidioc_querymenu)(struct file *file, void *fh,
|
|
|
|
struct v4l2_querymenu *a);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* Audio ioctls */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_enumaudio)(struct file *file, void *fh,
|
|
|
|
struct v4l2_audio *a);
|
|
|
|
int (*vidioc_g_audio)(struct file *file, void *fh,
|
|
|
|
struct v4l2_audio *a);
|
|
|
|
int (*vidioc_s_audio)(struct file *file, void *fh,
|
|
|
|
const struct v4l2_audio *a);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* Audio out ioctls */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_enumaudout)(struct file *file, void *fh,
|
|
|
|
struct v4l2_audioout *a);
|
|
|
|
int (*vidioc_g_audout)(struct file *file, void *fh,
|
|
|
|
struct v4l2_audioout *a);
|
|
|
|
int (*vidioc_s_audout)(struct file *file, void *fh,
|
|
|
|
const struct v4l2_audioout *a);
|
|
|
|
int (*vidioc_g_modulator)(struct file *file, void *fh,
|
|
|
|
struct v4l2_modulator *a);
|
|
|
|
int (*vidioc_s_modulator)(struct file *file, void *fh,
|
|
|
|
const struct v4l2_modulator *a);
|
2008-07-21 13:57:38 +08:00
|
|
|
/* Crop ioctls */
|
2018-10-05 05:38:15 +08:00
|
|
|
int (*vidioc_g_pixelaspect)(struct file *file, void *fh,
|
|
|
|
int buf_type, struct v4l2_fract *aspect);
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_g_selection)(struct file *file, void *fh,
|
|
|
|
struct v4l2_selection *s);
|
|
|
|
int (*vidioc_s_selection)(struct file *file, void *fh,
|
|
|
|
struct v4l2_selection *s);
|
2008-07-21 13:57:38 +08:00
|
|
|
/* Compression ioctls */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_g_jpegcomp)(struct file *file, void *fh,
|
|
|
|
struct v4l2_jpegcompression *a);
|
|
|
|
int (*vidioc_s_jpegcomp)(struct file *file, void *fh,
|
|
|
|
const struct v4l2_jpegcompression *a);
|
|
|
|
int (*vidioc_g_enc_index)(struct file *file, void *fh,
|
|
|
|
struct v4l2_enc_idx *a);
|
|
|
|
int (*vidioc_encoder_cmd)(struct file *file, void *fh,
|
|
|
|
struct v4l2_encoder_cmd *a);
|
|
|
|
int (*vidioc_try_encoder_cmd)(struct file *file, void *fh,
|
|
|
|
struct v4l2_encoder_cmd *a);
|
|
|
|
int (*vidioc_decoder_cmd)(struct file *file, void *fh,
|
|
|
|
struct v4l2_decoder_cmd *a);
|
|
|
|
int (*vidioc_try_decoder_cmd)(struct file *file, void *fh,
|
|
|
|
struct v4l2_decoder_cmd *a);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* Stream type-dependent parameter ioctls */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_g_parm)(struct file *file, void *fh,
|
|
|
|
struct v4l2_streamparm *a);
|
|
|
|
int (*vidioc_s_parm)(struct file *file, void *fh,
|
|
|
|
struct v4l2_streamparm *a);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* Tuner ioctls */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_g_tuner)(struct file *file, void *fh,
|
|
|
|
struct v4l2_tuner *a);
|
|
|
|
int (*vidioc_s_tuner)(struct file *file, void *fh,
|
|
|
|
const struct v4l2_tuner *a);
|
|
|
|
int (*vidioc_g_frequency)(struct file *file, void *fh,
|
|
|
|
struct v4l2_frequency *a);
|
|
|
|
int (*vidioc_s_frequency)(struct file *file, void *fh,
|
|
|
|
const struct v4l2_frequency *a);
|
|
|
|
int (*vidioc_enum_freq_bands)(struct file *file, void *fh,
|
|
|
|
struct v4l2_frequency_band *band);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* Sliced VBI cap */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_g_sliced_vbi_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_sliced_vbi_cap *a);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* Log status ioctl */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_log_status)(struct file *file, void *fh);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_s_hw_freq_seek)(struct file *file, void *fh,
|
|
|
|
const struct v4l2_hw_freq_seek *a);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
|
|
|
/* Debugging ioctls */
|
|
|
|
#ifdef CONFIG_VIDEO_ADV_DEBUG
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_g_register)(struct file *file, void *fh,
|
|
|
|
struct v4l2_dbg_register *reg);
|
|
|
|
int (*vidioc_s_register)(struct file *file, void *fh,
|
|
|
|
const struct v4l2_dbg_register *reg);
|
2008-07-21 13:57:38 +08:00
|
|
|
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_g_chip_info)(struct file *file, void *fh,
|
|
|
|
struct v4l2_dbg_chip_info *chip);
|
2013-03-27 19:04:23 +08:00
|
|
|
#endif
|
2013-03-18 23:16:34 +08:00
|
|
|
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_enum_framesizes)(struct file *file, void *fh,
|
|
|
|
struct v4l2_frmsizeenum *fsize);
|
2008-11-12 08:13:47 +08:00
|
|
|
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_enum_frameintervals)(struct file *file, void *fh,
|
|
|
|
struct v4l2_frmivalenum *fival);
|
2008-11-12 08:13:47 +08:00
|
|
|
|
2009-11-19 23:00:31 +08:00
|
|
|
/* DV Timings IOCTLs */
|
2016-08-30 23:18:09 +08:00
|
|
|
int (*vidioc_s_dv_timings)(struct file *file, void *fh,
|
|
|
|
struct v4l2_dv_timings *timings);
|
|
|
|
int (*vidioc_g_dv_timings)(struct file *file, void *fh,
|
|
|
|
struct v4l2_dv_timings *timings);
|
|
|
|
int (*vidioc_query_dv_timings)(struct file *file, void *fh,
|
|
|
|
struct v4l2_dv_timings *timings);
|
|
|
|
int (*vidioc_enum_dv_timings)(struct file *file, void *fh,
|
|
|
|
struct v4l2_enum_dv_timings *timings);
|
|
|
|
int (*vidioc_dv_timings_cap)(struct file *file, void *fh,
|
|
|
|
struct v4l2_dv_timings_cap *cap);
|
|
|
|
int (*vidioc_g_edid)(struct file *file, void *fh,
|
|
|
|
struct v4l2_edid *edid);
|
|
|
|
int (*vidioc_s_edid)(struct file *file, void *fh,
|
|
|
|
struct v4l2_edid *edid);
|
|
|
|
|
|
|
|
int (*vidioc_subscribe_event)(struct v4l2_fh *fh,
|
|
|
|
const struct v4l2_event_subscription *sub);
|
2010-03-27 22:02:10 +08:00
|
|
|
int (*vidioc_unsubscribe_event)(struct v4l2_fh *fh,
|
2012-09-04 22:46:09 +08:00
|
|
|
const struct v4l2_event_subscription *sub);
|
2010-03-27 22:02:10 +08:00
|
|
|
|
2008-07-21 13:57:38 +08:00
|
|
|
/* For other private ioctls */
|
2016-08-30 23:18:09 +08:00
|
|
|
long (*vidioc_default)(struct file *file, void *fh,
|
|
|
|
bool valid_prio, unsigned int cmd, void *arg);
|
2008-07-21 13:57:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-07-21 07:26:54 +08:00
|
|
|
/* v4l debugging and diagnostics */
|
|
|
|
|
2014-12-01 21:10:44 +08:00
|
|
|
/* Device debug flags to be used with the video device debug attribute */
|
|
|
|
|
|
|
|
/* Just log the ioctl name + error code */
|
|
|
|
#define V4L2_DEV_DEBUG_IOCTL 0x01
|
|
|
|
/* Log the ioctl name arguments + error code */
|
|
|
|
#define V4L2_DEV_DEBUG_IOCTL_ARG 0x02
|
|
|
|
/* Log the file operations open, release, mmap and get_unmapped_area */
|
|
|
|
#define V4L2_DEV_DEBUG_FOP 0x04
|
|
|
|
/* Log the read and write file operations and the VIDIOC_(D)QBUF ioctls */
|
|
|
|
#define V4L2_DEV_DEBUG_STREAMING 0x08
|
|
|
|
/* Log poll() */
|
|
|
|
#define V4L2_DEV_DEBUG_POLL 0x10
|
2019-07-20 19:47:07 +08:00
|
|
|
/* Log controls */
|
|
|
|
#define V4L2_DEV_DEBUG_CTRL 0x20
|
2008-07-21 07:26:54 +08:00
|
|
|
|
2008-07-20 19:12:02 +08:00
|
|
|
/* Video standard functions */
|
2016-08-30 23:18:09 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* v4l2_norm_to_name - Ancillary routine to analog TV standard name from its ID.
|
|
|
|
*
|
|
|
|
* @id: analog TV standard ID.
|
|
|
|
*
|
|
|
|
* Return: returns a string with the name of the analog TV standard.
|
|
|
|
* If the standard is not found or if @id points to multiple standard,
|
|
|
|
* it returns "Unknown".
|
|
|
|
*/
|
|
|
|
const char *v4l2_norm_to_name(v4l2_std_id id);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* v4l2_video_std_frame_period - Ancillary routine that fills a
|
|
|
|
* struct &v4l2_fract pointer with the default framerate fraction.
|
|
|
|
*
|
2018-05-17 22:30:15 +08:00
|
|
|
* @id: analog TV standard ID.
|
2016-08-30 23:18:09 +08:00
|
|
|
* @frameperiod: struct &v4l2_fract pointer to be filled
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void v4l2_video_std_frame_period(int id, struct v4l2_fract *frameperiod);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* v4l2_video_std_construct - Ancillary routine that fills in the fields of
|
|
|
|
* a &v4l2_standard structure according to the @id parameter.
|
|
|
|
*
|
|
|
|
* @vs: struct &v4l2_standard pointer to be filled
|
2018-05-17 22:30:15 +08:00
|
|
|
* @id: analog TV standard ID.
|
2016-08-30 23:18:09 +08:00
|
|
|
* @name: name of the standard to be used
|
|
|
|
*
|
|
|
|
* .. note::
|
|
|
|
*
|
|
|
|
* This ancillary routine is obsolete. Shouldn't be used on newer drivers.
|
|
|
|
*/
|
|
|
|
int v4l2_video_std_construct(struct v4l2_standard *vs,
|
2008-07-20 19:12:02 +08:00
|
|
|
int id, const char *name);
|
|
|
|
|
2018-05-17 22:30:15 +08:00
|
|
|
/**
|
|
|
|
* v4l_video_std_enumstd - Ancillary routine that fills in the fields of
|
|
|
|
* a &v4l2_standard structure according to the @id and @vs->index
|
|
|
|
* parameters.
|
|
|
|
*
|
|
|
|
* @vs: struct &v4l2_standard pointer to be filled.
|
|
|
|
* @id: analog TV standard ID.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
int v4l_video_std_enumstd(struct v4l2_standard *vs, v4l2_std_id id);
|
|
|
|
|
2016-08-30 23:18:09 +08:00
|
|
|
/**
|
|
|
|
* v4l_printk_ioctl - Ancillary routine that prints the ioctl in a
|
|
|
|
* human-readable format.
|
|
|
|
*
|
|
|
|
* @prefix: prefix to be added at the ioctl prints.
|
|
|
|
* @cmd: ioctl name
|
|
|
|
*
|
|
|
|
* .. note::
|
|
|
|
*
|
|
|
|
* If prefix != %NULL, then it will issue a
|
|
|
|
* ``printk(KERN_DEBUG "%s: ", prefix)`` first.
|
|
|
|
*/
|
|
|
|
void v4l_printk_ioctl(const char *prefix, unsigned int cmd);
|
|
|
|
|
2012-06-22 18:29:35 +08:00
|
|
|
struct video_device;
|
2016-08-30 23:18:09 +08:00
|
|
|
|
2008-07-20 19:12:02 +08:00
|
|
|
/* names for fancy debug output */
|
|
|
|
extern const char *v4l2_field_names[];
|
|
|
|
extern const char *v4l2_type_names[];
|
|
|
|
|
2008-12-30 17:58:20 +08:00
|
|
|
#ifdef CONFIG_COMPAT
|
2016-08-30 23:18:09 +08:00
|
|
|
/**
|
|
|
|
* v4l2_compat_ioctl32 -32 Bits compatibility layer for 64 bits processors
|
|
|
|
*
|
|
|
|
* @file: Pointer to struct &file.
|
|
|
|
* @cmd: Ioctl name.
|
|
|
|
* @arg: Ioctl argument.
|
|
|
|
*/
|
|
|
|
long int v4l2_compat_ioctl32(struct file *file, unsigned int cmd,
|
|
|
|
unsigned long arg);
|
2008-12-30 17:58:20 +08:00
|
|
|
#endif
|
2008-07-20 19:12:02 +08:00
|
|
|
|
2020-10-31 00:55:22 +08:00
|
|
|
unsigned int v4l2_compat_translate_cmd(unsigned int cmd);
|
|
|
|
int v4l2_compat_get_user(void __user *arg, void *parg, unsigned int cmd);
|
|
|
|
int v4l2_compat_put_user(void __user *arg, void *parg, unsigned int cmd);
|
|
|
|
int v4l2_compat_get_array_args(struct file *file, void *mbuf,
|
|
|
|
void __user *user_ptr, size_t array_size,
|
|
|
|
unsigned int cmd, void *arg);
|
|
|
|
int v4l2_compat_put_array_args(struct file *file, void __user *user_ptr,
|
|
|
|
void *mbuf, size_t array_size,
|
|
|
|
unsigned int cmd, void *arg);
|
|
|
|
|
2016-08-30 23:18:09 +08:00
|
|
|
/**
|
|
|
|
* typedef v4l2_kioctl - Typedef used to pass an ioctl handler.
|
|
|
|
*
|
|
|
|
* @file: Pointer to struct &file.
|
|
|
|
* @cmd: Ioctl name.
|
|
|
|
* @arg: Ioctl argument.
|
|
|
|
*/
|
|
|
|
typedef long (*v4l2_kioctl)(struct file *file, unsigned int cmd, void *arg);
|
2010-12-24 21:33:19 +08:00
|
|
|
|
2016-08-30 23:18:09 +08:00
|
|
|
/**
|
|
|
|
* video_usercopy - copies data from/to userspace memory when an ioctl is
|
|
|
|
* issued.
|
|
|
|
*
|
|
|
|
* @file: Pointer to struct &file.
|
|
|
|
* @cmd: Ioctl name.
|
|
|
|
* @arg: Ioctl argument.
|
|
|
|
* @func: function that will handle the ioctl
|
|
|
|
*
|
|
|
|
* .. note::
|
|
|
|
*
|
|
|
|
* This routine should be used only inside the V4L2 core.
|
|
|
|
*/
|
|
|
|
long int video_usercopy(struct file *file, unsigned int cmd,
|
|
|
|
unsigned long int arg, v4l2_kioctl func);
|
2008-07-20 19:12:02 +08:00
|
|
|
|
2016-08-30 23:18:09 +08:00
|
|
|
/**
|
|
|
|
* video_ioctl2 - Handles a V4L2 ioctl.
|
|
|
|
*
|
|
|
|
* @file: Pointer to struct &file.
|
|
|
|
* @cmd: Ioctl name.
|
|
|
|
* @arg: Ioctl argument.
|
|
|
|
*
|
|
|
|
* Method used to hancle an ioctl. Should be used to fill the
|
|
|
|
* &v4l2_ioctl_ops.unlocked_ioctl on all V4L2 drivers.
|
|
|
|
*/
|
|
|
|
long int video_ioctl2(struct file *file,
|
|
|
|
unsigned int cmd, unsigned long int arg);
|
2008-10-21 22:58:39 +08:00
|
|
|
|
2019-12-16 22:15:03 +08:00
|
|
|
/*
|
|
|
|
* The user space interpretation of the 'v4l2_event' differs
|
|
|
|
* based on the 'time_t' definition on 32-bit architectures, so
|
|
|
|
* the kernel has to handle both.
|
|
|
|
* This is the old version for 32-bit architectures.
|
|
|
|
*/
|
|
|
|
struct v4l2_event_time32 {
|
|
|
|
__u32 type;
|
|
|
|
union {
|
|
|
|
struct v4l2_event_vsync vsync;
|
|
|
|
struct v4l2_event_ctrl ctrl;
|
|
|
|
struct v4l2_event_frame_sync frame_sync;
|
|
|
|
struct v4l2_event_src_change src_change;
|
|
|
|
struct v4l2_event_motion_det motion_det;
|
|
|
|
__u8 data[64];
|
|
|
|
} u;
|
|
|
|
__u32 pending;
|
|
|
|
__u32 sequence;
|
|
|
|
struct old_timespec32 timestamp;
|
|
|
|
__u32 id;
|
|
|
|
__u32 reserved[8];
|
|
|
|
};
|
|
|
|
|
|
|
|
#define VIDIOC_DQEVENT_TIME32 _IOR('V', 89, struct v4l2_event_time32)
|
|
|
|
|
2019-12-16 22:15:04 +08:00
|
|
|
struct v4l2_buffer_time32 {
|
|
|
|
__u32 index;
|
|
|
|
__u32 type;
|
|
|
|
__u32 bytesused;
|
|
|
|
__u32 flags;
|
|
|
|
__u32 field;
|
|
|
|
struct old_timeval32 timestamp;
|
|
|
|
struct v4l2_timecode timecode;
|
|
|
|
__u32 sequence;
|
|
|
|
|
|
|
|
/* memory location */
|
|
|
|
__u32 memory;
|
|
|
|
union {
|
|
|
|
__u32 offset;
|
|
|
|
unsigned long userptr;
|
|
|
|
struct v4l2_plane *planes;
|
|
|
|
__s32 fd;
|
|
|
|
} m;
|
|
|
|
__u32 length;
|
|
|
|
__u32 reserved2;
|
|
|
|
union {
|
|
|
|
__s32 request_fd;
|
|
|
|
__u32 reserved;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
#define VIDIOC_QUERYBUF_TIME32 _IOWR('V', 9, struct v4l2_buffer_time32)
|
|
|
|
#define VIDIOC_QBUF_TIME32 _IOWR('V', 15, struct v4l2_buffer_time32)
|
|
|
|
#define VIDIOC_DQBUF_TIME32 _IOWR('V', 17, struct v4l2_buffer_time32)
|
|
|
|
#define VIDIOC_PREPARE_BUF_TIME32 _IOWR('V', 93, struct v4l2_buffer_time32)
|
|
|
|
|
2008-07-20 19:12:02 +08:00
|
|
|
#endif /* _V4L2_IOCTL_H */
|