GNU Linux-libre 4.14.313-gnu1
[releases.git] / drivers / staging / vc04_services / bcm2835-audio / vc_vchi_audioserv_defs.h
1 /*****************************************************************************
2  * Copyright 2011 Broadcom Corporation.  All rights reserved.
3  *
4  * Unless you and Broadcom execute a separate written software license
5  * agreement governing use of this software, this software is licensed to you
6  * under the terms of the GNU General Public License version 2, available at
7  * http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8  *
9  * Notwithstanding the above, under no circumstances may you combine this
10  * software in any way with any other Broadcom software provided under a
11  * license other than the GPL, without Broadcom's express prior written
12  * consent.
13  *****************************************************************************/
14
15 #ifndef _VC_AUDIO_DEFS_H_
16 #define _VC_AUDIO_DEFS_H_
17
18 #define VC_AUDIOSERV_MIN_VER 1
19 #define VC_AUDIOSERV_VER 2
20
21 /* FourCC code used for VCHI connection */
22 #define VC_AUDIO_SERVER_NAME  MAKE_FOURCC("AUDS")
23
24 /*
25  *  List of screens that are currently supported
26  *  All message types supported for HOST->VC direction
27  */
28
29 enum vc_audio_msg_type {
30         VC_AUDIO_MSG_TYPE_RESULT, // Generic result
31         VC_AUDIO_MSG_TYPE_COMPLETE, // Generic result
32         VC_AUDIO_MSG_TYPE_CONFIG, // Configure audio
33         VC_AUDIO_MSG_TYPE_CONTROL, // Configure audio
34         VC_AUDIO_MSG_TYPE_OPEN, // Configure audio
35         VC_AUDIO_MSG_TYPE_CLOSE, // Configure audio
36         VC_AUDIO_MSG_TYPE_START, // Configure audio
37         VC_AUDIO_MSG_TYPE_STOP, // Configure audio
38         VC_AUDIO_MSG_TYPE_WRITE, // Configure audio
39         VC_AUDIO_MSG_TYPE_MAX
40 };
41
42 /* configure the audio */
43
44 struct vc_audio_config {
45         u32 channels;
46         u32 samplerate;
47         u32 bps;
48 };
49
50 struct vc_audio_control {
51         u32 volume;
52         u32 dest;
53 };
54
55 struct vc_audio_open {
56         u32 dummy;
57 };
58
59 struct vc_audio_close {
60         u32 dummy;
61 };
62
63 struct vc_audio_start {
64         u32 dummy;
65 };
66
67 struct vc_audio_stop {
68         u32 draining;
69 };
70
71 /* configure the write audio samples */
72 struct vc_audio_write {
73         u32 count; // in bytes
74         u32 cookie1;
75         u32 cookie2;
76         s16 silence;
77         s16 max_packet;
78 };
79
80 /* Generic result for a request (VC->HOST) */
81 struct vc_audio_result {
82         s32 success; // Success value
83 };
84
85 /* Generic result for a request (VC->HOST) */
86 struct vc_audio_complete {
87         s32 count; // Success value
88         u32 cookie1;
89         u32 cookie2;
90 };
91
92 /* Message header for all messages in HOST->VC direction */
93 struct vc_audio_msg {
94         s32 type; /* Message type (VC_AUDIO_MSG_TYPE) */
95         union {
96                 struct vc_audio_config config;
97                 struct vc_audio_control control;
98                 struct vc_audio_open open;
99                 struct vc_audio_close close;
100                 struct vc_audio_start start;
101                 struct vc_audio_stop stop;
102                 struct vc_audio_write write;
103                 struct vc_audio_result result;
104                 struct vc_audio_complete complete;
105         } u;
106 };
107
108 #endif /* _VC_AUDIO_DEFS_H_ */