vidioc-dbg-g-chip-name.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <refentry id="vidioc-dbg-g-chip-name">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_DBG_G_CHIP_NAME</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_DBG_G_CHIP_NAME</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_name
  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_NAME</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-name;
  63. and call <constant>VIDIOC_DBG_G_CHIP_NAME</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_NAME</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_NAME</constant>,
  79. <structfield>match.name</structfield> contains the name of a sub-device.
  80. For instance
  81. <constant>"saa7127 6-0044"</constant> will match the saa7127 sub-device
  82. at the given i2c bus. This match type is not very useful for this ioctl
  83. and is here only for consistency.
  84. </para>
  85. <para>When <structfield>match.type</structfield> is
  86. <constant>V4L2_CHIP_MATCH_SUBDEV_IDX</constant>,
  87. <structfield>match.addr</structfield> selects the nth sub-device. This
  88. allows you to enumerate over all sub-devices.</para>
  89. <para>On success, the <structfield>name</structfield> field will
  90. contain a chip name and the <structfield>flags</structfield> field will
  91. contain <constant>V4L2_CHIP_FL_READABLE</constant> if the driver supports
  92. reading registers from the device or <constant>V4L2_CHIP_FL_WRITABLE</constant>
  93. if the driver supports writing registers to the device.</para>
  94. <para>We recommended the <application>v4l2-dbg</application>
  95. utility over calling this ioctl directly. It is available from the
  96. LinuxTV v4l-dvb repository; see <ulink
  97. url="http://linuxtv.org/repo/">http://linuxtv.org/repo/</ulink> for
  98. access instructions.</para>
  99. <!-- Note for convenience vidioc-dbg-g-register.sgml
  100. contains a duplicate of this table. -->
  101. <table pgwide="1" frame="none" id="name-v4l2-dbg-match">
  102. <title>struct <structname>v4l2_dbg_match</structname></title>
  103. <tgroup cols="4">
  104. &cs-ustr;
  105. <tbody valign="top">
  106. <row>
  107. <entry>__u32</entry>
  108. <entry><structfield>type</structfield></entry>
  109. <entry>See <xref linkend="name-chip-match-types" /> for a list of
  110. possible types.</entry>
  111. </row>
  112. <row>
  113. <entry>union</entry>
  114. <entry>(anonymous)</entry>
  115. </row>
  116. <row>
  117. <entry></entry>
  118. <entry>__u32</entry>
  119. <entry><structfield>addr</structfield></entry>
  120. <entry>Match a chip by this number, interpreted according
  121. to the <structfield>type</structfield> field.</entry>
  122. </row>
  123. <row>
  124. <entry></entry>
  125. <entry>char</entry>
  126. <entry><structfield>name[32]</structfield></entry>
  127. <entry>Match a chip by this name, interpreted according
  128. to the <structfield>type</structfield> field.</entry>
  129. </row>
  130. </tbody>
  131. </tgroup>
  132. </table>
  133. <table pgwide="1" frame="none" id="v4l2-dbg-chip-name">
  134. <title>struct <structname>v4l2_dbg_chip_name</structname></title>
  135. <tgroup cols="3">
  136. &cs-str;
  137. <tbody valign="top">
  138. <row>
  139. <entry>struct v4l2_dbg_match</entry>
  140. <entry><structfield>match</structfield></entry>
  141. <entry>How to match the chip, see <xref linkend="name-v4l2-dbg-match" />.</entry>
  142. </row>
  143. <row>
  144. <entry>char</entry>
  145. <entry><structfield>name[32]</structfield></entry>
  146. <entry>The name of the chip.</entry>
  147. </row>
  148. <row>
  149. <entry>__u32</entry>
  150. <entry><structfield>flags</structfield></entry>
  151. <entry>Set by the driver. If <constant>V4L2_CHIP_FL_READABLE</constant>
  152. is set, then the driver supports reading registers from the device. If
  153. <constant>V4L2_CHIP_FL_WRITABLE</constant> is set, then it supports writing registers.</entry>
  154. </row>
  155. <row>
  156. <entry>__u32</entry>
  157. <entry><structfield>reserved[8]</structfield></entry>
  158. <entry>Reserved fields, both application and driver must set these to 0.</entry>
  159. </row>
  160. </tbody>
  161. </tgroup>
  162. </table>
  163. <!-- Note for convenience vidioc-dbg-g-register.sgml
  164. contains a duplicate of this table. -->
  165. <table pgwide="1" frame="none" id="name-chip-match-types">
  166. <title>Chip Match Types</title>
  167. <tgroup cols="3">
  168. &cs-def;
  169. <tbody valign="top">
  170. <row>
  171. <entry><constant>V4L2_CHIP_MATCH_BRIDGE</constant></entry>
  172. <entry>0</entry>
  173. <entry>Match the nth chip on the card, zero for the
  174. bridge chip. Does not match sub-devices.</entry>
  175. </row>
  176. <row>
  177. <entry><constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant></entry>
  178. <entry>1</entry>
  179. <entry>Match an &i2c; chip by its driver name. Can't be used with this ioctl.</entry>
  180. </row>
  181. <row>
  182. <entry><constant>V4L2_CHIP_MATCH_I2C_ADDR</constant></entry>
  183. <entry>2</entry>
  184. <entry>Match a chip by its 7 bit &i2c; bus address. Can't be used with this ioctl.</entry>
  185. </row>
  186. <row>
  187. <entry><constant>V4L2_CHIP_MATCH_AC97</constant></entry>
  188. <entry>3</entry>
  189. <entry>Match the nth anciliary AC97 chip. Can't be used with this ioctl.</entry>
  190. </row>
  191. <row>
  192. <entry><constant>V4L2_CHIP_MATCH_SUBDEV_NAME</constant></entry>
  193. <entry>4</entry>
  194. <entry>Match the sub-device by name.</entry>
  195. </row>
  196. <row>
  197. <entry><constant>V4L2_CHIP_MATCH_SUBDEV_IDX</constant></entry>
  198. <entry>5</entry>
  199. <entry>Match the nth sub-device.</entry>
  200. </row>
  201. </tbody>
  202. </tgroup>
  203. </table>
  204. </refsect1>
  205. <refsect1>
  206. &return-value;
  207. <variablelist>
  208. <varlistentry>
  209. <term><errorcode>EINVAL</errorcode></term>
  210. <listitem>
  211. <para>The <structfield>match_type</structfield> is invalid or
  212. no device could be matched.</para>
  213. </listitem>
  214. </varlistentry>
  215. </variablelist>
  216. </refsect1>
  217. </refentry>