Merge remote-tracking branch 'battery/for-next'
[deliverable/linux.git] / Documentation / media / uapi / 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
15e7d615 9Name
586027ce 10====
5377d91f 11
586027ce 12VIDIOC_S_HW_FREQ_SEEK - Perform a hardware frequency seek
5377d91f 13
15e7d615
MCC
14
15Synopsis
5377d91f
MH
16========
17
41d80465
MCC
18.. c:function:: int ioctl( int fd, VIDIOC_S_HW_FREQ_SEEK, struct v4l2_hw_freq_seek *argp )
19 :name: VIDIOC_S_HW_FREQ_SEEK
5377d91f 20
586027ce 21
15e7d615 22Arguments
5377d91f
MH
23=========
24
25``fd``
26 File descriptor returned by :ref:`open() <func-open>`.
27
5377d91f
MH
28``argp``
29
30
15e7d615 31Description
5377d91f
MH
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
e8be7e97 38:c:type:`v4l2_hw_freq_seek` and call the
5377d91f
MH
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
e8be7e97 43:c:type:`v4l2_tuner` ``capability`` field has the
5377d91f
MH
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
cdb4af0f 58If this ioctl is called from a non-blocking filehandle, then ``EAGAIN``
5377d91f
MH
59error code is returned and no seek takes place.
60
61
5bd4bb78
MCC
62.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
63
e8be7e97 64.. c:type:: v4l2_hw_freq_seek
fa92b04d 65
5377d91f
MH
66.. flat-table:: struct v4l2_hw_freq_seek
67 :header-rows: 0
68 :stub-columns: 0
69 :widths: 1 1 2
70
71
72 - .. row 1
73
74 - __u32
75
76 - ``tuner``
77
78 - The tuner index number. This is the same value as in the struct
e8be7e97
MCC
79 :c:type:`v4l2_input` ``tuner`` field and the struct
80 :c:type:`v4l2_tuner` ``index`` field.
5377d91f
MH
81
82 - .. row 2
83
84 - __u32
85
86 - ``type``
87
88 - The tuner type. This is the same value as in the struct
e8be7e97 89 :c:type:`v4l2_tuner` ``type`` field. See
56683d7d 90 :c:type:`v4l2_tuner_type`
5377d91f
MH
91
92 - .. row 3
93
94 - __u32
95
96 - ``seek_upward``
97
98 - If non-zero, seek upward from the current frequency, else seek
0579e6e3 99 downward.
5377d91f
MH
100
101 - .. row 4
102
103 - __u32
104
105 - ``wrap_around``
106
107 - If non-zero, wrap around when at the end of the frequency range,
e8be7e97 108 else stop seeking. The struct :c:type:`v4l2_tuner`
0579e6e3 109 ``capability`` field will tell you what the hardware supports.
5377d91f
MH
110
111 - .. row 5
112
113 - __u32
114
115 - ``spacing``
116
117 - If non-zero, defines the hardware seek resolution in Hz. The
0579e6e3
MCC
118 driver selects the nearest value that is supported by the device.
119 If spacing is zero a reasonable default value is used.
5377d91f
MH
120
121 - .. row 6
122
123 - __u32
124
125 - ``rangelow``
126
127 - If non-zero, the lowest tunable frequency of the band to search in
0579e6e3 128 units of 62.5 kHz, or if the struct
e8be7e97 129 :c:type:`v4l2_tuner` ``capability`` field has the
0579e6e3 130 ``V4L2_TUNER_CAP_LOW`` flag set, in units of 62.5 Hz or if the
e8be7e97 131 struct :c:type:`v4l2_tuner` ``capability`` field has
0579e6e3
MCC
132 the ``V4L2_TUNER_CAP_1HZ`` flag set, in units of 1 Hz. If
133 ``rangelow`` is zero a reasonable default value is used.
5377d91f
MH
134
135 - .. row 7
136
137 - __u32
138
139 - ``rangehigh``
140
141 - If non-zero, the highest tunable frequency of the band to search
0579e6e3 142 in units of 62.5 kHz, or if the struct
e8be7e97 143 :c:type:`v4l2_tuner` ``capability`` field has the
0579e6e3 144 ``V4L2_TUNER_CAP_LOW`` flag set, in units of 62.5 Hz or if the
e8be7e97 145 struct :c:type:`v4l2_tuner` ``capability`` field has
0579e6e3
MCC
146 the ``V4L2_TUNER_CAP_1HZ`` flag set, in units of 1 Hz. If
147 ``rangehigh`` is zero a reasonable default value is used.
5377d91f
MH
148
149 - .. row 8
150
151 - __u32
152
8968da9b 153 - ``reserved``\ [5]
5377d91f
MH
154
155 - Reserved for future extensions. Applications must set the array to
0579e6e3 156 zero.
5377d91f
MH
157
158
15e7d615 159Return Value
5377d91f
MH
160============
161
162On success 0 is returned, on error -1 and the ``errno`` variable is set
163appropriately. The generic error codes are described at the
164:ref:`Generic Error Codes <gen-errors>` chapter.
165
166EINVAL
167 The ``tuner`` index is out of bounds, the ``wrap_around`` value is
168 not supported or one of the values in the ``type``, ``rangelow`` or
169 ``rangehigh`` fields is wrong.
170
171EAGAIN
172 Attempted to call ``VIDIOC_S_HW_FREQ_SEEK`` with the filehandle in
173 non-blocking mode.
174
175ENODATA
176 The hardware seek found no channels.
177
178EBUSY
179 Another hardware seek is already in progress.
This page took 0.064936 seconds and 5 git commands to generate.