1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ioctl VIDIOC_DBG_G_CHIP_INFO</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="user-func.html" title="Appendix A. Function Reference"><link rel="prev" href="vidioc-cropcap.html" title="ioctl VIDIOC_CROPCAP"><link rel="next" href="vidioc-dbg-g-register.html" title="ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ioctl VIDIOC_DBG_G_CHIP_INFO</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="vidioc-cropcap.html">Prev</a> </td><th width="60%" align="center">Appendix A. Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="vidioc-dbg-g-register.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="vidioc-dbg-g-chip-info"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>VIDIOC_DBG_G_CHIP_INFO — Identify the chips on a TV card</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">ioctl</b>(</code></td><td>int <var class="pdparam">fd</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">request</var>, </td></tr><tr><td> </td><td>struct v4l2_dbg_chip_info 2*<var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1111983276"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fd</code></em></span></dt><dd><p>File descriptor returned by <a class="link" href="func-open.html" title="V4L2 open()"><code class="function">open()</code></a>.</p></dd><dt><span class="term"><em class="parameter"><code>request</code></em></span></dt><dd><p>VIDIOC_DBG_G_CHIP_INFO</p></dd><dt><span class="term"><em class="parameter"><code>argp</code></em></span></dt><dd><p></p></dd></dl></div></div><div class="refsect1"><a name="idp1112060292"></a><h2>Description</h2><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Experimental</h3><p>This is an <a class="link" href="hist-v4l2.html#experimental" title="Experimental API Elements">experimental</a> interface and may change in 3the future.</p></div><p>For driver debugging purposes this ioctl allows test 4applications to query the driver about the chips present on the TV 5card. Regular applications must not use it. When you found a chip 6specific bug, please contact the linux-media mailing list (<a class="ulink" href="http://www.linuxtv.org/lists.php" target="_top">http://www.linuxtv.org/lists.php</a>) 7so it can be fixed.</p><p>Additionally the Linux kernel must be compiled with the 8<code class="constant">CONFIG_VIDEO_ADV_DEBUG</code> option to enable this ioctl.</p><p>To query the driver applications must initialize the 9<em class="structfield"><code>match.type</code></em> and 10<em class="structfield"><code>match.addr</code></em> or <em class="structfield"><code>match.name</code></em> 11fields of a struct <a class="link" href="vidioc-dbg-g-chip-info.html#v4l2-dbg-chip-info" title="Table A.5. struct v4l2_dbg_chip_info">v4l2_dbg_chip_info</a> 12and call <code class="constant">VIDIOC_DBG_G_CHIP_INFO</code> with a pointer to 13this structure. On success the driver stores information about the 14selected chip in the <em class="structfield"><code>name</code></em> and 15<em class="structfield"><code>flags</code></em> fields.</p><p>When <em class="structfield"><code>match.type</code></em> is 16<code class="constant">V4L2_CHIP_MATCH_BRIDGE</code>, 17<em class="structfield"><code>match.addr</code></em> selects the nth bridge 'chip' 18on the TV card. You can enumerate all chips by starting at zero and 19incrementing <em class="structfield"><code>match.addr</code></em> by one until 20<code class="constant">VIDIOC_DBG_G_CHIP_INFO</code> fails with an <span class="errorcode">EINVAL</span> error code. 21The number zero always selects the bridge chip itself, e. g. the chip 22connected to the PCI or USB bus. Non-zero numbers identify specific 23parts of the bridge chip such as an AC97 register block.</p><p>When <em class="structfield"><code>match.type</code></em> is 24<code class="constant">V4L2_CHIP_MATCH_SUBDEV</code>, 25<em class="structfield"><code>match.addr</code></em> selects the nth sub-device. This 26allows you to enumerate over all sub-devices.</p><p>On success, the <em class="structfield"><code>name</code></em> field will 27contain a chip name and the <em class="structfield"><code>flags</code></em> field will 28contain <code class="constant">V4L2_CHIP_FL_READABLE</code> if the driver supports 29reading registers from the device or <code class="constant">V4L2_CHIP_FL_WRITABLE</code> 30if the driver supports writing registers to the device.</p><p>We recommended the <span class="application">v4l2-dbg</span> 31utility over calling this ioctl directly. It is available from the 32LinuxTV v4l-dvb repository; see <a class="ulink" href="http://linuxtv.org/repo/" target="_top">http://linuxtv.org/repo/</a> for 33access instructions.</p><div class="table"><a name="name-v4l2-dbg-match"></a><p class="title"><b>Table A.4. struct <span class="structname">v4l2_dbg_match</span></b></p><div class="table-contents"><table summary="struct v4l2_dbg_match" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"><col class="c4"></colgroup><tbody valign="top"><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>type</code></em></td><td valign="top">See <a class="xref" href="vidioc-dbg-g-chip-info.html#name-chip-match-types" title="Table A.6. Chip Match Types">Table A.6, “Chip Match Types”</a> for a list of 34possible types.</td><td class="auto-generated"> </td></tr><tr><td valign="top">union</td><td valign="top">(anonymous)</td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td valign="top"> </td><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>addr</code></em></td><td valign="top">Match a chip by this number, interpreted according 35to the <em class="structfield"><code>type</code></em> field.</td></tr><tr><td valign="top"> </td><td valign="top">char</td><td valign="top"><em class="structfield"><code>name[32]</code></em></td><td valign="top">Match a chip by this name, interpreted according 36to the <em class="structfield"><code>type</code></em> field. Currently unused.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="v4l2-dbg-chip-info"></a><p class="title"><b>Table A.5. struct <span class="structname">v4l2_dbg_chip_info</span></b></p><div class="table-contents"><table summary="struct v4l2_dbg_chip_info" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top">struct v4l2_dbg_match</td><td valign="top"><em class="structfield"><code>match</code></em></td><td valign="top">How to match the chip, see <a class="xref" href="vidioc-dbg-g-chip-info.html#name-v4l2-dbg-match" title="Table A.4. struct v4l2_dbg_match">Table A.4, “struct <span class="structname">v4l2_dbg_match</span>”</a>.</td></tr><tr><td valign="top">char</td><td valign="top"><em class="structfield"><code>name[32]</code></em></td><td valign="top">The name of the chip.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>flags</code></em></td><td valign="top">Set by the driver. If <code class="constant">V4L2_CHIP_FL_READABLE</code> 37is set, then the driver supports reading registers from the device. If 38<code class="constant">V4L2_CHIP_FL_WRITABLE</code> is set, then it supports writing registers.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>reserved[8]</code></em></td><td valign="top">Reserved fields, both application and driver must set these to 0.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="name-chip-match-types"></a><p class="title"><b>Table A.6. Chip Match Types</b></p><div class="table-contents"><table summary="Chip Match Types" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top"><code class="constant">V4L2_CHIP_MATCH_BRIDGE</code></td><td valign="top">0</td><td valign="top">Match the nth chip on the card, zero for the 39 bridge chip. Does not match sub-devices.</td></tr><tr><td valign="top"><code class="constant">V4L2_CHIP_MATCH_SUBDEV</code></td><td valign="top">4</td><td valign="top">Match the nth sub-device.</td></tr></tbody></table></div></div><br class="table-break"></div><div class="refsect1"><a name="idp1112092596"></a><h2>Return Value</h2><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">EINVAL</span></span></dt><dd><p>The <em class="structfield"><code>match_type</code></em> is invalid or 40no device could be matched.</p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="vidioc-cropcap.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="user-func.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="vidioc-dbg-g-register.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl VIDIOC_CROPCAP </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER</td></tr></table></div></body></html> 41