18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 28c2ecf20Sopenharmony_ci.. c:namespace:: V4L 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci.. _VIDIOC_ENUM_FREQ_BANDS: 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci**************************** 78c2ecf20Sopenharmony_ciioctl VIDIOC_ENUM_FREQ_BANDS 88c2ecf20Sopenharmony_ci**************************** 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ciName 118c2ecf20Sopenharmony_ci==== 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ciVIDIOC_ENUM_FREQ_BANDS - Enumerate supported frequency bands 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciSynopsis 168c2ecf20Sopenharmony_ci======== 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci.. c:macro:: VIDIOC_ENUM_FREQ_BANDS 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci``int ioctl(int fd, VIDIOC_ENUM_FREQ_BANDS, struct v4l2_frequency_band *argp)`` 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ciArguments 238c2ecf20Sopenharmony_ci========= 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci``fd`` 268c2ecf20Sopenharmony_ci File descriptor returned by :c:func:`open()`. 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci``argp`` 298c2ecf20Sopenharmony_ci Pointer to struct :c:type:`v4l2_frequency_band`. 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ciDescription 328c2ecf20Sopenharmony_ci=========== 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ciEnumerates the frequency bands that a tuner or modulator supports. To do 358c2ecf20Sopenharmony_cithis applications initialize the ``tuner``, ``type`` and ``index`` 368c2ecf20Sopenharmony_cifields, and zero out the ``reserved`` array of a struct 378c2ecf20Sopenharmony_ci:c:type:`v4l2_frequency_band` and call the 388c2ecf20Sopenharmony_ci:ref:`VIDIOC_ENUM_FREQ_BANDS` ioctl with a pointer to this structure. 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ciThis ioctl is supported if the ``V4L2_TUNER_CAP_FREQ_BANDS`` capability 418c2ecf20Sopenharmony_ciof the corresponding tuner/modulator is set. 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{2.9cm}|p{2.9cm}|p{5.8cm}|p{2.9cm}|p{3.0cm}| 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci.. c:type:: v4l2_frequency_band 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci.. flat-table:: struct v4l2_frequency_band 488c2ecf20Sopenharmony_ci :header-rows: 0 498c2ecf20Sopenharmony_ci :stub-columns: 0 508c2ecf20Sopenharmony_ci :widths: 1 1 2 1 1 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci * - __u32 538c2ecf20Sopenharmony_ci - ``tuner`` 548c2ecf20Sopenharmony_ci - The tuner or modulator index number. This is the same value as in 558c2ecf20Sopenharmony_ci the struct :c:type:`v4l2_input` ``tuner`` field and 568c2ecf20Sopenharmony_ci the struct :c:type:`v4l2_tuner` ``index`` field, or 578c2ecf20Sopenharmony_ci the struct :c:type:`v4l2_output` ``modulator`` field 588c2ecf20Sopenharmony_ci and the struct :c:type:`v4l2_modulator` ``index`` 598c2ecf20Sopenharmony_ci field. 608c2ecf20Sopenharmony_ci * - __u32 618c2ecf20Sopenharmony_ci - ``type`` 628c2ecf20Sopenharmony_ci - The tuner type. This is the same value as in the struct 638c2ecf20Sopenharmony_ci :c:type:`v4l2_tuner` ``type`` field. The type must be 648c2ecf20Sopenharmony_ci set to ``V4L2_TUNER_RADIO`` for ``/dev/radioX`` device nodes, and 658c2ecf20Sopenharmony_ci to ``V4L2_TUNER_ANALOG_TV`` for all others. Set this field to 668c2ecf20Sopenharmony_ci ``V4L2_TUNER_RADIO`` for modulators (currently only radio 678c2ecf20Sopenharmony_ci modulators are supported). See :c:type:`v4l2_tuner_type` 688c2ecf20Sopenharmony_ci * - __u32 698c2ecf20Sopenharmony_ci - ``index`` 708c2ecf20Sopenharmony_ci - Identifies the frequency band, set by the application. 718c2ecf20Sopenharmony_ci * - __u32 728c2ecf20Sopenharmony_ci - ``capability`` 738c2ecf20Sopenharmony_ci - :cspan:`2` The tuner/modulator capability flags for this 748c2ecf20Sopenharmony_ci frequency band, see :ref:`tuner-capability`. The 758c2ecf20Sopenharmony_ci ``V4L2_TUNER_CAP_LOW`` or ``V4L2_TUNER_CAP_1HZ`` capability must 768c2ecf20Sopenharmony_ci be the same for all frequency bands of the selected 778c2ecf20Sopenharmony_ci tuner/modulator. So either all bands have that capability set, or 788c2ecf20Sopenharmony_ci none of them have that capability. 798c2ecf20Sopenharmony_ci * - __u32 808c2ecf20Sopenharmony_ci - ``rangelow`` 818c2ecf20Sopenharmony_ci - :cspan:`2` The lowest tunable frequency in units of 62.5 kHz, or 828c2ecf20Sopenharmony_ci if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in units 838c2ecf20Sopenharmony_ci of 62.5 Hz, for this frequency band. A 1 Hz unit is used when the 848c2ecf20Sopenharmony_ci ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set. 858c2ecf20Sopenharmony_ci * - __u32 868c2ecf20Sopenharmony_ci - ``rangehigh`` 878c2ecf20Sopenharmony_ci - :cspan:`2` The highest tunable frequency in units of 62.5 kHz, 888c2ecf20Sopenharmony_ci or if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in 898c2ecf20Sopenharmony_ci units of 62.5 Hz, for this frequency band. A 1 Hz unit is used 908c2ecf20Sopenharmony_ci when the ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set. 918c2ecf20Sopenharmony_ci * - __u32 928c2ecf20Sopenharmony_ci - ``modulation`` 938c2ecf20Sopenharmony_ci - :cspan:`2` The supported modulation systems of this frequency 948c2ecf20Sopenharmony_ci band. See :ref:`band-modulation`. 958c2ecf20Sopenharmony_ci 968c2ecf20Sopenharmony_ci .. note:: 978c2ecf20Sopenharmony_ci 988c2ecf20Sopenharmony_ci Currently only one modulation system per frequency band 998c2ecf20Sopenharmony_ci is supported. More work will need to be done if multiple 1008c2ecf20Sopenharmony_ci modulation systems are possible. Contact the linux-media 1018c2ecf20Sopenharmony_ci mailing list 1028c2ecf20Sopenharmony_ci (`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__) 1038c2ecf20Sopenharmony_ci if you need such functionality. 1048c2ecf20Sopenharmony_ci * - __u32 1058c2ecf20Sopenharmony_ci - ``reserved``\ [9] 1068c2ecf20Sopenharmony_ci - Reserved for future extensions. 1078c2ecf20Sopenharmony_ci 1088c2ecf20Sopenharmony_ci Applications and drivers must set the array to zero. 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_ci.. _band-modulation: 1148c2ecf20Sopenharmony_ci 1158c2ecf20Sopenharmony_ci.. flat-table:: Band Modulation Systems 1168c2ecf20Sopenharmony_ci :header-rows: 0 1178c2ecf20Sopenharmony_ci :stub-columns: 0 1188c2ecf20Sopenharmony_ci :widths: 3 1 4 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_ci * - ``V4L2_BAND_MODULATION_VSB`` 1218c2ecf20Sopenharmony_ci - 0x02 1228c2ecf20Sopenharmony_ci - Vestigial Sideband modulation, used for analog TV. 1238c2ecf20Sopenharmony_ci * - ``V4L2_BAND_MODULATION_FM`` 1248c2ecf20Sopenharmony_ci - 0x04 1258c2ecf20Sopenharmony_ci - Frequency Modulation, commonly used for analog radio. 1268c2ecf20Sopenharmony_ci * - ``V4L2_BAND_MODULATION_AM`` 1278c2ecf20Sopenharmony_ci - 0x08 1288c2ecf20Sopenharmony_ci - Amplitude Modulation, commonly used for analog radio. 1298c2ecf20Sopenharmony_ci 1308c2ecf20Sopenharmony_ciReturn Value 1318c2ecf20Sopenharmony_ci============ 1328c2ecf20Sopenharmony_ci 1338c2ecf20Sopenharmony_ciOn success 0 is returned, on error -1 and the ``errno`` variable is set 1348c2ecf20Sopenharmony_ciappropriately. The generic error codes are described at the 1358c2ecf20Sopenharmony_ci:ref:`Generic Error Codes <gen-errors>` chapter. 1368c2ecf20Sopenharmony_ci 1378c2ecf20Sopenharmony_ciEINVAL 1388c2ecf20Sopenharmony_ci The ``tuner`` or ``index`` is out of bounds or the ``type`` field is 1398c2ecf20Sopenharmony_ci wrong. 140