1<refentry id="vidioc-dbg-g-chip-info"> 2 <refmeta> 3 <refentrytitle>ioctl VIDIOC_DBG_G_CHIP_INFO</refentrytitle> 4 &manvol; 5 </refmeta> 6 7 <refnamediv> 8 <refname>VIDIOC_DBG_G_CHIP_INFO</refname> 9 <refpurpose>Identify the chips on a TV card</refpurpose> 10 </refnamediv> 11 12 <refsynopsisdiv> 13 <funcsynopsis> 14 <funcprototype> 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> 20 </funcprototype> 21 </funcsynopsis> 22 </refsynopsisdiv> 23 24 <refsect1> 25 <title>Arguments</title> 26 27 <variablelist> 28 <varlistentry> 29 <term><parameter>fd</parameter></term> 30 <listitem> 31 <para>&fd;</para> 32 </listitem> 33 </varlistentry> 34 <varlistentry> 35 <term><parameter>request</parameter></term> 36 <listitem> 37 <para>VIDIOC_DBG_G_CHIP_INFO</para> 38 </listitem> 39 </varlistentry> 40 <varlistentry> 41 <term><parameter>argp</parameter></term> 42 <listitem> 43 <para></para> 44 </listitem> 45 </varlistentry> 46 </variablelist> 47 </refsect1> 48 49 <refsect1> 50 <title>Description</title> 51 52 <note> 53 <title>Experimental</title> 54 55 <para>This is an <link 56linkend="experimental">experimental</link> interface and may change in 57the future.</para> 58 </note> 59 60 <para>For driver debugging purposes this ioctl allows test 61applications to query the driver about the chips present on the TV 62card. Regular applications must not use it. When you found a chip 63specific bug, please contact the linux-media mailing list (&v4l-ml;) 64so it can be fixed.</para> 65 66 <para>Additionally the Linux kernel must be compiled with the 67<constant>CONFIG_VIDEO_ADV_DEBUG</constant> option to enable this ioctl.</para> 68 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> 72fields of a &v4l2-dbg-chip-info; 73and call <constant>VIDIOC_DBG_G_CHIP_INFO</constant> with a pointer to 74this structure. On success the driver stores information about the 75selected chip in the <structfield>name</structfield> and 76<structfield>flags</structfield> fields.</para> 77 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' 81on the TV card. You can enumerate all chips by starting at zero and 82incrementing <structfield>match.addr</structfield> by one until 83<constant>VIDIOC_DBG_G_CHIP_INFO</constant> fails with an &EINVAL;. 84The number zero always selects the bridge chip itself, ⪚ the chip 85connected to the PCI or USB bus. Non-zero numbers identify specific 86parts of the bridge chip such as an AC97 register block.</para> 87 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 91allows you to enumerate over all sub-devices.</para> 92 93 <para>On success, the <structfield>name</structfield> field will 94contain a chip name and the <structfield>flags</structfield> field will 95contain <constant>V4L2_CHIP_FL_READABLE</constant> if the driver supports 96reading registers from the device or <constant>V4L2_CHIP_FL_WRITABLE</constant> 97if the driver supports writing registers to the device.</para> 98 99 <para>We recommended the <application>v4l2-dbg</application> 100utility over calling this ioctl directly. It is available from the 101LinuxTV v4l-dvb repository; see <ulink 102url="http://linuxtv.org/repo/">http://linuxtv.org/repo/</ulink> for 103access instructions.</para> 104 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> 109 <tgroup cols="4"> 110 &cs-ustr; 111 <tbody valign="top"> 112 <row> 113 <entry>__u32</entry> 114 <entry><structfield>type</structfield></entry> 115 <entry>See <xref linkend="name-chip-match-types" /> for a list of 116possible types.</entry> 117 </row> 118 <row> 119 <entry>union</entry> 120 <entry>(anonymous)</entry> 121 </row> 122 <row> 123 <entry></entry> 124 <entry>__u32</entry> 125 <entry><structfield>addr</structfield></entry> 126 <entry>Match a chip by this number, interpreted according 127to the <structfield>type</structfield> field.</entry> 128 </row> 129 <row> 130 <entry></entry> 131 <entry>char</entry> 132 <entry><structfield>name[32]</structfield></entry> 133 <entry>Match a chip by this name, interpreted according 134to the <structfield>type</structfield> field. Currently unused.</entry> 135 </row> 136 </tbody> 137 </tgroup> 138 </table> 139 140 <table pgwide="1" frame="none" id="v4l2-dbg-chip-info"> 141 <title>struct <structname>v4l2_dbg_chip_info</structname></title> 142 <tgroup cols="3"> 143 &cs-str; 144 <tbody valign="top"> 145 <row> 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> 149 </row> 150 <row> 151 <entry>char</entry> 152 <entry><structfield>name[32]</structfield></entry> 153 <entry>The name of the chip.</entry> 154 </row> 155 <row> 156 <entry>__u32</entry> 157 <entry><structfield>flags</structfield></entry> 158 <entry>Set by the driver. If <constant>V4L2_CHIP_FL_READABLE</constant> 159is 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> 161 </row> 162 <row> 163 <entry>__u32</entry> 164 <entry><structfield>reserved[8]</structfield></entry> 165 <entry>Reserved fields, both application and driver must set these to 0.</entry> 166 </row> 167 </tbody> 168 </tgroup> 169 </table> 170 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> 175 <tgroup cols="3"> 176 &cs-def; 177 <tbody valign="top"> 178 <row> 179 <entry><constant>V4L2_CHIP_MATCH_BRIDGE</constant></entry> 180 <entry>0</entry> 181 <entry>Match the nth chip on the card, zero for the 182 bridge chip. Does not match sub-devices.</entry> 183 </row> 184 <row> 185 <entry><constant>V4L2_CHIP_MATCH_SUBDEV</constant></entry> 186 <entry>4</entry> 187 <entry>Match the nth sub-device.</entry> 188 </row> 189 </tbody> 190 </tgroup> 191 </table> 192 </refsect1> 193 194 <refsect1> 195 &return-value; 196 197 <variablelist> 198 <varlistentry> 199 <term><errorcode>EINVAL</errorcode></term> 200 <listitem> 201 <para>The <structfield>match_type</structfield> is invalid or 202no device could be matched.</para> 203 </listitem> 204 </varlistentry> 205 </variablelist> 206 </refsect1> 207</refentry> 208