162306a36Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 262306a36Sopenharmony_ci.. c:namespace:: V4L 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci.. _VIDIOC_DBG_G_CHIP_INFO: 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci**************************** 762306a36Sopenharmony_ciioctl VIDIOC_DBG_G_CHIP_INFO 862306a36Sopenharmony_ci**************************** 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ciName 1162306a36Sopenharmony_ci==== 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ciVIDIOC_DBG_G_CHIP_INFO - Identify the chips on a TV card 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ciSynopsis 1662306a36Sopenharmony_ci======== 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci.. c:macro:: VIDIOC_DBG_G_CHIP_INFO 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci``int ioctl(int fd, VIDIOC_DBG_G_CHIP_INFO, struct v4l2_dbg_chip_info *argp)`` 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ciArguments 2362306a36Sopenharmony_ci========= 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci``fd`` 2662306a36Sopenharmony_ci File descriptor returned by :c:func:`open()`. 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci``argp`` 2962306a36Sopenharmony_ci Pointer to struct :c:type:`v4l2_dbg_chip_info`. 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_ciDescription 3262306a36Sopenharmony_ci=========== 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci.. note:: 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci This is an :ref:`experimental` interface and may 3762306a36Sopenharmony_ci change in the future. 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ciFor driver debugging purposes this ioctl allows test applications to 4062306a36Sopenharmony_ciquery the driver about the chips present on the TV card. Regular 4162306a36Sopenharmony_ciapplications must not use it. When you found a chip specific bug, please 4262306a36Sopenharmony_cicontact the linux-media mailing list 4362306a36Sopenharmony_ci(`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__) 4462306a36Sopenharmony_ciso it can be fixed. 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_ciAdditionally the Linux kernel must be compiled with the 4762306a36Sopenharmony_ci``CONFIG_VIDEO_ADV_DEBUG`` option to enable this ioctl. 4862306a36Sopenharmony_ci 4962306a36Sopenharmony_ciTo query the driver applications must initialize the ``match.type`` and 5062306a36Sopenharmony_ci``match.addr`` or ``match.name`` fields of a struct 5162306a36Sopenharmony_ci:c:type:`v4l2_dbg_chip_info` and call 5262306a36Sopenharmony_ci:ref:`VIDIOC_DBG_G_CHIP_INFO` with a pointer to this structure. On success 5362306a36Sopenharmony_cithe driver stores information about the selected chip in the ``name`` 5462306a36Sopenharmony_ciand ``flags`` fields. 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ciWhen ``match.type`` is ``V4L2_CHIP_MATCH_BRIDGE``, ``match.addr`` 5762306a36Sopenharmony_ciselects the nth bridge 'chip' on the TV card. You can enumerate all 5862306a36Sopenharmony_cichips by starting at zero and incrementing ``match.addr`` by one until 5962306a36Sopenharmony_ci:ref:`VIDIOC_DBG_G_CHIP_INFO` fails with an ``EINVAL`` error code. The number 6062306a36Sopenharmony_cizero always selects the bridge chip itself, e. g. the chip connected to 6162306a36Sopenharmony_cithe PCI or USB bus. Non-zero numbers identify specific parts of the 6262306a36Sopenharmony_cibridge chip such as an AC97 register block. 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ciWhen ``match.type`` is ``V4L2_CHIP_MATCH_SUBDEV``, ``match.addr`` 6562306a36Sopenharmony_ciselects the nth sub-device. This allows you to enumerate over all 6662306a36Sopenharmony_cisub-devices. 6762306a36Sopenharmony_ci 6862306a36Sopenharmony_ciOn success, the ``name`` field will contain a chip name and the 6962306a36Sopenharmony_ci``flags`` field will contain ``V4L2_CHIP_FL_READABLE`` if the driver 7062306a36Sopenharmony_cisupports reading registers from the device or ``V4L2_CHIP_FL_WRITABLE`` 7162306a36Sopenharmony_ciif the driver supports writing registers to the device. 7262306a36Sopenharmony_ci 7362306a36Sopenharmony_ciWe recommended the v4l2-dbg utility over calling this ioctl directly. It 7462306a36Sopenharmony_ciis available from the LinuxTV v4l-dvb repository; see 7562306a36Sopenharmony_ci`https://linuxtv.org/repo/ <https://linuxtv.org/repo/>`__ for access 7662306a36Sopenharmony_ciinstructions. 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ci.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm}|p{6.6cm}| 7962306a36Sopenharmony_ci 8062306a36Sopenharmony_ci.. _name-v4l2-dbg-match: 8162306a36Sopenharmony_ci 8262306a36Sopenharmony_ci.. flat-table:: struct v4l2_dbg_match 8362306a36Sopenharmony_ci :header-rows: 0 8462306a36Sopenharmony_ci :stub-columns: 0 8562306a36Sopenharmony_ci :widths: 1 1 2 8662306a36Sopenharmony_ci 8762306a36Sopenharmony_ci * - __u32 8862306a36Sopenharmony_ci - ``type`` 8962306a36Sopenharmony_ci - See :ref:`name-chip-match-types` for a list of possible types. 9062306a36Sopenharmony_ci * - union { 9162306a36Sopenharmony_ci - (anonymous) 9262306a36Sopenharmony_ci * - __u32 9362306a36Sopenharmony_ci - ``addr`` 9462306a36Sopenharmony_ci - Match a chip by this number, interpreted according to the ``type`` 9562306a36Sopenharmony_ci field. 9662306a36Sopenharmony_ci * - char 9762306a36Sopenharmony_ci - ``name[32]`` 9862306a36Sopenharmony_ci - Match a chip by this name, interpreted according to the ``type`` 9962306a36Sopenharmony_ci field. Currently unused. 10062306a36Sopenharmony_ci * - } 10162306a36Sopenharmony_ci - 10262306a36Sopenharmony_ci 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ci.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}| 10562306a36Sopenharmony_ci 10662306a36Sopenharmony_ci.. c:type:: v4l2_dbg_chip_info 10762306a36Sopenharmony_ci 10862306a36Sopenharmony_ci.. flat-table:: struct v4l2_dbg_chip_info 10962306a36Sopenharmony_ci :header-rows: 0 11062306a36Sopenharmony_ci :stub-columns: 0 11162306a36Sopenharmony_ci :widths: 1 1 2 11262306a36Sopenharmony_ci 11362306a36Sopenharmony_ci * - struct v4l2_dbg_match 11462306a36Sopenharmony_ci - ``match`` 11562306a36Sopenharmony_ci - How to match the chip, see :ref:`name-v4l2-dbg-match`. 11662306a36Sopenharmony_ci * - char 11762306a36Sopenharmony_ci - ``name[32]`` 11862306a36Sopenharmony_ci - The name of the chip. 11962306a36Sopenharmony_ci * - __u32 12062306a36Sopenharmony_ci - ``flags`` 12162306a36Sopenharmony_ci - Set by the driver. If ``V4L2_CHIP_FL_READABLE`` is set, then the 12262306a36Sopenharmony_ci driver supports reading registers from the device. If 12362306a36Sopenharmony_ci ``V4L2_CHIP_FL_WRITABLE`` is set, then it supports writing 12462306a36Sopenharmony_ci registers. 12562306a36Sopenharmony_ci * - __u32 12662306a36Sopenharmony_ci - ``reserved[8]`` 12762306a36Sopenharmony_ci - Reserved fields, both application and driver must set these to 0. 12862306a36Sopenharmony_ci 12962306a36Sopenharmony_ci 13062306a36Sopenharmony_ci.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}| 13162306a36Sopenharmony_ci 13262306a36Sopenharmony_ci.. _name-chip-match-types: 13362306a36Sopenharmony_ci 13462306a36Sopenharmony_ci.. flat-table:: Chip Match Types 13562306a36Sopenharmony_ci :header-rows: 0 13662306a36Sopenharmony_ci :stub-columns: 0 13762306a36Sopenharmony_ci :widths: 3 1 4 13862306a36Sopenharmony_ci 13962306a36Sopenharmony_ci * - ``V4L2_CHIP_MATCH_BRIDGE`` 14062306a36Sopenharmony_ci - 0 14162306a36Sopenharmony_ci - Match the nth chip on the card, zero for the bridge chip. Does not 14262306a36Sopenharmony_ci match sub-devices. 14362306a36Sopenharmony_ci * - ``V4L2_CHIP_MATCH_SUBDEV`` 14462306a36Sopenharmony_ci - 4 14562306a36Sopenharmony_ci - Match the nth sub-device. 14662306a36Sopenharmony_ci 14762306a36Sopenharmony_ciReturn Value 14862306a36Sopenharmony_ci============ 14962306a36Sopenharmony_ci 15062306a36Sopenharmony_ciOn success 0 is returned, on error -1 and the ``errno`` variable is set 15162306a36Sopenharmony_ciappropriately. The generic error codes are described at the 15262306a36Sopenharmony_ci:ref:`Generic Error Codes <gen-errors>` chapter. 15362306a36Sopenharmony_ci 15462306a36Sopenharmony_ciEINVAL 15562306a36Sopenharmony_ci The ``match_type`` is invalid or no device could be matched. 156