1 .. -*- coding: utf-8; mode: rst -*-
3 .. _VIDIOC_DBG_G_CHIP_INFO:
5 ****************************
6 ioctl VIDIOC_DBG_G_CHIP_INFO
7 ****************************
12 VIDIOC_DBG_G_CHIP_INFO - Identify the chips on a TV card
18 .. cpp:function:: int ioctl( int fd, int request, struct v4l2_dbg_chip_info *argp )
25 File descriptor returned by :ref:`open() <func-open>`.
28 VIDIOC_DBG_G_CHIP_INFO
38 This is an :ref:`experimental` interface and may
41 For driver debugging purposes this ioctl allows test applications to
42 query the driver about the chips present on the TV card. Regular
43 applications must not use it. When you found a chip specific bug, please
44 contact the linux-media mailing list
45 (`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__)
48 Additionally the Linux kernel must be compiled with the
49 ``CONFIG_VIDEO_ADV_DEBUG`` option to enable this ioctl.
51 To query the driver applications must initialize the ``match.type`` and
52 ``match.addr`` or ``match.name`` fields of a struct
53 :ref:`v4l2_dbg_chip_info <v4l2-dbg-chip-info>` and call
54 :ref:`VIDIOC_DBG_G_CHIP_INFO` with a pointer to this structure. On success
55 the driver stores information about the selected chip in the ``name``
58 When ``match.type`` is ``V4L2_CHIP_MATCH_BRIDGE``, ``match.addr``
59 selects the nth bridge 'chip' on the TV card. You can enumerate all
60 chips by starting at zero and incrementing ``match.addr`` by one until
61 :ref:`VIDIOC_DBG_G_CHIP_INFO` fails with an ``EINVAL`` error code. The number
62 zero always selects the bridge chip itself, e. g. the chip connected to
63 the PCI or USB bus. Non-zero numbers identify specific parts of the
64 bridge chip such as an AC97 register block.
66 When ``match.type`` is ``V4L2_CHIP_MATCH_SUBDEV``, ``match.addr``
67 selects the nth sub-device. This allows you to enumerate over all
70 On success, the ``name`` field will contain a chip name and the
71 ``flags`` field will contain ``V4L2_CHIP_FL_READABLE`` if the driver
72 supports reading registers from the device or ``V4L2_CHIP_FL_WRITABLE``
73 if the driver supports writing registers to the device.
75 We recommended the v4l2-dbg utility over calling this ioctl directly. It
76 is available from the LinuxTV v4l-dvb repository; see
77 `https://linuxtv.org/repo/ <https://linuxtv.org/repo/>`__ for access
81 .. _name-v4l2-dbg-match:
83 .. flat-table:: struct v4l2_dbg_match
95 - See :ref:`name-chip-match-types` for a list of possible types.
110 - Match a chip by this number, interpreted according to the ``type``
120 - Match a chip by this name, interpreted according to the ``type``
121 field. Currently unused.
125 .. _v4l2-dbg-chip-info:
127 .. flat-table:: struct v4l2_dbg_chip_info
135 - struct v4l2_dbg_match
139 - How to match the chip, see :ref:`name-v4l2-dbg-match`.
147 - The name of the chip.
155 - Set by the driver. If ``V4L2_CHIP_FL_READABLE`` is set, then the
156 driver supports reading registers from the device. If
157 ``V4L2_CHIP_FL_WRITABLE`` is set, then it supports writing
166 - Reserved fields, both application and driver must set these to 0.
170 .. _name-chip-match-types:
172 .. flat-table:: Chip Match Types
180 - ``V4L2_CHIP_MATCH_BRIDGE``
184 - Match the nth chip on the card, zero for the bridge chip. Does not
189 - ``V4L2_CHIP_MATCH_SUBDEV``
193 - Match the nth sub-device.
199 On success 0 is returned, on error -1 and the ``errno`` variable is set
200 appropriately. The generic error codes are described at the
201 :ref:`Generic Error Codes <gen-errors>` chapter.
204 The ``match_type`` is invalid or no device could be matched.