^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) .. c:namespace:: V4L
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) .. _VIDIOC_S_HW_FREQ_SEEK:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) ***************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) ioctl VIDIOC_S_HW_FREQ_SEEK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) ***************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) ====
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) VIDIOC_S_HW_FREQ_SEEK - Perform a hardware frequency seek
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Synopsis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) .. c:macro:: VIDIOC_S_HW_FREQ_SEEK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) ``int ioctl(int fd, VIDIOC_S_HW_FREQ_SEEK, struct v4l2_hw_freq_seek *argp)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) Arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) ``fd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) File descriptor returned by :c:func:`open()`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) ``argp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) Pointer to struct :c:type:`v4l2_hw_freq_seek`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) ===========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) Start a hardware frequency seek from the current frequency. To do this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) applications initialize the ``tuner``, ``type``, ``seek_upward``,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) ``wrap_around``, ``spacing``, ``rangelow`` and ``rangehigh`` fields, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) zero out the ``reserved`` array of a struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) :c:type:`v4l2_hw_freq_seek` and call the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) ``VIDIOC_S_HW_FREQ_SEEK`` ioctl with a pointer to this structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) The ``rangelow`` and ``rangehigh`` fields can be set to a non-zero value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) to tell the driver to search a specific band. If the struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) :c:type:`v4l2_tuner` ``capability`` field has the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) ``V4L2_TUNER_CAP_HWSEEK_PROG_LIM`` flag set, these values must fall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) within one of the bands returned by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) :ref:`VIDIOC_ENUM_FREQ_BANDS`. If the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) ``V4L2_TUNER_CAP_HWSEEK_PROG_LIM`` flag is not set, then these values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) must exactly match those of one of the bands returned by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) :ref:`VIDIOC_ENUM_FREQ_BANDS`. If the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) current frequency of the tuner does not fall within the selected band it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) will be clamped to fit in the band before the seek is started.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) If an error is returned, then the original frequency will be restored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) This ioctl is supported if the ``V4L2_CAP_HW_FREQ_SEEK`` capability is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) If this ioctl is called from a non-blocking filehandle, then ``EAGAIN``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) error code is returned and no seek takes place.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) .. c:type:: v4l2_hw_freq_seek
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) .. flat-table:: struct v4l2_hw_freq_seek
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) :header-rows: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) :widths: 1 1 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) - ``tuner``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) - The tuner index number. This is the same value as in the struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) :c:type:`v4l2_input` ``tuner`` field and the struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) :c:type:`v4l2_tuner` ``index`` field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) - ``type``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) - The tuner type. This is the same value as in the struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) :c:type:`v4l2_tuner` ``type`` field. See
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) :c:type:`v4l2_tuner_type`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) - ``seek_upward``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) - If non-zero, seek upward from the current frequency, else seek
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) downward.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) - ``wrap_around``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) - If non-zero, wrap around when at the end of the frequency range,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) else stop seeking. The struct :c:type:`v4l2_tuner`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) ``capability`` field will tell you what the hardware supports.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) - ``spacing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) - If non-zero, defines the hardware seek resolution in Hz. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) driver selects the nearest value that is supported by the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) If spacing is zero a reasonable default value is used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) - ``rangelow``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) - If non-zero, the lowest tunable frequency of the band to search in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) units of 62.5 kHz, or if the struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) :c:type:`v4l2_tuner` ``capability`` field has the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) ``V4L2_TUNER_CAP_LOW`` flag set, in units of 62.5 Hz or if the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) struct :c:type:`v4l2_tuner` ``capability`` field has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) the ``V4L2_TUNER_CAP_1HZ`` flag set, in units of 1 Hz. If
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) ``rangelow`` is zero a reasonable default value is used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) - ``rangehigh``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) - If non-zero, the highest tunable frequency of the band to search
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) in units of 62.5 kHz, or if the struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) :c:type:`v4l2_tuner` ``capability`` field has the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) ``V4L2_TUNER_CAP_LOW`` flag set, in units of 62.5 Hz or if the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) struct :c:type:`v4l2_tuner` ``capability`` field has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) the ``V4L2_TUNER_CAP_1HZ`` flag set, in units of 1 Hz. If
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) ``rangehigh`` is zero a reasonable default value is used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) - ``reserved``\ [5]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) - Reserved for future extensions. Applications must set the array to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) Return Value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) On success 0 is returned, on error -1 and the ``errno`` variable is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) appropriately. The generic error codes are described at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) :ref:`Generic Error Codes <gen-errors>` chapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) EINVAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) The ``tuner`` index is out of bounds, the ``wrap_around`` value is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) not supported or one of the values in the ``type``, ``rangelow`` or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) ``rangehigh`` fields is wrong.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) EAGAIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) Attempted to call ``VIDIOC_S_HW_FREQ_SEEK`` with the filehandle in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) non-blocking mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) ENODATA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) The hardware seek found no channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) EBUSY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) Another hardware seek is already in progress.