doc-rst: linux_tv: simplify references
[deliverable/linux.git] / Documentation / linux_tv / media / v4l / vidioc-s-hw-freq-seek.rst
CommitLineData
5377d91f
MH
1.. -*- coding: utf-8; mode: rst -*-
2
af4a4d0d 3.. _VIDIOC_S_HW_FREQ_SEEK:
5377d91f
MH
4
5***************************
6ioctl VIDIOC_S_HW_FREQ_SEEK
7***************************
8
9*man VIDIOC_S_HW_FREQ_SEEK(2)*
10
11Perform a hardware frequency seek
12
13
14Synopsis
15========
16
17.. c:function:: int ioctl( int fd, int request, struct v4l2_hw_freq_seek *argp )
18
19Arguments
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
31Description
32===========
33
34Start a hardware frequency seek from the current frequency. To do this
35applications initialize the ``tuner``, ``type``, ``seek_upward``,
36``wrap_around``, ``spacing``, ``rangelow`` and ``rangehigh`` fields, and
37zero 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
41The ``rangelow`` and ``rangehigh`` fields can be set to a non-zero value
42to 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
45within 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
48must exactly match those of one of the bands returned by
7347081e 49:ref:`VIDIOC_ENUM_FREQ_BANDS`. If the
5377d91f
MH
50current frequency of the tuner does not fall within the selected band it
51will be clamped to fit in the band before the seek is started.
52
53If an error is returned, then the original frequency will be restored.
54
55This ioctl is supported if the ``V4L2_CAP_HW_FREQ_SEEK`` capability is
56set.
57
58If this ioctl is called from a non-blocking filehandle, then EAGAIN
59error 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
77 :ref:`v4l2_input <v4l2-input>` ``tuner`` field and the struct
78 :ref:`v4l2_tuner <v4l2-tuner>` ``index`` field.
79
80 - .. row 2
81
82 - __u32
83
84 - ``type``
85
86 - The tuner type. This is the same value as in the struct
87 :ref:`v4l2_tuner <v4l2-tuner>` ``type`` field. See
88 :ref:`v4l2-tuner-type`
89
90 - .. row 3
91
92 - __u32
93
94 - ``seek_upward``
95
96 - If non-zero, seek upward from the current frequency, else seek
97 downward.
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,
106 else stop seeking. The struct :ref:`v4l2_tuner <v4l2-tuner>`
107 ``capability`` field will tell you what the hardware supports.
108
109 - .. row 5
110
111 - __u32
112
113 - ``spacing``
114
115 - If non-zero, defines the hardware seek resolution in Hz. The
116 driver selects the nearest value that is supported by the device.
117 If spacing is zero a reasonable default value is used.
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
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.
132
133 - .. row 7
134
135 - __u32
136
137 - ``rangehigh``
138
139 - If non-zero, the highest tunable frequency of the band to search
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.
146
147 - .. row 8
148
149 - __u32
150
151 - ``reserved``\ [5]
152
153 - Reserved for future extensions. Applications must set the array to
154 zero.
155
156
157
158Return Value
159============
160
161On success 0 is returned, on error -1 and the ``errno`` variable is set
162appropriately. The generic error codes are described at the
163:ref:`Generic Error Codes <gen-errors>` chapter.
164
165EINVAL
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
170EAGAIN
171 Attempted to call ``VIDIOC_S_HW_FREQ_SEEK`` with the filehandle in
172 non-blocking mode.
173
174ENODATA
175 The hardware seek found no channels.
176
177EBUSY
178 Another hardware seek is already in progress.
179
180
181.. ------------------------------------------------------------------------------
182.. This file was automatically converted from DocBook-XML with the dbxml
183.. library (https://github.com/return42/sphkerneldoc). The origin XML comes
184.. from the linux kernel, refer to:
185..
186.. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
187.. ------------------------------------------------------------------------------
This page took 0.032647 seconds and 5 git commands to generate.