1 <refentry id="vidioc-dbg-g-chip-info">
3 <refentrytitle>ioctl VIDIOC_DBG_G_CHIP_INFO</refentrytitle>
8 <refname>VIDIOC_DBG_G_CHIP_INFO</refname>
9 <refpurpose>Identify the chips on a TV card</refpurpose>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_dbg_chip_info
19 *<parameter>argp</parameter></paramdef>
25 <title>Arguments</title>
29 <term><parameter>fd</parameter></term>
35 <term><parameter>request</parameter></term>
37 <para>VIDIOC_DBG_G_CHIP_INFO</para>
41 <term><parameter>argp</parameter></term>
50 <title>Description</title>
53 <title>Experimental</title>
55 <para>This is an <link
56 linkend="experimental">experimental</link> interface and may change in
60 <para>For driver debugging purposes this ioctl allows test
61 applications to query the driver about the chips present on the TV
62 card. Regular applications must not use it. When you found a chip
63 specific bug, please contact the linux-media mailing list (&v4l-ml;)
64 so it can be fixed.</para>
66 <para>Additionally the Linux kernel must be compiled with the
67 <constant>CONFIG_VIDEO_ADV_DEBUG</constant> option to enable this ioctl.</para>
69 <para>To query the driver applications must initialize the
70 <structfield>match.type</structfield> and
71 <structfield>match.addr</structfield> or <structfield>match.name</structfield>
72 fields of a &v4l2-dbg-chip-info;
73 and call <constant>VIDIOC_DBG_G_CHIP_INFO</constant> with a pointer to
74 this structure. On success the driver stores information about the
75 selected chip in the <structfield>name</structfield> and
76 <structfield>flags</structfield> fields.</para>
78 <para>When <structfield>match.type</structfield> is
79 <constant>V4L2_CHIP_MATCH_BRIDGE</constant>,
80 <structfield>match.addr</structfield> selects the nth bridge 'chip'
81 on the TV card. You can enumerate all chips by starting at zero and
82 incrementing <structfield>match.addr</structfield> by one until
83 <constant>VIDIOC_DBG_G_CHIP_INFO</constant> fails with an &EINVAL;.
84 The number zero always selects the bridge chip itself, ⪚ the chip
85 connected to the PCI or USB bus. Non-zero numbers identify specific
86 parts of the bridge chip such as an AC97 register block.</para>
88 <para>When <structfield>match.type</structfield> is
89 <constant>V4L2_CHIP_MATCH_SUBDEV</constant>,
90 <structfield>match.addr</structfield> selects the nth sub-device. This
91 allows you to enumerate over all sub-devices.</para>
93 <para>On success, the <structfield>name</structfield> field will
94 contain a chip name and the <structfield>flags</structfield> field will
95 contain <constant>V4L2_CHIP_FL_READABLE</constant> if the driver supports
96 reading registers from the device or <constant>V4L2_CHIP_FL_WRITABLE</constant>
97 if the driver supports writing registers to the device.</para>
99 <para>We recommended the <application>v4l2-dbg</application>
100 utility over calling this ioctl directly. It is available from the
101 LinuxTV v4l-dvb repository; see <ulink
102 url="http://linuxtv.org/repo/">http://linuxtv.org/repo/</ulink> for
103 access instructions.</para>
105 <!-- Note for convenience vidioc-dbg-g-register.sgml
106 contains a duplicate of this table. -->
107 <table pgwide="1" frame="none" id="name-v4l2-dbg-match">
108 <title>struct <structname>v4l2_dbg_match</structname></title>
114 <entry><structfield>type</structfield></entry>
115 <entry>See <xref linkend="name-chip-match-types" /> for a list of
116 possible types.</entry>
120 <entry>(anonymous)</entry>
125 <entry><structfield>addr</structfield></entry>
126 <entry>Match a chip by this number, interpreted according
127 to the <structfield>type</structfield> field.</entry>
132 <entry><structfield>name[32]</structfield></entry>
133 <entry>Match a chip by this name, interpreted according
134 to the <structfield>type</structfield> field. Currently unused.</entry>
140 <table pgwide="1" frame="none" id="v4l2-dbg-chip-info">
141 <title>struct <structname>v4l2_dbg_chip_info</structname></title>
146 <entry>struct v4l2_dbg_match</entry>
147 <entry><structfield>match</structfield></entry>
148 <entry>How to match the chip, see <xref linkend="name-v4l2-dbg-match" />.</entry>
152 <entry><structfield>name[32]</structfield></entry>
153 <entry>The name of the chip.</entry>
157 <entry><structfield>flags</structfield></entry>
158 <entry>Set by the driver. If <constant>V4L2_CHIP_FL_READABLE</constant>
159 is set, then the driver supports reading registers from the device. If
160 <constant>V4L2_CHIP_FL_WRITABLE</constant> is set, then it supports writing registers.</entry>
164 <entry><structfield>reserved[8]</structfield></entry>
165 <entry>Reserved fields, both application and driver must set these to 0.</entry>
171 <!-- Note for convenience vidioc-dbg-g-register.sgml
172 contains a duplicate of this table. -->
173 <table pgwide="1" frame="none" id="name-chip-match-types">
174 <title>Chip Match Types</title>
179 <entry><constant>V4L2_CHIP_MATCH_BRIDGE</constant></entry>
181 <entry>Match the nth chip on the card, zero for the
182 bridge chip. Does not match sub-devices.</entry>
185 <entry><constant>V4L2_CHIP_MATCH_SUBDEV</constant></entry>
187 <entry>Match the nth sub-device.</entry>
199 <term><errorcode>EINVAL</errorcode></term>
201 <para>The <structfield>match_type</structfield> is invalid or
202 no device could be matched.</para>