Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
af4a4d0d | 3 | .. _VIDIOC_S_HW_FREQ_SEEK: |
5377d91f MH |
4 | |
5 | *************************** | |
6 | ioctl VIDIOC_S_HW_FREQ_SEEK | |
7 | *************************** | |
8 | ||
9 | *man VIDIOC_S_HW_FREQ_SEEK(2)* | |
10 | ||
11 | Perform a hardware frequency seek | |
12 | ||
13 | ||
14 | Synopsis | |
15 | ======== | |
16 | ||
b7e67f6c | 17 | .. cpp:function:: int ioctl( int fd, int request, struct v4l2_hw_freq_seek *argp ) |
5377d91f MH |
18 | |
19 | Arguments | |
20 | ========= | |
21 | ||
22 | ``fd`` | |
23 | File descriptor returned by :ref:`open() <func-open>`. | |
24 | ||
25 | ``request`` | |
26 | VIDIOC_S_HW_FREQ_SEEK | |
27 | ||
28 | ``argp`` | |
29 | ||
30 | ||
31 | Description | |
32 | =========== | |
33 | ||
34 | Start a hardware frequency seek from the current frequency. To do this | |
35 | applications initialize the ``tuner``, ``type``, ``seek_upward``, | |
36 | ``wrap_around``, ``spacing``, ``rangelow`` and ``rangehigh`` fields, and | |
37 | zero out the ``reserved`` array of a struct | |
38 | :ref:`v4l2_hw_freq_seek <v4l2-hw-freq-seek>` and call the | |
39 | ``VIDIOC_S_HW_FREQ_SEEK`` ioctl with a pointer to this structure. | |
40 | ||
41 | The ``rangelow`` and ``rangehigh`` fields can be set to a non-zero value | |
42 | to tell the driver to search a specific band. If the struct | |
43 | :ref:`v4l2_tuner <v4l2-tuner>` ``capability`` field has the | |
44 | ``V4L2_TUNER_CAP_HWSEEK_PROG_LIM`` flag set, these values must fall | |
45 | within one of the bands returned by | |
7347081e | 46 | :ref:`VIDIOC_ENUM_FREQ_BANDS`. If the |
5377d91f MH |
47 | ``V4L2_TUNER_CAP_HWSEEK_PROG_LIM`` flag is not set, then these values |
48 | must exactly match those of one of the bands returned by | |
7347081e | 49 | :ref:`VIDIOC_ENUM_FREQ_BANDS`. If the |
5377d91f MH |
50 | current frequency of the tuner does not fall within the selected band it |
51 | will be clamped to fit in the band before the seek is started. | |
52 | ||
53 | If an error is returned, then the original frequency will be restored. | |
54 | ||
55 | This ioctl is supported if the ``V4L2_CAP_HW_FREQ_SEEK`` capability is | |
56 | set. | |
57 | ||
cdb4af0f | 58 | If this ioctl is called from a non-blocking filehandle, then ``EAGAIN`` |
5377d91f MH |
59 | error code is returned and no seek takes place. |
60 | ||
61 | ||
62 | .. _v4l2-hw-freq-seek: | |
63 | ||
64 | .. flat-table:: struct v4l2_hw_freq_seek | |
65 | :header-rows: 0 | |
66 | :stub-columns: 0 | |
67 | :widths: 1 1 2 | |
68 | ||
69 | ||
70 | - .. row 1 | |
71 | ||
72 | - __u32 | |
73 | ||
74 | - ``tuner`` | |
75 | ||
76 | - The tuner index number. This is the same value as in the struct | |
0579e6e3 MCC |
77 | :ref:`v4l2_input <v4l2-input>` ``tuner`` field and the struct |
78 | :ref:`v4l2_tuner <v4l2-tuner>` ``index`` field. | |
5377d91f MH |
79 | |
80 | - .. row 2 | |
81 | ||
82 | - __u32 | |
83 | ||
84 | - ``type`` | |
85 | ||
86 | - The tuner type. This is the same value as in the struct | |
0579e6e3 MCC |
87 | :ref:`v4l2_tuner <v4l2-tuner>` ``type`` field. See |
88 | :ref:`v4l2-tuner-type` | |
5377d91f MH |
89 | |
90 | - .. row 3 | |
91 | ||
92 | - __u32 | |
93 | ||
94 | - ``seek_upward`` | |
95 | ||
96 | - If non-zero, seek upward from the current frequency, else seek | |
0579e6e3 | 97 | downward. |
5377d91f MH |
98 | |
99 | - .. row 4 | |
100 | ||
101 | - __u32 | |
102 | ||
103 | - ``wrap_around`` | |
104 | ||
105 | - If non-zero, wrap around when at the end of the frequency range, | |
0579e6e3 MCC |
106 | else stop seeking. The struct :ref:`v4l2_tuner <v4l2-tuner>` |
107 | ``capability`` field will tell you what the hardware supports. | |
5377d91f MH |
108 | |
109 | - .. row 5 | |
110 | ||
111 | - __u32 | |
112 | ||
113 | - ``spacing`` | |
114 | ||
115 | - If non-zero, defines the hardware seek resolution in Hz. The | |
0579e6e3 MCC |
116 | driver selects the nearest value that is supported by the device. |
117 | If spacing is zero a reasonable default value is used. | |
5377d91f MH |
118 | |
119 | - .. row 6 | |
120 | ||
121 | - __u32 | |
122 | ||
123 | - ``rangelow`` | |
124 | ||
125 | - If non-zero, the lowest tunable frequency of the band to search in | |
0579e6e3 MCC |
126 | units of 62.5 kHz, or if the struct |
127 | :ref:`v4l2_tuner <v4l2-tuner>` ``capability`` field has the | |
128 | ``V4L2_TUNER_CAP_LOW`` flag set, in units of 62.5 Hz or if the | |
129 | struct :ref:`v4l2_tuner <v4l2-tuner>` ``capability`` field has | |
130 | the ``V4L2_TUNER_CAP_1HZ`` flag set, in units of 1 Hz. If | |
131 | ``rangelow`` is zero a reasonable default value is used. | |
5377d91f MH |
132 | |
133 | - .. row 7 | |
134 | ||
135 | - __u32 | |
136 | ||
137 | - ``rangehigh`` | |
138 | ||
139 | - If non-zero, the highest tunable frequency of the band to search | |
0579e6e3 MCC |
140 | in units of 62.5 kHz, or if the struct |
141 | :ref:`v4l2_tuner <v4l2-tuner>` ``capability`` field has the | |
142 | ``V4L2_TUNER_CAP_LOW`` flag set, in units of 62.5 Hz or if the | |
143 | struct :ref:`v4l2_tuner <v4l2-tuner>` ``capability`` field has | |
144 | the ``V4L2_TUNER_CAP_1HZ`` flag set, in units of 1 Hz. If | |
145 | ``rangehigh`` is zero a reasonable default value is used. | |
5377d91f MH |
146 | |
147 | - .. row 8 | |
148 | ||
149 | - __u32 | |
150 | ||
151 | - ``reserved``\ [5] | |
152 | ||
153 | - Reserved for future extensions. Applications must set the array to | |
0579e6e3 | 154 | zero. |
5377d91f MH |
155 | |
156 | ||
157 | ||
158 | Return Value | |
159 | ============ | |
160 | ||
161 | On success 0 is returned, on error -1 and the ``errno`` variable is set | |
162 | appropriately. The generic error codes are described at the | |
163 | :ref:`Generic Error Codes <gen-errors>` chapter. | |
164 | ||
165 | EINVAL | |
166 | The ``tuner`` index is out of bounds, the ``wrap_around`` value is | |
167 | not supported or one of the values in the ``type``, ``rangelow`` or | |
168 | ``rangehigh`` fields is wrong. | |
169 | ||
170 | EAGAIN | |
171 | Attempted to call ``VIDIOC_S_HW_FREQ_SEEK`` with the filehandle in | |
172 | non-blocking mode. | |
173 | ||
174 | ENODATA | |
175 | The hardware seek found no channels. | |
176 | ||
177 | EBUSY | |
178 | Another hardware seek is already in progress. |