1 .. -*- coding: utf-8; mode: rst -*-
3 .. _VIDIOC_DBG_G_CHIP_INFO:
5 ****************************
6 ioctl VIDIOC_DBG_G_CHIP_INFO
7 ****************************
9 *man VIDIOC_DBG_G_CHIP_INFO(2)*
11 Identify the chips on a TV card
17 .. cpp:function:: int ioctl( int fd, int request, struct v4l2_dbg_chip_info *argp )
23 File descriptor returned by :ref:`open() <func-open>`.
26 VIDIOC_DBG_G_CHIP_INFO
36 This is an :ref:`experimental` interface and may
39 For driver debugging purposes this ioctl allows test applications to
40 query the driver about the chips present on the TV card. Regular
41 applications must not use it. When you found a chip specific bug, please
42 contact the linux-media mailing list
43 (`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__)
46 Additionally the Linux kernel must be compiled with the
47 ``CONFIG_VIDEO_ADV_DEBUG`` option to enable this ioctl.
49 To query the driver applications must initialize the ``match.type`` and
50 ``match.addr`` or ``match.name`` fields of a struct
51 :ref:`v4l2_dbg_chip_info <v4l2-dbg-chip-info>` and call
52 :ref:`VIDIOC_DBG_G_CHIP_INFO` with a pointer to this structure. On success
53 the driver stores information about the selected chip in the ``name``
56 When ``match.type`` is ``V4L2_CHIP_MATCH_BRIDGE``, ``match.addr``
57 selects the nth bridge 'chip' on the TV card. You can enumerate all
58 chips by starting at zero and incrementing ``match.addr`` by one until
59 :ref:`VIDIOC_DBG_G_CHIP_INFO` fails with an ``EINVAL`` error code. The number
60 zero always selects the bridge chip itself, e. g. the chip connected to
61 the PCI or USB bus. Non-zero numbers identify specific parts of the
62 bridge chip such as an AC97 register block.
64 When ``match.type`` is ``V4L2_CHIP_MATCH_SUBDEV``, ``match.addr``
65 selects the nth sub-device. This allows you to enumerate over all
68 On success, the ``name`` field will contain a chip name and the
69 ``flags`` field will contain ``V4L2_CHIP_FL_READABLE`` if the driver
70 supports reading registers from the device or ``V4L2_CHIP_FL_WRITABLE``
71 if the driver supports writing registers to the device.
73 We recommended the v4l2-dbg utility over calling this ioctl directly. It
74 is available from the LinuxTV v4l-dvb repository; see
75 `https://linuxtv.org/repo/ <https://linuxtv.org/repo/>`__ for access
79 .. _name-v4l2-dbg-match:
81 .. flat-table:: struct v4l2_dbg_match
93 - See :ref:`name-chip-match-types` for a list of possible types.
108 - Match a chip by this number, interpreted according to the ``type``
118 - Match a chip by this name, interpreted according to the ``type``
119 field. Currently unused.
123 .. _v4l2-dbg-chip-info:
125 .. flat-table:: struct v4l2_dbg_chip_info
133 - struct v4l2_dbg_match
137 - How to match the chip, see :ref:`name-v4l2-dbg-match`.
145 - The name of the chip.
153 - Set by the driver. If ``V4L2_CHIP_FL_READABLE`` is set, then the
154 driver supports reading registers from the device. If
155 ``V4L2_CHIP_FL_WRITABLE`` is set, then it supports writing
164 - Reserved fields, both application and driver must set these to 0.
168 .. _name-chip-match-types:
170 .. flat-table:: Chip Match Types
178 - ``V4L2_CHIP_MATCH_BRIDGE``
182 - Match the nth chip on the card, zero for the bridge chip. Does not
187 - ``V4L2_CHIP_MATCH_SUBDEV``
191 - Match the nth sub-device.
198 On success 0 is returned, on error -1 and the ``errno`` variable is set
199 appropriately. The generic error codes are described at the
200 :ref:`Generic Error Codes <gen-errors>` chapter.
203 The ``match_type`` is invalid or no device could be matched.