Merge tag 'for-4.21/libata-20190102' of git://git.kernel.dk/linux-block
[sfrench/cifs-2.6.git] / Documentation / media / uapi / v4l / vidioc-enumaudio.rst
1 .. Permission is granted to copy, distribute and/or modify this
2 .. document under the terms of the GNU Free Documentation License,
3 .. Version 1.1 or any later version published by the Free Software
4 .. Foundation, with no Invariant Sections, no Front-Cover Texts
5 .. and no Back-Cover Texts. A copy of the license is included at
6 .. Documentation/media/uapi/fdl-appendix.rst.
7 ..
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9
10 .. _VIDIOC_ENUMAUDIO:
11
12 **********************
13 ioctl VIDIOC_ENUMAUDIO
14 **********************
15
16 Name
17 ====
18
19 VIDIOC_ENUMAUDIO - Enumerate audio inputs
20
21
22 Synopsis
23 ========
24
25 .. c:function:: int ioctl( int fd, VIDIOC_ENUMAUDIO, struct v4l2_audio *argp )
26     :name: VIDIOC_ENUMAUDIO
27
28
29 Arguments
30 =========
31
32 ``fd``
33     File descriptor returned by :ref:`open() <func-open>`.
34
35 ``argp``
36     Pointer to struct :c:type:`v4l2_audio`.
37
38
39 Description
40 ===========
41
42 To query the attributes of an audio input applications initialize the
43 ``index`` field and zero out the ``reserved`` array of a struct
44 :c:type:`v4l2_audio` and call the :ref:`VIDIOC_ENUMAUDIO`
45 ioctl with a pointer to this structure. Drivers fill the rest of the
46 structure or return an ``EINVAL`` error code when the index is out of
47 bounds. To enumerate all audio inputs applications shall begin at index
48 zero, incrementing by one until the driver returns ``EINVAL``.
49
50 See :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` for a description of struct
51 :c:type:`v4l2_audio`.
52
53
54 Return Value
55 ============
56
57 On success 0 is returned, on error -1 and the ``errno`` variable is set
58 appropriately. The generic error codes are described at the
59 :ref:`Generic Error Codes <gen-errors>` chapter.
60
61 EINVAL
62     The number of the audio input is out of bounds.