vidioc-dbg-g-chip-ident.xml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <refentry id="vidioc-dbg-g-chip-ident">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_DBG_G_CHIP_IDENT</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_DBG_G_CHIP_IDENT</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_ident
  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_IDENT</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>To query the driver applications must initialize the
  58. <structfield>match.type</structfield> and
  59. <structfield>match.addr</structfield> or <structfield>match.name</structfield>
  60. fields of a &v4l2-dbg-chip-ident;
  61. and call <constant>VIDIOC_DBG_G_CHIP_IDENT</constant> with a pointer to
  62. this structure. On success the driver stores information about the
  63. selected chip in the <structfield>ident</structfield> and
  64. <structfield>revision</structfield> fields. On failure the structure
  65. remains unchanged.</para>
  66. <para>When <structfield>match.type</structfield> is
  67. <constant>V4L2_CHIP_MATCH_HOST</constant>,
  68. <structfield>match.addr</structfield> selects the nth non-&i2c; chip
  69. on the TV card. You can enumerate all chips by starting at zero and
  70. incrementing <structfield>match.addr</structfield> by one until
  71. <constant>VIDIOC_DBG_G_CHIP_IDENT</constant> fails with an &EINVAL;.
  72. The number zero always selects the host chip, &eg; the chip connected
  73. to the PCI or USB bus.</para>
  74. <para>When <structfield>match.type</structfield> is
  75. <constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant>,
  76. <structfield>match.name</structfield> contains the I2C driver name.
  77. For instance
  78. <constant>"saa7127"</constant> will match any chip
  79. supported by the saa7127 driver, regardless of its &i2c; bus address.
  80. When multiple chips supported by the same driver are present, the
  81. ioctl will return <constant>V4L2_IDENT_AMBIGUOUS</constant> in the
  82. <structfield>ident</structfield> field.</para>
  83. <para>When <structfield>match.type</structfield> is
  84. <constant>V4L2_CHIP_MATCH_I2C_ADDR</constant>,
  85. <structfield>match.addr</structfield> selects a chip by its 7 bit
  86. &i2c; bus address.</para>
  87. <para>When <structfield>match.type</structfield> is
  88. <constant>V4L2_CHIP_MATCH_AC97</constant>,
  89. <structfield>match.addr</structfield> selects the nth AC97 chip
  90. on the TV card. You can enumerate all chips by starting at zero and
  91. incrementing <structfield>match.addr</structfield> by one until
  92. <constant>VIDIOC_DBG_G_CHIP_IDENT</constant> fails with an &EINVAL;.</para>
  93. <para>On success, the <structfield>ident</structfield> field will
  94. contain a chip ID from the Linux
  95. <filename>media/v4l2-chip-ident.h</filename> header file, and the
  96. <structfield>revision</structfield> field will contain a driver
  97. specific value, or zero if no particular revision is associated with
  98. this chip.</para>
  99. <para>When the driver could not identify the selected chip,
  100. <structfield>ident</structfield> will contain
  101. <constant>V4L2_IDENT_UNKNOWN</constant>. When no chip matched
  102. the ioctl will succeed but the
  103. <structfield>ident</structfield> field will contain
  104. <constant>V4L2_IDENT_NONE</constant>. If multiple chips matched,
  105. <structfield>ident</structfield> will contain
  106. <constant>V4L2_IDENT_AMBIGUOUS</constant>. In all these cases the
  107. <structfield>revision</structfield> field remains unchanged.</para>
  108. <para>This ioctl is optional, not all drivers may support it. It
  109. was introduced in Linux 2.6.21, but the API was changed to the
  110. one described here in 2.6.29.</para>
  111. <para>We recommended the <application>v4l2-dbg</application>
  112. utility over calling this ioctl directly. It is available from the
  113. LinuxTV v4l-dvb repository; see <ulink
  114. url="http://linuxtv.org/repo/">http://linuxtv.org/repo/</ulink> for
  115. access instructions.</para>
  116. <!-- Note for convenience vidioc-dbg-g-register.sgml
  117. contains a duplicate of this table. -->
  118. <table pgwide="1" frame="none" id="ident-v4l2-dbg-match">
  119. <title>struct <structname>v4l2_dbg_match</structname></title>
  120. <tgroup cols="4">
  121. &cs-ustr;
  122. <tbody valign="top">
  123. <row>
  124. <entry>__u32</entry>
  125. <entry><structfield>type</structfield></entry>
  126. <entry>See <xref linkend="ident-chip-match-types" /> for a list of
  127. possible types.</entry>
  128. </row>
  129. <row>
  130. <entry>union</entry>
  131. <entry>(anonymous)</entry>
  132. </row>
  133. <row>
  134. <entry></entry>
  135. <entry>__u32</entry>
  136. <entry><structfield>addr</structfield></entry>
  137. <entry>Match a chip by this number, interpreted according
  138. to the <structfield>type</structfield> field.</entry>
  139. </row>
  140. <row>
  141. <entry></entry>
  142. <entry>char</entry>
  143. <entry><structfield>name[32]</structfield></entry>
  144. <entry>Match a chip by this name, interpreted according
  145. to the <structfield>type</structfield> field.</entry>
  146. </row>
  147. </tbody>
  148. </tgroup>
  149. </table>
  150. <table pgwide="1" frame="none" id="v4l2-dbg-chip-ident">
  151. <title>struct <structname>v4l2_dbg_chip_ident</structname></title>
  152. <tgroup cols="3">
  153. &cs-str;
  154. <tbody valign="top">
  155. <row>
  156. <entry>struct v4l2_dbg_match</entry>
  157. <entry><structfield>match</structfield></entry>
  158. <entry>How to match the chip, see <xref linkend="ident-v4l2-dbg-match" />.</entry>
  159. </row>
  160. <row>
  161. <entry>__u32</entry>
  162. <entry><structfield>ident</structfield></entry>
  163. <entry>A chip identifier as defined in the Linux
  164. <filename>media/v4l2-chip-ident.h</filename> header file, or one of
  165. the values from <xref linkend="chip-ids" />.</entry>
  166. </row>
  167. <row>
  168. <entry>__u32</entry>
  169. <entry><structfield>revision</structfield></entry>
  170. <entry>A chip revision, chip and driver specific.</entry>
  171. </row>
  172. </tbody>
  173. </tgroup>
  174. </table>
  175. <!-- Note for convenience vidioc-dbg-g-register.sgml
  176. contains a duplicate of this table. -->
  177. <table pgwide="1" frame="none" id="ident-chip-match-types">
  178. <title>Chip Match Types</title>
  179. <tgroup cols="3">
  180. &cs-def;
  181. <tbody valign="top">
  182. <row>
  183. <entry><constant>V4L2_CHIP_MATCH_HOST</constant></entry>
  184. <entry>0</entry>
  185. <entry>Match the nth chip on the card, zero for the
  186. host chip. Does not match &i2c; chips.</entry>
  187. </row>
  188. <row>
  189. <entry><constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant></entry>
  190. <entry>1</entry>
  191. <entry>Match an &i2c; chip by its driver name.</entry>
  192. </row>
  193. <row>
  194. <entry><constant>V4L2_CHIP_MATCH_I2C_ADDR</constant></entry>
  195. <entry>2</entry>
  196. <entry>Match a chip by its 7 bit &i2c; bus address.</entry>
  197. </row>
  198. <row>
  199. <entry><constant>V4L2_CHIP_MATCH_AC97</constant></entry>
  200. <entry>3</entry>
  201. <entry>Match the nth anciliary AC97 chip.</entry>
  202. </row>
  203. </tbody>
  204. </tgroup>
  205. </table>
  206. <!-- This is an anonymous enum in media/v4l2-chip-ident.h. -->
  207. <table pgwide="1" frame="none" id="chip-ids">
  208. <title>Chip Identifiers</title>
  209. <tgroup cols="3">
  210. &cs-def;
  211. <tbody valign="top">
  212. <row>
  213. <entry><constant>V4L2_IDENT_NONE</constant></entry>
  214. <entry>0</entry>
  215. <entry>No chip matched.</entry>
  216. </row>
  217. <row>
  218. <entry><constant>V4L2_IDENT_AMBIGUOUS</constant></entry>
  219. <entry>1</entry>
  220. <entry>Multiple chips matched.</entry>
  221. </row>
  222. <row>
  223. <entry><constant>V4L2_IDENT_UNKNOWN</constant></entry>
  224. <entry>2</entry>
  225. <entry>A chip is present at this address, but the driver
  226. could not identify it.</entry>
  227. </row>
  228. </tbody>
  229. </tgroup>
  230. </table>
  231. </refsect1>
  232. <refsect1>
  233. &return-value;
  234. <variablelist>
  235. <varlistentry>
  236. <term><errorcode>EINVAL</errorcode></term>
  237. <listitem>
  238. <para>The <structfield>match_type</structfield> is invalid.</para>
  239. </listitem>
  240. </varlistentry>
  241. </variablelist>
  242. </refsect1>
  243. </refentry>