blob: 0fce1de284ff9d8ae4d38cc99e1b1f9f287d0f3d [file] [log] [blame]
Vinod Koulc514a912012-08-16 17:10:42 +05301#ifndef __SST_DSP_H__
2#define __SST_DSP_H__
3/*
4 * sst_dsp.h - Intel SST Driver for audio engine
5 *
6 * Copyright (C) 2008-12 Intel Corporation
7 * Authors: Vinod Koul <vinod.koul@linux.intel.com>
8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2 of the License.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
22 *
23 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 */
25
26enum sst_codec_types {
27 /* AUDIO/MUSIC CODEC Type Definitions */
28 SST_CODEC_TYPE_UNKNOWN = 0,
29 SST_CODEC_TYPE_PCM, /* Pass through Audio codec */
30 SST_CODEC_TYPE_MP3,
31 SST_CODEC_TYPE_MP24,
32 SST_CODEC_TYPE_AAC,
33 SST_CODEC_TYPE_AACP,
34 SST_CODEC_TYPE_eAACP,
35};
36
37enum stream_type {
38 SST_STREAM_TYPE_NONE = 0,
39 SST_STREAM_TYPE_MUSIC = 1,
40};
41
42struct snd_pcm_params {
43 u16 codec; /* codec type */
44 u8 num_chan; /* 1=Mono, 2=Stereo */
45 u8 pcm_wd_sz; /* 16/24 - bit*/
46 u32 reserved; /* Bitrate in bits per second */
47 u32 sfreq; /* Sampling rate in Hz */
48 u8 use_offload_path;
49 u8 reserved2;
50 u16 reserved3;
51 u8 channel_map[8];
52} __packed;
53
54/* MP3 Music Parameters Message */
55struct snd_mp3_params {
56 u16 codec;
57 u8 num_chan; /* 1=Mono, 2=Stereo */
58 u8 pcm_wd_sz; /* 16/24 - bit*/
59 u8 crc_check; /* crc_check - disable (0) or enable (1) */
60 u8 reserved1; /* unused*/
61 u16 reserved2; /* Unused */
62} __packed;
63
64#define AAC_BIT_STREAM_ADTS 0
65#define AAC_BIT_STREAM_ADIF 1
66#define AAC_BIT_STREAM_RAW 2
67
68/* AAC Music Parameters Message */
69struct snd_aac_params {
70 u16 codec;
71 u8 num_chan; /* 1=Mono, 2=Stereo*/
72 u8 pcm_wd_sz; /* 16/24 - bit*/
73 u8 bdownsample; /*SBR downsampling 0 - disable 1 -enabled AAC+ only */
74 u8 bs_format; /* input bit stream format adts=0, adif=1, raw=2 */
75 u16 reser2;
76 u32 externalsr; /*sampling rate of basic AAC raw bit stream*/
77 u8 sbr_signalling;/*disable/enable/set automode the SBR tool.AAC+*/
78 u8 reser1;
79 u16 reser3;
80} __packed;
81
82/* WMA Music Parameters Message */
83struct snd_wma_params {
84 u16 codec;
85 u8 num_chan; /* 1=Mono, 2=Stereo */
86 u8 pcm_wd_sz; /* 16/24 - bit*/
87 u32 brate; /* Use the hard coded value. */
88 u32 sfreq; /* Sampling freq eg. 8000, 441000, 48000 */
89 u32 channel_mask; /* Channel Mask */
90 u16 format_tag; /* Format Tag */
91 u16 block_align; /* packet size */
92 u16 wma_encode_opt;/* Encoder option */
93 u8 op_align; /* op align 0- 16 bit, 1- MSB, 2 LSB */
94 u8 reserved; /* reserved */
95} __packed;
96
97/* Codec params struture */
98union snd_sst_codec_params {
99 struct snd_pcm_params pcm_params;
100 struct snd_mp3_params mp3_params;
101 struct snd_aac_params aac_params;
102 struct snd_wma_params wma_params;
103} __packed;
104
105/* Address and size info of a frame buffer */
106struct sst_address_info {
107 u32 addr; /* Address at IA */
108 u32 size; /* Size of the buffer */
109};
110
111struct snd_sst_alloc_params_ext {
112 struct sst_address_info ring_buf_info[8];
113 u8 sg_count;
114 u8 reserved;
115 u16 reserved2;
116 u32 frag_size; /*Number of samples after which period elapsed
117 message is sent valid only if path = 0*/
118} __packed;
119
120struct snd_sst_stream_params {
121 union snd_sst_codec_params uc;
122} __packed;
123
124struct snd_sst_params {
125 u32 stream_id;
126 u8 codec;
127 u8 ops;
128 u8 stream_type;
129 u8 device_type;
130 struct snd_sst_stream_params sparams;
131 struct snd_sst_alloc_params_ext aparams;
132};
133
134#endif /* __SST_DSP_H__ */