1 <refentry id="vidioc-s-hw-freq-seek">
3 <refentrytitle>ioctl VIDIOC_S_HW_FREQ_SEEK</refentrytitle>
8 <refname>VIDIOC_S_HW_FREQ_SEEK</refname>
9 <refpurpose>Perform a hardware frequency seek</refpurpose>
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_hw_freq_seek
19 *<parameter>argp</parameter></paramdef>
25 <title>Arguments</title>
29 <term><parameter>fd</parameter></term>
35 <term><parameter>request</parameter></term>
37 <para>VIDIOC_S_HW_FREQ_SEEK</para>
41 <term><parameter>argp</parameter></term>
50 <title>Description</title>
52 <para>Start a hardware frequency seek from the current frequency.
53 To do this applications initialize the <structfield>tuner</structfield>,
54 <structfield>type</structfield>, <structfield>seek_upward</structfield>,
55 <structfield>wrap_around</structfield>, <structfield>spacing</structfield>,
56 <structfield>rangelow</structfield> and <structfield>rangehigh</structfield>
57 fields, and zero out the <structfield>reserved</structfield> array of a
58 &v4l2-hw-freq-seek; and call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant>
59 ioctl with a pointer to this structure.</para>
61 <para>The <structfield>rangelow</structfield> and
62 <structfield>rangehigh</structfield> fields can be set to a non-zero value to
63 tell the driver to search a specific band. If the &v4l2-tuner;
64 <structfield>capability</structfield> field has the
65 <constant>V4L2_TUNER_CAP_HWSEEK_PROG_LIM</constant> flag set, these values
66 must fall within one of the bands returned by &VIDIOC-ENUM-FREQ-BANDS;. If
67 the <constant>V4L2_TUNER_CAP_HWSEEK_PROG_LIM</constant> flag is not set,
68 then these values must exactly match those of one of the bands returned by
69 &VIDIOC-ENUM-FREQ-BANDS;. If the current frequency of the tuner does not fall
70 within the selected band it will be clamped to fit in the band before the
71 seek is started.</para>
73 <para>If an error is returned, then the original frequency will
76 <para>This ioctl is supported if the <constant>V4L2_CAP_HW_FREQ_SEEK</constant> capability is set.</para>
78 <table pgwide="1" frame="none" id="v4l2-hw-freq-seek">
79 <title>struct <structname>v4l2_hw_freq_seek</structname></title>
85 <entry><structfield>tuner</structfield></entry>
86 <entry>The tuner index number. This is the
87 same value as in the &v4l2-input; <structfield>tuner</structfield>
88 field and the &v4l2-tuner; <structfield>index</structfield> field.</entry>
92 <entry><structfield>type</structfield></entry>
93 <entry>The tuner type. This is the same value as in the
94 &v4l2-tuner; <structfield>type</structfield> field. See <xref
95 linkend="v4l2-tuner-type" /></entry>
99 <entry><structfield>seek_upward</structfield></entry>
100 <entry>If non-zero, seek upward from the current frequency, else seek downward.</entry>
104 <entry><structfield>wrap_around</structfield></entry>
105 <entry>If non-zero, wrap around when at the end of the frequency range, else stop seeking.
106 The &v4l2-tuner; <structfield>capability</structfield> field will tell you what the
112 <entry><structfield>spacing</structfield></entry>
113 <entry>If non-zero, defines the hardware seek resolution in Hz. The driver selects the nearest value that is supported by the device. If spacing is zero a reasonable default value is used.</entry>
117 <entry><structfield>rangelow</structfield></entry>
118 <entry>If non-zero, the lowest tunable frequency of the band to
119 search in units of 62.5 kHz, or if the &v4l2-tuner;
120 <structfield>capability</structfield> field has the
121 <constant>V4L2_TUNER_CAP_LOW</constant> flag set, in units of 62.5 Hz.
122 If <structfield>rangelow</structfield> is zero a reasonable default value
127 <entry><structfield>rangehigh</structfield></entry>
128 <entry>If non-zero, the highest tunable frequency of the band to
129 search in units of 62.5 kHz, or if the &v4l2-tuner;
130 <structfield>capability</structfield> field has the
131 <constant>V4L2_TUNER_CAP_LOW</constant> flag set, in units of 62.5 Hz.
132 If <structfield>rangehigh</structfield> is zero a reasonable default value
137 <entry><structfield>reserved</structfield>[5]</entry>
138 <entry>Reserved for future extensions. Applications
139 must set the array to zero.</entry>
151 <term><errorcode>EINVAL</errorcode></term>
153 <para>The <structfield>tuner</structfield> index is out of
154 bounds, the <structfield>wrap_around</structfield> value is not supported or
155 one of the values in the <structfield>type</structfield>,
156 <structfield>rangelow</structfield> or <structfield>rangehigh</structfield>
157 fields is wrong.</para>
161 <term><errorcode>ENODATA</errorcode></term>
163 <para>The hardware seek found no channels.</para>
167 <term><errorcode>EBUSY</errorcode></term>
169 <para>Another hardware seek is already in progress.</para>