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) .. _VIDIOC_DBG_G_CHIP_INFO:
^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) ioctl VIDIOC_DBG_G_CHIP_INFO
^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) VIDIOC_DBG_G_CHIP_INFO - Identify the chips on a TV card
^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) .. c:macro:: VIDIOC_DBG_G_CHIP_INFO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) ``int ioctl(int fd, VIDIOC_DBG_G_CHIP_INFO, struct v4l2_dbg_chip_info *argp)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) Arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) ``fd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)     File descriptor returned by :c:func:`open()`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) ``argp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)     Pointer to struct :c:type:`v4l2_dbg_chip_info`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) ===========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) .. note::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)     This is an :ref:`experimental` interface and may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)     change in the future.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) For driver debugging purposes this ioctl allows test applications to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) query the driver about the chips present on the TV card. Regular
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) applications must not use it. When you found a chip specific bug, please
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) contact the linux-media mailing list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) (`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) so it can be fixed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) Additionally the Linux kernel must be compiled with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) ``CONFIG_VIDEO_ADV_DEBUG`` option to enable this ioctl.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) To query the driver applications must initialize the ``match.type`` and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) ``match.addr`` or ``match.name`` fields of a struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) :c:type:`v4l2_dbg_chip_info` and call
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) :ref:`VIDIOC_DBG_G_CHIP_INFO` with a pointer to this structure. On success
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) the driver stores information about the selected chip in the ``name``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) and ``flags`` fields.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) When ``match.type`` is ``V4L2_CHIP_MATCH_BRIDGE``, ``match.addr``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) selects the nth bridge 'chip' on the TV card. You can enumerate all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) chips by starting at zero and incrementing ``match.addr`` by one until
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) :ref:`VIDIOC_DBG_G_CHIP_INFO` fails with an ``EINVAL`` error code. The number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) zero always selects the bridge chip itself, e. g. the chip connected to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) the PCI or USB bus. Non-zero numbers identify specific parts of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) bridge chip such as an AC97 register block.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) When ``match.type`` is ``V4L2_CHIP_MATCH_SUBDEV``, ``match.addr``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) selects the nth sub-device. This allows you to enumerate over all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) sub-devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) On success, the ``name`` field will contain a chip name and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) ``flags`` field will contain ``V4L2_CHIP_FL_READABLE`` if the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) supports reading registers from the device or ``V4L2_CHIP_FL_WRITABLE``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) if the driver supports writing registers to the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) We recommended the v4l2-dbg utility over calling this ioctl directly. It
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) is available from the LinuxTV v4l-dvb repository; see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) `https://linuxtv.org/repo/ <https://linuxtv.org/repo/>`__ for access
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) instructions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) .. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm}|p{7.0cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) .. _name-v4l2-dbg-match:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) .. flat-table:: struct v4l2_dbg_match
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)     :header-rows:  0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)     :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)     :widths:       1 1 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87)     * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)       - ``type``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)       - See :ref:`name-chip-match-types` for a list of possible types.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)     * - union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91)       - (anonymous)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)     * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)       - ``addr``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)       - Match a chip by this number, interpreted according to the ``type``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)     * - char
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)       - ``name[32]``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)       - Match a chip by this name, interpreted according to the ``type``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	field. Currently unused.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)     * - }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)       -
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) .. c:type:: v4l2_dbg_chip_info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) .. flat-table:: struct v4l2_dbg_chip_info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)     :header-rows:  0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)     :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)     :widths:       1 1 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)     * - struct v4l2_dbg_match
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)       - ``match``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)       - How to match the chip, see :ref:`name-v4l2-dbg-match`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)     * - char
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)       - ``name[32]``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)       - The name of the chip.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)     * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)       - ``flags``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)       - Set by the driver. If ``V4L2_CHIP_FL_READABLE`` is set, then the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	driver supports reading registers from the device. If
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	``V4L2_CHIP_FL_WRITABLE`` is set, then it supports writing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	registers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)     * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)       - ``reserved[8]``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)       - Reserved fields, both application and driver must set these to 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) .. _name-chip-match-types:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) .. flat-table:: Chip Match Types
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)     :header-rows:  0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)     :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)     :widths:       3 1 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)     * - ``V4L2_CHIP_MATCH_BRIDGE``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)       - 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)       - Match the nth chip on the card, zero for the bridge chip. Does not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	match sub-devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)     * - ``V4L2_CHIP_MATCH_SUBDEV``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)       - 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)       - Match the nth sub-device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) Return Value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) On success 0 is returned, on error -1 and the ``errno`` variable is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) appropriately. The generic error codes are described at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) :ref:`Generic Error Codes <gen-errors>` chapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) EINVAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)     The ``match_type`` is invalid or no device could be matched.