1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ioctl VIDIOC_S_HW_FREQ_SEEK</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="user-func.html" title="Appendix&#160;A.&#160;Function Reference"><link rel="prev" href="vidioc-reqbufs.html" title="ioctl VIDIOC_REQBUFS"><link rel="next" href="vidioc-streamon.html" title="ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ioctl VIDIOC_S_HW_FREQ_SEEK</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="vidioc-reqbufs.html">Prev</a>&#160;</td><th width="60%" align="center">Appendix&#160;A.&#160;Function Reference</th><td width="20%" align="right">&#160;<a accesskey="n" href="vidioc-streamon.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="vidioc-s-hw-freq-seek"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>VIDIOC_S_HW_FREQ_SEEK &#8212; Perform a hardware frequency seek</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">ioctl</b>(</code></td><td>int <var class="pdparam">fd</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">request</var>, </td></tr><tr><td>&#160;</td><td>struct v4l2_hw_freq_seek
2*<var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1116311596"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fd</code></em></span></dt><dd><p>File descriptor returned by <a class="link" href="func-open.html" title="V4L2 open()"><code class="function">open()</code></a>.</p></dd><dt><span class="term"><em class="parameter"><code>request</code></em></span></dt><dd><p>VIDIOC_S_HW_FREQ_SEEK</p></dd><dt><span class="term"><em class="parameter"><code>argp</code></em></span></dt><dd><p></p></dd></dl></div></div><div class="refsect1"><a name="idp1116315692"></a><h2>Description</h2><p>Start a hardware frequency seek from the current frequency.
3To do this applications initialize the <em class="structfield"><code>tuner</code></em>,
4<em class="structfield"><code>type</code></em>, <em class="structfield"><code>seek_upward</code></em>,
5<em class="structfield"><code>wrap_around</code></em>, <em class="structfield"><code>spacing</code></em>,
6<em class="structfield"><code>rangelow</code></em> and <em class="structfield"><code>rangehigh</code></em>
7fields, and zero out the <em class="structfield"><code>reserved</code></em> array of a
8struct&#160;<a class="link" href="vidioc-s-hw-freq-seek.html#v4l2-hw-freq-seek" title="Table&#160;A.101.&#160;struct v4l2_hw_freq_seek">v4l2_hw_freq_seek</a> and call the <code class="constant">VIDIOC_S_HW_FREQ_SEEK</code>
9ioctl with a pointer to this structure.</p><p>The <em class="structfield"><code>rangelow</code></em> and
10<em class="structfield"><code>rangehigh</code></em> fields can be set to a non-zero value to
11tell the driver to search a specific band. If the struct&#160;<a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table&#160;A.87.&#160;struct v4l2_tuner">v4l2_tuner</a>
12<em class="structfield"><code>capability</code></em> field has the
13<code class="constant">V4L2_TUNER_CAP_HWSEEK_PROG_LIM</code> flag set, these values
14must fall within one of the bands returned by <a class="link" href="vidioc-enum-freq-bands.html" title="ioctl VIDIOC_ENUM_FREQ_BANDS"><code class="constant">VIDIOC_ENUM_FREQ_BANDS</code></a>. If
15the <code class="constant">V4L2_TUNER_CAP_HWSEEK_PROG_LIM</code> flag is not set,
16then these values must exactly match those of one of the bands returned by
17<a class="link" href="vidioc-enum-freq-bands.html" title="ioctl VIDIOC_ENUM_FREQ_BANDS"><code class="constant">VIDIOC_ENUM_FREQ_BANDS</code></a>. If the current frequency of the tuner does not fall
18within the selected band it will be clamped to fit in the band before the
19seek is started.</p><p>If an error is returned, then the original frequency will
20    be restored.</p><p>This ioctl is supported if the <code class="constant">V4L2_CAP_HW_FREQ_SEEK</code> capability is set.</p><p>If this ioctl is called from a non-blocking filehandle, then <span class="errorcode">EAGAIN</span> error code is
21    returned and no seek takes place.</p><div class="table"><a name="v4l2-hw-freq-seek"></a><p class="title"><b>Table&#160;A.101.&#160;struct <span class="structname">v4l2_hw_freq_seek</span></b></p><div class="table-contents"><table summary="struct v4l2_hw_freq_seek" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>tuner</code></em></td><td valign="top">The tuner index number. This is the
22same value as in the struct&#160;<a class="link" href="vidioc-enuminput.html#v4l2-input" title="Table&#160;A.39.&#160;struct v4l2_input">v4l2_input</a> <em class="structfield"><code>tuner</code></em>
23field and the struct&#160;<a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table&#160;A.87.&#160;struct v4l2_tuner">v4l2_tuner</a> <em class="structfield"><code>index</code></em> field.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>type</code></em></td><td valign="top">The tuner type. This is the same value as in the
24struct&#160;<a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table&#160;A.87.&#160;struct v4l2_tuner">v4l2_tuner</a> <em class="structfield"><code>type</code></em> field. See <a class="xref" href="vidioc-g-tuner.html#v4l2-tuner-type" title="Table&#160;A.88.&#160;enum v4l2_tuner_type">Table&#160;A.88, &#8220;enum v4l2_tuner_type&#8221;</a></td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>seek_upward</code></em></td><td valign="top">If non-zero, seek upward from the current frequency, else seek downward.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>wrap_around</code></em></td><td valign="top">If non-zero, wrap around when at the end of the frequency range, else stop seeking.
25	    The struct&#160;<a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table&#160;A.87.&#160;struct v4l2_tuner">v4l2_tuner</a> <em class="structfield"><code>capability</code></em> field will tell you what the
26	    hardware supports.
27	    </td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>spacing</code></em></td><td valign="top">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.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>rangelow</code></em></td><td valign="top">If non-zero, the lowest tunable frequency of the band to
28search in units of 62.5 kHz, or if the struct&#160;<a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table&#160;A.87.&#160;struct v4l2_tuner">v4l2_tuner</a>
29<em class="structfield"><code>capability</code></em> field has the
30<code class="constant">V4L2_TUNER_CAP_LOW</code> flag set, in units of 62.5 Hz or if the struct&#160;<a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table&#160;A.87.&#160;struct v4l2_tuner">v4l2_tuner</a>
31<em class="structfield"><code>capability</code></em> field has the
32<code class="constant">V4L2_TUNER_CAP_1HZ</code> flag set, in units of 1 Hz.
33If <em class="structfield"><code>rangelow</code></em> is zero a reasonable default value
34is used.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>rangehigh</code></em></td><td valign="top">If non-zero, the highest tunable frequency of the band to
35search in units of 62.5 kHz, or if the struct&#160;<a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table&#160;A.87.&#160;struct v4l2_tuner">v4l2_tuner</a>
36<em class="structfield"><code>capability</code></em> field has the
37<code class="constant">V4L2_TUNER_CAP_LOW</code> flag set, in units of 62.5 Hz or if the struct&#160;<a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table&#160;A.87.&#160;struct v4l2_tuner">v4l2_tuner</a>
38<em class="structfield"><code>capability</code></em> field has the
39<code class="constant">V4L2_TUNER_CAP_1HZ</code> flag set, in units of 1 Hz.
40If <em class="structfield"><code>rangehigh</code></em> is zero a reasonable default value
41is used.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>reserved</code></em>[5]</td><td valign="top">Reserved for future extensions. Applications
42	    must set the array to zero.</td></tr></tbody></table></div></div><br class="table-break"></div><div class="refsect1"><a name="idp1116341340"></a><h2>Return Value</h2><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">EINVAL</span></span></dt><dd><p>The <em class="structfield"><code>tuner</code></em> index is out of
43bounds, the <em class="structfield"><code>wrap_around</code></em> value is not supported or
44one of the values in the <em class="structfield"><code>type</code></em>,
45<em class="structfield"><code>rangelow</code></em> or <em class="structfield"><code>rangehigh</code></em>
46fields is wrong.</p></dd><dt><span class="term"><span class="errorcode">EAGAIN</span></span></dt><dd><p>Attempted to call <code class="constant">VIDIOC_S_HW_FREQ_SEEK</code>
47	  with the filehandle in non-blocking mode.</p></dd><dt><span class="term"><span class="errorcode">ENODATA</span></span></dt><dd><p>The hardware seek found no channels.</p></dd><dt><span class="term"><span class="errorcode">EBUSY</span></span></dt><dd><p>Another hardware seek is already in progress.</p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="vidioc-reqbufs.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="user-func.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="vidioc-streamon.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl VIDIOC_REQBUFS&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF</td></tr></table></div></body></html>
48