brintos

brintos / linux-shallow public Read only

0
0
Text · 4.4 KiB · 1a1e093 Raw
156 lines · plain
1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later2.. c:namespace:: V4L3 4.. _VIDIOC_DBG_G_CHIP_INFO:5 6****************************7ioctl VIDIOC_DBG_G_CHIP_INFO8****************************9 10Name11====12 13VIDIOC_DBG_G_CHIP_INFO - Identify the chips on a TV card14 15Synopsis16========17 18.. c:macro:: VIDIOC_DBG_G_CHIP_INFO19 20``int ioctl(int fd, VIDIOC_DBG_G_CHIP_INFO, struct v4l2_dbg_chip_info *argp)``21 22Arguments23=========24 25``fd``26    File descriptor returned by :c:func:`open()`.27 28``argp``29    Pointer to struct :c:type:`v4l2_dbg_chip_info`.30 31Description32===========33 34.. note::35 36    This is an :ref:`experimental` interface and may37    change in the future.38 39For driver debugging purposes this ioctl allows test applications to40query the driver about the chips present on the TV card. Regular41applications must not use it. When you found a chip specific bug, please42contact the linux-media mailing list43(`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__)44so it can be fixed.45 46Additionally the Linux kernel must be compiled with the47``CONFIG_VIDEO_ADV_DEBUG`` option to enable this ioctl.48 49To query the driver applications must initialize the ``match.type`` and50``match.addr`` or ``match.name`` fields of a struct51:c:type:`v4l2_dbg_chip_info` and call52:ref:`VIDIOC_DBG_G_CHIP_INFO` with a pointer to this structure. On success53the driver stores information about the selected chip in the ``name``54and ``flags`` fields.55 56When ``match.type`` is ``V4L2_CHIP_MATCH_BRIDGE``, ``match.addr``57selects the nth bridge 'chip' on the TV card. You can enumerate all58chips by starting at zero and incrementing ``match.addr`` by one until59:ref:`VIDIOC_DBG_G_CHIP_INFO` fails with an ``EINVAL`` error code. The number60zero always selects the bridge chip itself, e. g. the chip connected to61the PCI or USB bus. Non-zero numbers identify specific parts of the62bridge chip such as an AC97 register block.63 64When ``match.type`` is ``V4L2_CHIP_MATCH_SUBDEV``, ``match.addr``65selects the nth sub-device. This allows you to enumerate over all66sub-devices.67 68On success, the ``name`` field will contain a chip name and the69``flags`` field will contain ``V4L2_CHIP_FL_READABLE`` if the driver70supports reading registers from the device or ``V4L2_CHIP_FL_WRITABLE``71if the driver supports writing registers to the device.72 73We recommended the v4l2-dbg utility over calling this ioctl directly. It74is available from the LinuxTV v4l-dvb repository; see75`https://linuxtv.org/repo/ <https://linuxtv.org/repo/>`__ for access76instructions.77 78.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm}|p{6.6cm}|79 80.. _name-v4l2-dbg-match:81 82.. flat-table:: struct v4l2_dbg_match83    :header-rows:  084    :stub-columns: 085    :widths:       1 1 286 87    * - __u3288      - ``type``89      - See :ref:`name-chip-match-types` for a list of possible types.90    * - union {91      - (anonymous)92    * - __u3293      - ``addr``94      - Match a chip by this number, interpreted according to the ``type``95	field.96    * - char97      - ``name[32]``98      - Match a chip by this name, interpreted according to the ``type``99	field. Currently unused.100    * - }101      -102 103 104.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|105 106.. c:type:: v4l2_dbg_chip_info107 108.. flat-table:: struct v4l2_dbg_chip_info109    :header-rows:  0110    :stub-columns: 0111    :widths:       1 1 2112 113    * - struct v4l2_dbg_match114      - ``match``115      - How to match the chip, see :ref:`name-v4l2-dbg-match`.116    * - char117      - ``name[32]``118      - The name of the chip.119    * - __u32120      - ``flags``121      - Set by the driver. If ``V4L2_CHIP_FL_READABLE`` is set, then the122	driver supports reading registers from the device. If123	``V4L2_CHIP_FL_WRITABLE`` is set, then it supports writing124	registers.125    * - __u32126      - ``reserved[8]``127      - Reserved fields, both application and driver must set these to 0.128 129 130.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|131 132.. _name-chip-match-types:133 134.. flat-table:: Chip Match Types135    :header-rows:  0136    :stub-columns: 0137    :widths:       3 1 4138 139    * - ``V4L2_CHIP_MATCH_BRIDGE``140      - 0141      - Match the nth chip on the card, zero for the bridge chip. Does not142	match sub-devices.143    * - ``V4L2_CHIP_MATCH_SUBDEV``144      - 4145      - Match the nth sub-device.146 147Return Value148============149 150On success 0 is returned, on error -1 and the ``errno`` variable is set151appropriately. The generic error codes are described at the152:ref:`Generic Error Codes <gen-errors>` chapter.153 154EINVAL155    The ``match_type`` is invalid or no device could be matched.156