htcleo: This adds an SMD channel on /dev/smd1 which can be used with pppd.
[htc-linux.git] / arch / arm / mach-msm / qdsp6 / dal_audio_format.h
blobcdb2e1ab98812da8f48bf2e159e42947386b5ba5
1 /* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are met:
5 * * Redistributions of source code must retain the above copyright
6 * notice, this list of conditions and the following disclaimer.
7 * * Redistributions in binary form must reproduce the above copyright
8 * notice, this list of conditions and the following disclaimer in the
9 * documentation and/or other materials provided with the distribution.
10 * * Neither the name of Code Aurora nor
11 * the names of its contributors may be used to endorse or promote
12 * products derived from this software without specific prior written
13 * permission.
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #ifndef __ADSP_AUDIO_MEDIA_FORMAT_H
30 #define __ADSP_AUDIO_MEDIA_FORMAT_H
34 /* Supported audio media formats */
36 /* format block in shmem */
37 #define ADSP_AUDIO_FORMAT_SHAREDMEMORY 0x01091a78
38 /* adsp_audio_format_raw_pcm type */
39 #define ADSP_AUDIO_FORMAT_PCM 0x0103d2fd
40 /* adsp_audio_format_raw_pcm type */
41 #define ADSP_AUDIO_FORMAT_DTMF 0x01087725
42 /* adsp_audio_format_adpcm type */
43 #define ADSP_AUDIO_FORMAT_ADPCM 0x0103d2ff
44 /* Yamaha PCM format */
45 #define ADSP_AUDIO_FORMAT_YADPCM 0x0108dc07
46 /* ISO/IEC 11172 */
47 #define ADSP_AUDIO_FORMAT_MP3 0x0103d308
48 /* ISO/IEC 14496 */
49 #define ADSP_AUDIO_FORMAT_MPEG4_AAC 0x010422f1
50 /* AMR-NB audio in FS format */
51 #define ADSP_AUDIO_FORMAT_AMRNB_FS 0x0105c16c
52 /* AMR-WB audio in FS format */
53 #define ADSP_AUDIO_FORMAT_AMRWB_FS 0x0105c16e
54 /* QCELP 13k, IS733 */
55 #define ADSP_AUDIO_FORMAT_V13K_FS 0x01080b8a
56 /* EVRC 8k, IS127 */
57 #define ADSP_AUDIO_FORMAT_EVRC_FS 0x01080b89
58 /* EVRC-B 8k, 4GV */
59 #define ADSP_AUDIO_FORMAT_EVRCB_FS 0x0108f2a3
60 /* MIDI command stream */
61 #define ADSP_AUDIO_FORMAT_MIDI 0x0103d300
62 /* A2DP SBC stream */
63 #define ADSP_AUDIO_FORMAT_SBC 0x0108c4d8
64 /* Version 10 Professional */
65 #define ADSP_AUDIO_FORMAT_WMA_V10PRO 0x0108aa92
66 /* Version 9 Starndard */
67 #define ADSP_AUDIO_FORMAT_WMA_V9 0x0108d430
68 /* AMR WideBand Plus */
69 #define ADSP_AUDIO_FORMAT_AMR_WB_PLUS 0x0108f3da
70 /* AC3 Decoder */
71 #define ADSP_AUDIO_FORMAT_AC3_DECODER 0x0108d5f9
74 /* Not yet supported audio media formats */
78 /* ISO/IEC 13818 */
79 #define ADSP_AUDIO_FORMAT_MPEG2_AAC 0x0103d309
80 /* 3GPP TS 26.101 Sec 4.0 */
81 #define ADSP_AUDIO_FORMAT_AMRNB_IF1 0x0103d305
82 /* 3GPP TS 26.101 Annex A */
83 #define ADSP_AUDIO_FORMAT_AMRNB_IF2 0x01057b31
84 /* 3GPP TS 26.201 */
85 #define ADSP_AUDIO_FORMAT_AMRWB_IF1 0x0103d306
86 /* 3GPP TS 26.201 */
87 #define ADSP_AUDIO_FORMAT_AMRWB_IF2 0x0105c16d
88 /* G.711 */
89 #define ADSP_AUDIO_FORMAT_G711 0x0106201d
90 /* QCELP 8k, IS96A */
91 #define ADSP_AUDIO_FORMAT_V8K_FS 0x01081d29
92 /* Version 1 codec */
93 #define ADSP_AUDIO_FORMAT_WMA_V1 0x01055b2b
94 /* Version 2, 7 & 8 codec */
95 #define ADSP_AUDIO_FORMAT_WMA_V8 0x01055b2c
96 /* Version 9 Professional codec */
97 #define ADSP_AUDIO_FORMAT_WMA_V9PRO 0x01055b2d
98 /* Version 9 Voice codec */
99 #define ADSP_AUDIO_FORMAT_WMA_SP1 0x01055b2e
100 /* Version 9 Lossless codec */
101 #define ADSP_AUDIO_FORMAT_WMA_LOSSLESS 0x01055b2f
102 /* Real Media content, low-bitrate */
103 #define ADSP_AUDIO_FORMAT_RA_SIPR 0x01042a0f
104 /* Real Media content */
105 #define ADSP_AUDIO_FORMAT_RA_COOK 0x01042a0e
108 /* For all of the audio formats, unless specified otherwise, */
109 /* the following apply: */
110 /* Format block bits are arranged in bytes and words in little-endian */
111 /* order, i.e., least-significant bit first and least-significant */
112 /* byte first. */
116 /* AAC Format Block. */
118 /* AAC format block consist of a format identifier followed by */
119 /* AudioSpecificConfig formatted according to ISO/IEC 14496-3 */
121 /* The following AAC format identifiers are supported */
122 #define ADSP_AUDIO_AAC_ADTS 0x010619cf
123 #define ADSP_AUDIO_AAC_MPEG4_ADTS 0x010619d0
124 #define ADSP_AUDIO_AAC_LOAS 0x010619d1
125 #define ADSP_AUDIO_AAC_ADIF 0x010619d2
126 #define ADSP_AUDIO_AAC_RAW 0x010619d3
127 #define ADSP_AUDIO_AAC_FRAMED_RAW 0x0108c1fb
130 #define ADSP_AUDIO_COMPANDING_ALAW 0x10619cd
131 #define ADSP_AUDIO_COMPANDING_MLAW 0x10619ce
133 /* Maxmum number of bytes allowed in a format block */
134 #define ADSP_AUDIO_FORMAT_DATA_MAX 16
137 struct adsp_audio_no_payload_format {
138 /* Media Format Code (must always be first element) */
139 u32 format;
141 /* no payload for this format type */
142 } __attribute__ ((packed));
145 /* For convenience, to be used as a standard format block */
146 /* for various media types that don't need a unique format block */
147 /* ie. PCM, DTMF, etc. */
148 struct adsp_audio_standard_format {
149 /* Media Format Code (must always be first element) */
150 u32 format;
152 /* payload */
153 u16 channels;
154 u16 bits_per_sample;
155 u32 sampling_rate;
156 u8 is_signed;
157 u8 is_interleaved;
158 } __attribute__ ((packed));
162 /* ADPCM format block */
163 struct adsp_audio_adpcm_format {
164 /* Media Format Code (must always be first element) */
165 u32 format;
167 /* payload */
168 u16 channels;
169 u16 bits_per_sample;
170 u32 sampling_rate;
171 u8 is_signed;
172 u8 is_interleaved;
173 u32 block_size;
174 } __attribute__ ((packed));
177 /* MIDI format block */
178 struct adsp_audio_midi_format {
179 /* Media Format Code (must always be first element) */
180 u32 format;
182 /* payload */
183 u32 sampling_rate;
184 u16 channels;
185 u16 mode;
186 } __attribute__ ((packed));
189 /* G711 format block */
190 struct adsp_audio_g711_format {
191 /* Media Format Code (must always be first element) */
192 u32 format;
194 /* payload */
195 u32 companding;
196 } __attribute__ ((packed));
199 struct adsp_audio_wma_pro_format {
200 /* Media Format Code (must always be first element) */
201 u32 format;
203 /* payload */
204 u16 format_tag;
205 u16 channels;
206 u32 samples_per_sec;
207 u32 avg_bytes_per_sec;
208 u16 block_align;
209 u16 valid_bits_per_sample;
210 u32 channel_mask;
211 u16 encode_opt;
212 u16 advanced_encode_opt;
213 u32 advanced_encode_opt2;
214 u32 drc_peak_reference;
215 u32 drc_peak_target;
216 u32 drc_average_reference;
217 u32 drc_average_target;
218 } __attribute__ ((packed));
221 struct adsp_audio_amrwb_plus_format {
222 /* Media Format Code (must always be first element) */
223 u32 format;
225 /* payload */
226 u32 size;
227 u32 version;
228 u32 channels;
229 u32 amr_band_mode;
230 u32 amr_dtx_mode;
231 u32 amr_frame_format;
232 u32 amr_isf_index;
233 } __attribute__ ((packed));
236 /* Binary Byte Stream Format */
237 /* Binary format type that defines a byte stream, */
238 /* can be used to specify any format (ie. AAC) */
239 struct adsp_audio_binary_format {
240 /* Media Format Code (must always be first element) */
241 u32 format;
243 /* payload */
244 /* number of bytes set in byte stream */
245 u32 num_bytes;
246 /* Byte stream binary data */
247 u8 data[ADSP_AUDIO_FORMAT_DATA_MAX];
248 } __attribute__ ((packed));
251 struct adsp_audio_shared_memory_format {
252 /* Media Format Code (must always be first element) */
253 u32 format;
255 /* Number of bytes in shared memory */
256 u32 len;
257 /* Phyisical address to data in shared memory */
258 u32 address;
259 } __attribute__ ((packed));
262 /* Union of all format types */
263 union adsp_audio_format {
264 /* Basic format block with no payload */
265 struct adsp_audio_no_payload_format no_payload;
266 /* Generic format block PCM, DTMF */
267 struct adsp_audio_standard_format standard;
268 /* ADPCM format block */
269 struct adsp_audio_adpcm_format adpcm;
270 /* MIDI format block */
271 struct adsp_audio_midi_format midi;
272 /* G711 format block */
273 struct adsp_audio_g711_format g711;
274 /* WmaPro format block */
275 struct adsp_audio_wma_pro_format wma_pro;
276 /* WmaPro format block */
277 struct adsp_audio_amrwb_plus_format amrwb_plus;
278 /* binary (byte stream) format block, used for AAC */
279 struct adsp_audio_binary_format binary;
280 /* format block in shared memory */
281 struct adsp_audio_shared_memory_format shared_mem;
284 #endif