Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) .. c:namespace:: V4L
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) .. _func-ioctl:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) ************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) V4L2 ioctl()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) ************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) ====
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) v4l2-ioctl - Program a V4L2 device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Synopsis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) .. code-block:: c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)     #include <sys/ioctl.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) ``int ioctl(int fd, int request, void *argp)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) Arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) ``fd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)     File descriptor returned by :c:func:`open()`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) ``request``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)     V4L2 ioctl request code as defined in the ``videodev2.h`` header
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)     file, for example VIDIOC_QUERYCAP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) ``argp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)     Pointer to a function parameter, usually a structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) ===========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) The :ref:`ioctl() <func-ioctl>` function is used to program V4L2 devices. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) argument ``fd`` must be an open file descriptor. An ioctl ``request``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) has encoded in it whether the argument is an input, output or read/write
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) parameter, and the size of the argument ``argp`` in bytes. Macros and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) defines specifying V4L2 ioctl requests are located in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) ``videodev2.h`` header file. Applications should use their own copy, not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) include the version in the kernel sources on the system they compile on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) All V4L2 ioctl requests, their respective function and parameters are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) specified in :ref:`user-func`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) Return Value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) On success 0 is returned, on error -1 and the ``errno`` variable is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) appropriately. The generic error codes are described at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) :ref:`Generic Error Codes <gen-errors>` chapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) When an ioctl that takes an output or read/write parameter fails, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) parameter remains unmodified.