1 <refentry id="vidioc-g-frequency">
3 <refentrytitle>ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</refentrytitle>
8 <refname>VIDIOC_G_FREQUENCY</refname>
9 <refname>VIDIOC_S_FREQUENCY</refname>
10 <refpurpose>Get or set tuner or modulator radio
11 frequency</refpurpose>
17 <funcdef>int <function>ioctl</function></funcdef>
18 <paramdef>int <parameter>fd</parameter></paramdef>
19 <paramdef>int <parameter>request</parameter></paramdef>
20 <paramdef>struct v4l2_frequency
21 *<parameter>argp</parameter></paramdef>
26 <funcdef>int <function>ioctl</function></funcdef>
27 <paramdef>int <parameter>fd</parameter></paramdef>
28 <paramdef>int <parameter>request</parameter></paramdef>
29 <paramdef>const struct v4l2_frequency
30 *<parameter>argp</parameter></paramdef>
36 <title>Arguments</title>
40 <term><parameter>fd</parameter></term>
46 <term><parameter>request</parameter></term>
48 <para>VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</para>
52 <term><parameter>argp</parameter></term>
61 <title>Description</title>
63 <para>To get the current tuner or modulator radio frequency
64 applications set the <structfield>tuner</structfield> field of a
65 &v4l2-frequency; to the respective tuner or modulator number (only
66 input devices have tuners, only output devices have modulators), zero
67 out the <structfield>reserved</structfield> array and
68 call the <constant>VIDIOC_G_FREQUENCY</constant> ioctl with a pointer
69 to this structure. The driver stores the current frequency in the
70 <structfield>frequency</structfield> field.</para>
72 <para>To change the current tuner or modulator radio frequency
73 applications initialize the <structfield>tuner</structfield>,
74 <structfield>type</structfield> and
75 <structfield>frequency</structfield> fields, and the
76 <structfield>reserved</structfield> array of a &v4l2-frequency; and
77 call the <constant>VIDIOC_S_FREQUENCY</constant> ioctl with a pointer
78 to this structure. When the requested frequency is not possible the
79 driver assumes the closest possible value. However
80 <constant>VIDIOC_S_FREQUENCY</constant> is a write-only ioctl, it does
81 not return the actual new frequency.</para>
83 <table pgwide="1" frame="none" id="v4l2-frequency">
84 <title>struct <structname>v4l2_frequency</structname></title>
90 <entry><structfield>tuner</structfield></entry>
91 <entry>The tuner or modulator index number. This is the
92 same value as in the &v4l2-input; <structfield>tuner</structfield>
93 field and the &v4l2-tuner; <structfield>index</structfield> field, or
94 the &v4l2-output; <structfield>modulator</structfield> field and the
95 &v4l2-modulator; <structfield>index</structfield> field.</entry>
98 <entry>&v4l2-tuner-type;</entry>
99 <entry><structfield>type</structfield></entry>
100 <entry>The tuner type. This is the same value as in the
101 &v4l2-tuner; <structfield>type</structfield> field. The field is not
102 applicable to modulators, &ie; ignored by drivers.</entry>
106 <entry><structfield>frequency</structfield></entry>
107 <entry>Tuning frequency in units of 62.5 kHz, or if the
108 &v4l2-tuner; or &v4l2-modulator; <structfield>capabilities</structfield> flag
109 <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
114 <entry><structfield>reserved</structfield>[8]</entry>
115 <entry>Reserved for future extensions. Drivers and
116 applications must set the array to zero.</entry>
128 <term><errorcode>EINVAL</errorcode></term>
130 <para>The <structfield>tuner</structfield> index is out of
131 bounds or the value in the <structfield>type</structfield> field is
142 sgml-parent-document: "v4l2.sgml"
143 indent-tabs-mode: nil