xref: /openbmc/linux/Documentation/userspace-api/media/v4l/vidioc-enumaudio.rst (revision cbecf716ca618fd44feda6bd9a64a8179d031fc5)
1059b1c5bSMauro Carvalho Chehab.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2*407e84cdSMauro Carvalho Chehab.. c:namespace:: V4L
354f38fcaSMauro Carvalho Chehab
454f38fcaSMauro Carvalho Chehab.. _VIDIOC_ENUMAUDIO:
554f38fcaSMauro Carvalho Chehab
654f38fcaSMauro Carvalho Chehab**********************
754f38fcaSMauro Carvalho Chehabioctl VIDIOC_ENUMAUDIO
854f38fcaSMauro Carvalho Chehab**********************
954f38fcaSMauro Carvalho Chehab
1054f38fcaSMauro Carvalho ChehabName
1154f38fcaSMauro Carvalho Chehab====
1254f38fcaSMauro Carvalho Chehab
1354f38fcaSMauro Carvalho ChehabVIDIOC_ENUMAUDIO - Enumerate audio inputs
1454f38fcaSMauro Carvalho Chehab
1554f38fcaSMauro Carvalho ChehabSynopsis
1654f38fcaSMauro Carvalho Chehab========
1754f38fcaSMauro Carvalho Chehab
18*407e84cdSMauro Carvalho Chehab.. c:macro:: VIDIOC_ENUMAUDIO
1954f38fcaSMauro Carvalho Chehab
20*407e84cdSMauro Carvalho Chehab``int ioctl(int fd, VIDIOC_ENUMAUDIO, struct v4l2_audio *argp)``
2154f38fcaSMauro Carvalho Chehab
2254f38fcaSMauro Carvalho ChehabArguments
2354f38fcaSMauro Carvalho Chehab=========
2454f38fcaSMauro Carvalho Chehab
2554f38fcaSMauro Carvalho Chehab``fd``
26*407e84cdSMauro Carvalho Chehab    File descriptor returned by :c:func:`open()`.
2754f38fcaSMauro Carvalho Chehab
2854f38fcaSMauro Carvalho Chehab``argp``
2954f38fcaSMauro Carvalho Chehab    Pointer to struct :c:type:`v4l2_audio`.
3054f38fcaSMauro Carvalho Chehab
3154f38fcaSMauro Carvalho ChehabDescription
3254f38fcaSMauro Carvalho Chehab===========
3354f38fcaSMauro Carvalho Chehab
3454f38fcaSMauro Carvalho ChehabTo query the attributes of an audio input applications initialize the
3554f38fcaSMauro Carvalho Chehab``index`` field and zero out the ``reserved`` array of a struct
3654f38fcaSMauro Carvalho Chehab:c:type:`v4l2_audio` and call the :ref:`VIDIOC_ENUMAUDIO`
3754f38fcaSMauro Carvalho Chehabioctl with a pointer to this structure. Drivers fill the rest of the
3854f38fcaSMauro Carvalho Chehabstructure or return an ``EINVAL`` error code when the index is out of
3954f38fcaSMauro Carvalho Chehabbounds. To enumerate all audio inputs applications shall begin at index
4054f38fcaSMauro Carvalho Chehabzero, incrementing by one until the driver returns ``EINVAL``.
4154f38fcaSMauro Carvalho Chehab
4254f38fcaSMauro Carvalho ChehabSee :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` for a description of struct
4354f38fcaSMauro Carvalho Chehab:c:type:`v4l2_audio`.
4454f38fcaSMauro Carvalho Chehab
4554f38fcaSMauro Carvalho ChehabReturn Value
4654f38fcaSMauro Carvalho Chehab============
4754f38fcaSMauro Carvalho Chehab
4854f38fcaSMauro Carvalho ChehabOn success 0 is returned, on error -1 and the ``errno`` variable is set
4954f38fcaSMauro Carvalho Chehabappropriately. The generic error codes are described at the
5054f38fcaSMauro Carvalho Chehab:ref:`Generic Error Codes <gen-errors>` chapter.
5154f38fcaSMauro Carvalho Chehab
5254f38fcaSMauro Carvalho ChehabEINVAL
5354f38fcaSMauro Carvalho Chehab    The number of the audio input is out of bounds.
54