Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / Documentation / media / uapi / v4l / tuner.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _tuner:
4
5 *********************
6 Tuners and Modulators
7 *********************
8
9
10 Tuners
11 ======
12
13 Video input devices can have one or more tuners demodulating a RF
14 signal. Each tuner is associated with one or more video inputs,
15 depending on the number of RF connectors on the tuner. The ``type``
16 field of the respective struct :ref:`v4l2_input <v4l2-input>`
17 returned by the :ref:`VIDIOC_ENUMINPUT` ioctl is
18 set to ``V4L2_INPUT_TYPE_TUNER`` and its ``tuner`` field contains the
19 index number of the tuner.
20
21 Radio input devices have exactly one tuner with index zero, no video
22 inputs.
23
24 To query and change tuner properties applications use the
25 :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>` and
26 :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` ioctls, respectively. The
27 struct :ref:`v4l2_tuner <v4l2-tuner>` returned by :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>`
28 also contains signal status information applicable when the tuner of the
29 current video or radio input is queried.
30
31 .. note:: :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` does not switch the
32    current tuner, when there is more than one at all. The tuner is solely
33    determined by the current video input. Drivers must support both ioctls
34    and set the ``V4L2_CAP_TUNER`` flag in the struct :ref:`v4l2_capability
35    <v4l2-capability>` returned by the :ref:`VIDIOC_QUERYCAP` ioctl when the
36    device has one or more tuners.
37
38
39 Modulators
40 ==========
41
42 Video output devices can have one or more modulators, uh, modulating a
43 video signal for radiation or connection to the antenna input of a TV
44 set or video recorder. Each modulator is associated with one or more
45 video outputs, depending on the number of RF connectors on the
46 modulator. The ``type`` field of the respective struct
47 :ref:`v4l2_output <v4l2-output>` returned by the
48 :ref:`VIDIOC_ENUMOUTPUT` ioctl is set to
49 ``V4L2_OUTPUT_TYPE_MODULATOR`` and its ``modulator`` field contains the
50 index number of the modulator.
51
52 Radio output devices have exactly one modulator with index zero, no
53 video outputs.
54
55 A video or radio device cannot support both a tuner and a modulator. Two
56 separate device nodes will have to be used for such hardware, one that
57 supports the tuner functionality and one that supports the modulator
58 functionality. The reason is a limitation with the
59 :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl where you
60 cannot specify whether the frequency is for a tuner or a modulator.
61
62 To query and change modulator properties applications use the
63 :ref:`VIDIOC_G_MODULATOR <VIDIOC_G_MODULATOR>` and
64 :ref:`VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` ioctl. Note that
65 :ref:`VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` does not switch the current modulator, when there
66 is more than one at all. The modulator is solely determined by the
67 current video output. Drivers must support both ioctls and set the
68 ``V4L2_CAP_MODULATOR`` flag in the struct
69 :ref:`v4l2_capability <v4l2-capability>` returned by the
70 :ref:`VIDIOC_QUERYCAP` ioctl when the device has
71 one or more modulators.
72
73
74 Radio Frequency
75 ===============
76
77 To get and set the tuner or modulator radio frequency applications use
78 the :ref:`VIDIOC_G_FREQUENCY <VIDIOC_G_FREQUENCY>` and
79 :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl which both take
80 a pointer to a struct :ref:`v4l2_frequency <v4l2-frequency>`. These
81 ioctls are used for TV and radio devices alike. Drivers must support
82 both ioctls when the tuner or modulator ioctls are supported, or when
83 the device is a radio device.