2 * Copyright (c) 2012, Broadcom Europe Ltd
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * 3. Neither the name of the copyright holder nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #ifndef _VC_AUDIO_DEFS_H_
31 #define _VC_AUDIO_DEFS_H_
33 #define VC_AUDIOSERV_MIN_VER 1
34 #define VC_AUDIOSERV_VER 2
36 /* FourCC code used for VCHI connection */
37 #define VC_AUDIO_SERVER_NAME MAKE_FOURCC("AUDS")
39 /* Maximum message length */
40 #define VC_AUDIO_MAX_MSG_LEN (sizeof( VC_AUDIO_MSG_T ))
43 * List of screens that are currently supported
44 * All message types supported for HOST->VC direction
48 VC_AUDIO_MSG_TYPE_RESULT, /* Generic result */
49 VC_AUDIO_MSG_TYPE_COMPLETE, /* playback of samples complete */
50 VC_AUDIO_MSG_TYPE_CONFIG, /* Configure */
51 VC_AUDIO_MSG_TYPE_CONTROL, /* control */
52 VC_AUDIO_MSG_TYPE_OPEN, /* open */
53 VC_AUDIO_MSG_TYPE_CLOSE, /* close/shutdown */
54 VC_AUDIO_MSG_TYPE_START, /* start output (i.e. resume) */
55 VC_AUDIO_MSG_TYPE_STOP, /* stop output (i.e. pause) */
56 VC_AUDIO_MSG_TYPE_WRITE, /* write samples */
61 static const char *vc_audio_msg_type_names[] = {
62 "VC_AUDIO_MSG_TYPE_RESULT",
63 "VC_AUDIO_MSG_TYPE_COMPLETE",
64 "VC_AUDIO_MSG_TYPE_CONFIG",
65 "VC_AUDIO_MSG_TYPE_CONTROL",
66 "VC_AUDIO_MSG_TYPE_OPEN",
67 "VC_AUDIO_MSG_TYPE_CLOSE",
68 "VC_AUDIO_MSG_TYPE_START",
69 "VC_AUDIO_MSG_TYPE_STOP",
70 "VC_AUDIO_MSG_TYPE_WRITE",
71 "VC_AUDIO_MSG_TYPE_MAX"
74 /* configure the audio */
116 uint32_t count; /* in bytes */
123 /* Generic result for a request (VC->HOST) */
126 int32_t success; /* Success value */
130 /* Generic result for a request (VC->HOST) */
133 int32_t count; /* Success value */
136 } VC_AUDIO_COMPLETE_T;
138 /* Message header for all messages in HOST->VC direction */
141 int32_t type; /* Message type (VC_AUDIO_MSG_TYPE) */
144 VC_AUDIO_CONFIG_T config;
145 VC_AUDIO_CONTROL_T control;
146 VC_AUDIO_OPEN_T open;
147 VC_AUDIO_CLOSE_T close;
148 VC_AUDIO_START_T start;
149 VC_AUDIO_STOP_T stop;
150 VC_AUDIO_WRITE_T write;
151 VC_AUDIO_RESULT_T result;
152 VC_AUDIO_COMPLETE_T complete;
156 #endif /* _VC_AUDIO_DEFS_H_ */