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

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