xref: /openbmc/linux/Documentation/userspace-api/media/v4l/dev-radio.rst (revision cbecf716ca618fd44feda6bd9a64a8179d031fc5)
1*059b1c5bSMauro Carvalho Chehab.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
254f38fcaSMauro Carvalho Chehab
354f38fcaSMauro Carvalho Chehab.. _radio:
454f38fcaSMauro Carvalho Chehab
554f38fcaSMauro Carvalho Chehab***************
654f38fcaSMauro Carvalho ChehabRadio Interface
754f38fcaSMauro Carvalho Chehab***************
854f38fcaSMauro Carvalho Chehab
954f38fcaSMauro Carvalho ChehabThis interface is intended for AM and FM (analog) radio receivers and
1054f38fcaSMauro Carvalho Chehabtransmitters.
1154f38fcaSMauro Carvalho Chehab
1254f38fcaSMauro Carvalho ChehabConventionally V4L2 radio devices are accessed through character device
1354f38fcaSMauro Carvalho Chehabspecial files named ``/dev/radio`` and ``/dev/radio0`` to
1454f38fcaSMauro Carvalho Chehab``/dev/radio63`` with major number 81 and minor numbers 64 to 127.
1554f38fcaSMauro Carvalho Chehab
1654f38fcaSMauro Carvalho Chehab
1754f38fcaSMauro Carvalho ChehabQuerying Capabilities
1854f38fcaSMauro Carvalho Chehab=====================
1954f38fcaSMauro Carvalho Chehab
2054f38fcaSMauro Carvalho ChehabDevices supporting the radio interface set the ``V4L2_CAP_RADIO`` and
2154f38fcaSMauro Carvalho Chehab``V4L2_CAP_TUNER`` or ``V4L2_CAP_MODULATOR`` flag in the
2254f38fcaSMauro Carvalho Chehab``capabilities`` field of struct
2354f38fcaSMauro Carvalho Chehab:c:type:`v4l2_capability` returned by the
2454f38fcaSMauro Carvalho Chehab:ref:`VIDIOC_QUERYCAP` ioctl. Other combinations of
2554f38fcaSMauro Carvalho Chehabcapability flags are reserved for future extensions.
2654f38fcaSMauro Carvalho Chehab
2754f38fcaSMauro Carvalho Chehab
2854f38fcaSMauro Carvalho ChehabSupplemental Functions
2954f38fcaSMauro Carvalho Chehab======================
3054f38fcaSMauro Carvalho Chehab
3154f38fcaSMauro Carvalho ChehabRadio devices can support :ref:`controls <control>`, and must support
3254f38fcaSMauro Carvalho Chehabthe :ref:`tuner or modulator <tuner>` ioctls.
3354f38fcaSMauro Carvalho Chehab
3454f38fcaSMauro Carvalho ChehabThey do not support the video input or output, audio input or output,
3554f38fcaSMauro Carvalho Chehabvideo standard, cropping and scaling, compression and streaming
3654f38fcaSMauro Carvalho Chehabparameter, or overlay ioctls. All other ioctls and I/O methods are
3754f38fcaSMauro Carvalho Chehabreserved for future extensions.
3854f38fcaSMauro Carvalho Chehab
3954f38fcaSMauro Carvalho Chehab
4054f38fcaSMauro Carvalho ChehabProgramming
4154f38fcaSMauro Carvalho Chehab===========
4254f38fcaSMauro Carvalho Chehab
4354f38fcaSMauro Carvalho ChehabRadio devices may have a couple audio controls (as discussed in
4454f38fcaSMauro Carvalho Chehab:ref:`control`) such as a volume control, possibly custom controls.
4554f38fcaSMauro Carvalho ChehabFurther all radio devices have one tuner or modulator (these are
4654f38fcaSMauro Carvalho Chehabdiscussed in :ref:`tuner`) with index number zero to select the radio
4754f38fcaSMauro Carvalho Chehabfrequency and to determine if a monaural or FM stereo program is
4854f38fcaSMauro Carvalho Chehabreceived/emitted. Drivers switch automatically between AM and FM
4954f38fcaSMauro Carvalho Chehabdepending on the selected frequency. The
5054f38fcaSMauro Carvalho Chehab:ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>` or
5154f38fcaSMauro Carvalho Chehab:ref:`VIDIOC_G_MODULATOR <VIDIOC_G_MODULATOR>` ioctl reports the
5254f38fcaSMauro Carvalho Chehabsupported frequency range.
53