vidioc-dbg-g-chip-info.xml 6.7 KB

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