xref: /OK3568_Linux_fs/kernel/Documentation/userspace-api/media/v4l/dev-radio.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun.. _radio:
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun***************
6*4882a593SmuzhiyunRadio Interface
7*4882a593Smuzhiyun***************
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunThis interface is intended for AM and FM (analog) radio receivers and
10*4882a593Smuzhiyuntransmitters.
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunConventionally V4L2 radio devices are accessed through character device
13*4882a593Smuzhiyunspecial files named ``/dev/radio`` and ``/dev/radio0`` to
14*4882a593Smuzhiyun``/dev/radio63`` with major number 81 and minor numbers 64 to 127.
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunQuerying Capabilities
18*4882a593Smuzhiyun=====================
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunDevices supporting the radio interface set the ``V4L2_CAP_RADIO`` and
21*4882a593Smuzhiyun``V4L2_CAP_TUNER`` or ``V4L2_CAP_MODULATOR`` flag in the
22*4882a593Smuzhiyun``capabilities`` field of struct
23*4882a593Smuzhiyun:c:type:`v4l2_capability` returned by the
24*4882a593Smuzhiyun:ref:`VIDIOC_QUERYCAP` ioctl. Other combinations of
25*4882a593Smuzhiyuncapability flags are reserved for future extensions.
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunSupplemental Functions
29*4882a593Smuzhiyun======================
30*4882a593Smuzhiyun
31*4882a593SmuzhiyunRadio devices can support :ref:`controls <control>`, and must support
32*4882a593Smuzhiyunthe :ref:`tuner or modulator <tuner>` ioctls.
33*4882a593Smuzhiyun
34*4882a593SmuzhiyunThey do not support the video input or output, audio input or output,
35*4882a593Smuzhiyunvideo standard, cropping and scaling, compression and streaming
36*4882a593Smuzhiyunparameter, or overlay ioctls. All other ioctls and I/O methods are
37*4882a593Smuzhiyunreserved for future extensions.
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun
40*4882a593SmuzhiyunProgramming
41*4882a593Smuzhiyun===========
42*4882a593Smuzhiyun
43*4882a593SmuzhiyunRadio devices may have a couple audio controls (as discussed in
44*4882a593Smuzhiyun:ref:`control`) such as a volume control, possibly custom controls.
45*4882a593SmuzhiyunFurther all radio devices have one tuner or modulator (these are
46*4882a593Smuzhiyundiscussed in :ref:`tuner`) with index number zero to select the radio
47*4882a593Smuzhiyunfrequency and to determine if a monaural or FM stereo program is
48*4882a593Smuzhiyunreceived/emitted. Drivers switch automatically between AM and FM
49*4882a593Smuzhiyundepending on the selected frequency. The
50*4882a593Smuzhiyun:ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>` or
51*4882a593Smuzhiyun:ref:`VIDIOC_G_MODULATOR <VIDIOC_G_MODULATOR>` ioctl reports the
52*4882a593Smuzhiyunsupported frequency range.
53