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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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. On failure the structure
  67. remains unchanged.</para>
  68. <para>When <structfield>match.type</structfield> is
  69. <constant>V4L2_CHIP_MATCH_BRIDGE</constant>,
  70. <structfield>match.addr</structfield> selects the nth bridge 'chip'
  71. on the TV card. You can enumerate all chips by starting at zero and
  72. incrementing <structfield>match.addr</structfield> by one until
  73. <constant>VIDIOC_DBG_G_CHIP_INFO</constant> fails with an &EINVAL;.
  74. The number zero always selects the bridge chip itself, &eg; the chip
  75. connected to the PCI or USB bus. Non-zero numbers identify specific
  76. parts of the bridge chip such as an AC97 register block.</para>
  77. <para>When <structfield>match.type</structfield> is
  78. <constant>V4L2_CHIP_MATCH_SUBDEV</constant>,
  79. <structfield>match.addr</structfield> selects the nth sub-device. This
  80. allows you to enumerate over all sub-devices.</para>
  81. <para>On success, the <structfield>name</structfield> field will
  82. contain a chip name and the <structfield>flags</structfield> field will
  83. contain <constant>V4L2_CHIP_FL_READABLE</constant> if the driver supports
  84. reading registers from the device or <constant>V4L2_CHIP_FL_WRITABLE</constant>
  85. if the driver supports writing registers to the device.</para>
  86. <para>We recommended the <application>v4l2-dbg</application>
  87. utility over calling this ioctl directly. It is available from the
  88. LinuxTV v4l-dvb repository; see <ulink
  89. url="http://linuxtv.org/repo/">http://linuxtv.org/repo/</ulink> for
  90. access instructions.</para>
  91. <!-- Note for convenience vidioc-dbg-g-register.sgml
  92. contains a duplicate of this table. -->
  93. <table pgwide="1" frame="none" id="name-v4l2-dbg-match">
  94. <title>struct <structname>v4l2_dbg_match</structname></title>
  95. <tgroup cols="4">
  96. &cs-ustr;
  97. <tbody valign="top">
  98. <row>
  99. <entry>__u32</entry>
  100. <entry><structfield>type</structfield></entry>
  101. <entry>See <xref linkend="name-chip-match-types" /> for a list of
  102. possible types.</entry>
  103. </row>
  104. <row>
  105. <entry>union</entry>
  106. <entry>(anonymous)</entry>
  107. </row>
  108. <row>
  109. <entry></entry>
  110. <entry>__u32</entry>
  111. <entry><structfield>addr</structfield></entry>
  112. <entry>Match a chip by this number, interpreted according
  113. to the <structfield>type</structfield> field.</entry>
  114. </row>
  115. <row>
  116. <entry></entry>
  117. <entry>char</entry>
  118. <entry><structfield>name[32]</structfield></entry>
  119. <entry>Match a chip by this name, interpreted according
  120. to the <structfield>type</structfield> field.</entry>
  121. </row>
  122. </tbody>
  123. </tgroup>
  124. </table>
  125. <table pgwide="1" frame="none" id="v4l2-dbg-chip-info">
  126. <title>struct <structname>v4l2_dbg_chip_info</structname></title>
  127. <tgroup cols="3">
  128. &cs-str;
  129. <tbody valign="top">
  130. <row>
  131. <entry>struct v4l2_dbg_match</entry>
  132. <entry><structfield>match</structfield></entry>
  133. <entry>How to match the chip, see <xref linkend="name-v4l2-dbg-match" />.</entry>
  134. </row>
  135. <row>
  136. <entry>char</entry>
  137. <entry><structfield>name[32]</structfield></entry>
  138. <entry>The name of the chip.</entry>
  139. </row>
  140. <row>
  141. <entry>__u32</entry>
  142. <entry><structfield>flags</structfield></entry>
  143. <entry>Set by the driver. If <constant>V4L2_CHIP_FL_READABLE</constant>
  144. is set, then the driver supports reading registers from the device. If
  145. <constant>V4L2_CHIP_FL_WRITABLE</constant> is set, then it supports writing registers.</entry>
  146. </row>
  147. <row>
  148. <entry>__u32</entry>
  149. <entry><structfield>reserved[8]</structfield></entry>
  150. <entry>Reserved fields, both application and driver must set these to 0.</entry>
  151. </row>
  152. </tbody>
  153. </tgroup>
  154. </table>
  155. <!-- Note for convenience vidioc-dbg-g-register.sgml
  156. contains a duplicate of this table. -->
  157. <table pgwide="1" frame="none" id="name-chip-match-types">
  158. <title>Chip Match Types</title>
  159. <tgroup cols="3">
  160. &cs-def;
  161. <tbody valign="top">
  162. <row>
  163. <entry><constant>V4L2_CHIP_MATCH_BRIDGE</constant></entry>
  164. <entry>0</entry>
  165. <entry>Match the nth chip on the card, zero for the
  166. bridge chip. Does not match sub-devices.</entry>
  167. </row>
  168. <row>
  169. <entry><constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant></entry>
  170. <entry>1</entry>
  171. <entry>Match an &i2c; chip by its driver name. Can't be used with this ioctl.</entry>
  172. </row>
  173. <row>
  174. <entry><constant>V4L2_CHIP_MATCH_I2C_ADDR</constant></entry>
  175. <entry>2</entry>
  176. <entry>Match a chip by its 7 bit &i2c; bus address. Can't be used with this ioctl.</entry>
  177. </row>
  178. <row>
  179. <entry><constant>V4L2_CHIP_MATCH_AC97</constant></entry>
  180. <entry>3</entry>
  181. <entry>Match the nth anciliary AC97 chip. Can't be used with this ioctl.</entry>
  182. </row>
  183. <row>
  184. <entry><constant>V4L2_CHIP_MATCH_SUBDEV</constant></entry>
  185. <entry>4</entry>
  186. <entry>Match the nth sub-device.</entry>
  187. </row>
  188. </tbody>
  189. </tgroup>
  190. </table>
  191. </refsect1>
  192. <refsect1>
  193. &return-value;
  194. <variablelist>
  195. <varlistentry>
  196. <term><errorcode>EINVAL</errorcode></term>
  197. <listitem>
  198. <para>The <structfield>match_type</structfield> is invalid or
  199. no device could be matched.</para>
  200. </listitem>
  201. </varlistentry>
  202. </variablelist>
  203. </refsect1>
  204. </refentry>