vidioc-g-frequency.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <refentry id="vidioc-g-frequency">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_G_FREQUENCY</refname>
  8. <refname>VIDIOC_S_FREQUENCY</refname>
  9. <refpurpose>Get or set tuner or modulator radio
  10. frequency</refpurpose>
  11. </refnamediv>
  12. <refsynopsisdiv>
  13. <funcsynopsis>
  14. <funcprototype>
  15. <funcdef>int <function>ioctl</function></funcdef>
  16. <paramdef>int <parameter>fd</parameter></paramdef>
  17. <paramdef>int <parameter>request</parameter></paramdef>
  18. <paramdef>struct v4l2_frequency
  19. *<parameter>argp</parameter></paramdef>
  20. </funcprototype>
  21. </funcsynopsis>
  22. <funcsynopsis>
  23. <funcprototype>
  24. <funcdef>int <function>ioctl</function></funcdef>
  25. <paramdef>int <parameter>fd</parameter></paramdef>
  26. <paramdef>int <parameter>request</parameter></paramdef>
  27. <paramdef>const struct v4l2_frequency
  28. *<parameter>argp</parameter></paramdef>
  29. </funcprototype>
  30. </funcsynopsis>
  31. </refsynopsisdiv>
  32. <refsect1>
  33. <title>Arguments</title>
  34. <variablelist>
  35. <varlistentry>
  36. <term><parameter>fd</parameter></term>
  37. <listitem>
  38. <para>&fd;</para>
  39. </listitem>
  40. </varlistentry>
  41. <varlistentry>
  42. <term><parameter>request</parameter></term>
  43. <listitem>
  44. <para>VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</para>
  45. </listitem>
  46. </varlistentry>
  47. <varlistentry>
  48. <term><parameter>argp</parameter></term>
  49. <listitem>
  50. <para></para>
  51. </listitem>
  52. </varlistentry>
  53. </variablelist>
  54. </refsect1>
  55. <refsect1>
  56. <title>Description</title>
  57. <para>To get the current tuner or modulator radio frequency
  58. applications set the <structfield>tuner</structfield> field of a
  59. &v4l2-frequency; to the respective tuner or modulator number (only
  60. input devices have tuners, only output devices have modulators), zero
  61. out the <structfield>reserved</structfield> array and
  62. call the <constant>VIDIOC_G_FREQUENCY</constant> ioctl with a pointer
  63. to this structure. The driver stores the current frequency in the
  64. <structfield>frequency</structfield> field.</para>
  65. <para>To change the current tuner or modulator radio frequency
  66. applications initialize the <structfield>tuner</structfield>,
  67. <structfield>type</structfield> and
  68. <structfield>frequency</structfield> fields, and the
  69. <structfield>reserved</structfield> array of a &v4l2-frequency; and
  70. call the <constant>VIDIOC_S_FREQUENCY</constant> ioctl with a pointer
  71. to this structure. When the requested frequency is not possible the
  72. driver assumes the closest possible value. However
  73. <constant>VIDIOC_S_FREQUENCY</constant> is a write-only ioctl, it does
  74. not return the actual new frequency.</para>
  75. <table pgwide="1" frame="none" id="v4l2-frequency">
  76. <title>struct <structname>v4l2_frequency</structname></title>
  77. <tgroup cols="3">
  78. &cs-str;
  79. <tbody valign="top">
  80. <row>
  81. <entry>__u32</entry>
  82. <entry><structfield>tuner</structfield></entry>
  83. <entry>The tuner or modulator index number. This is the
  84. same value as in the &v4l2-input; <structfield>tuner</structfield>
  85. field and the &v4l2-tuner; <structfield>index</structfield> field, or
  86. the &v4l2-output; <structfield>modulator</structfield> field and the
  87. &v4l2-modulator; <structfield>index</structfield> field.</entry>
  88. </row>
  89. <row>
  90. <entry>&v4l2-tuner-type;</entry>
  91. <entry><structfield>type</structfield></entry>
  92. <entry>The tuner type. This is the same value as in the
  93. &v4l2-tuner; <structfield>type</structfield> field. The type must be set
  94. to <constant>V4L2_TUNER_RADIO</constant> for <filename>/dev/radioX</filename>
  95. device nodes, and to <constant>V4L2_TUNER_ANALOG_TV</constant>
  96. for all others. The field is not applicable to modulators, &ie; ignored
  97. by drivers.</entry>
  98. </row>
  99. <row>
  100. <entry>__u32</entry>
  101. <entry><structfield>frequency</structfield></entry>
  102. <entry>Tuning frequency in units of 62.5 kHz, or if the
  103. &v4l2-tuner; or &v4l2-modulator; <structfield>capabilities</structfield> flag
  104. <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
  105. Hz.</entry>
  106. </row>
  107. <row>
  108. <entry>__u32</entry>
  109. <entry><structfield>reserved</structfield>[8]</entry>
  110. <entry>Reserved for future extensions. Drivers and
  111. applications must set the array to zero.</entry>
  112. </row>
  113. </tbody>
  114. </tgroup>
  115. </table>
  116. </refsect1>
  117. <refsect1>
  118. &return-value;
  119. <variablelist>
  120. <varlistentry>
  121. <term><errorcode>EINVAL</errorcode></term>
  122. <listitem>
  123. <para>The <structfield>tuner</structfield> index is out of
  124. bounds or the value in the <structfield>type</structfield> field is
  125. wrong.</para>
  126. </listitem>
  127. </varlistentry>
  128. </variablelist>
  129. </refsect1>
  130. </refentry>