Merge branch 'pm-cpufreq'
[cascardo/linux.git] / Documentation / media / uapi / dvb / audio-fopen.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _audio_fopen:
4
5 ================
6 DVB audio open()
7 ================
8
9 Name
10 ----
11
12 DVB audio open()
13
14 .. attention:: This ioctl is deprecated
15
16 Synopsis
17 --------
18
19 .. c:function:: int open(const char *deviceName, int flags)
20     :name: dvb-audio-open
21
22
23 Arguments
24 ---------
25
26 .. flat-table::
27     :header-rows:  0
28     :stub-columns: 0
29
30
31     -  .. row 1
32
33        -  const char \*deviceName
34
35        -  Name of specific audio device.
36
37     -  .. row 2
38
39        -  int flags
40
41        -  A bit-wise OR of the following flags:
42
43     -  .. row 3
44
45        -
46        -  O_RDONLY read-only access
47
48     -  .. row 4
49
50        -
51        -  O_RDWR read/write access
52
53     -  .. row 5
54
55        -
56        -  O_NONBLOCK open in non-blocking mode
57
58     -  .. row 6
59
60        -
61        -  (blocking mode is the default)
62
63
64 Description
65 -----------
66
67 This system call opens a named audio device (e.g.
68 /dev/dvb/adapter0/audio0) for subsequent use. When an open() call has
69 succeeded, the device will be ready for use. The significance of
70 blocking or non-blocking mode is described in the documentation for
71 functions where there is a difference. It does not affect the semantics
72 of the open() call itself. A device opened in blocking mode can later be
73 put into non-blocking mode (and vice versa) using the F_SETFL command
74 of the fcntl system call. This is a standard system call, documented in
75 the Linux manual page for fcntl. Only one user can open the Audio Device
76 in O_RDWR mode. All other attempts to open the device in this mode will
77 fail, and an error code will be returned. If the Audio Device is opened
78 in O_RDONLY mode, the only ioctl call that can be used is
79 AUDIO_GET_STATUS. All other call will return with an error code.
80
81
82 Return Value
83 ------------
84
85 .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
86
87 .. flat-table::
88     :header-rows:  0
89     :stub-columns: 0
90
91
92     -  .. row 1
93
94        -  ``ENODEV``
95
96        -  Device driver not loaded/available.
97
98     -  .. row 2
99
100        -  ``EBUSY``
101
102        -  Device or resource busy.
103
104     -  .. row 3
105
106        -  ``EINVAL``
107
108        -  Invalid argument.