Blame view

include/sound/cs46xx_dsp_spos.h 6.12 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
  /*
   *  The driver for the Cirrus Logic's Sound Fusion CS46XX based soundcards
c1017a4cd   Jaroslav Kysela   [ALSA] Changed Ja...
3
   *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
   *
   *
   *   This program is free software; you can redistribute it and/or modify
   *   it under the terms of the GNU General Public License as published by
   *   the Free Software Foundation; either version 2 of the License, or
   *   (at your option) any later version.
   *
   *   This program is distributed in the hope that it will be useful,
   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   *   GNU General Public License for more details.
   *
   *   You should have received a copy of the GNU General Public License
   *   along with this program; if not, write to the Free Software
   *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
   *
   */
  
  #ifndef __CS46XX_DSP_SPOS_H__
  #define __CS46XX_DSP_SPOS_H__
  
  #include "cs46xx_dsp_scb_types.h"
  #include "cs46xx_dsp_task_types.h"
  
  #define SYMBOL_CONSTANT  0x0
  #define SYMBOL_SAMPLE    0x1
  #define SYMBOL_PARAMETER 0x2
  #define SYMBOL_CODE      0x3
  
  #define SEGTYPE_SP_PROGRAM              0x00000001
  #define SEGTYPE_SP_PARAMETER            0x00000002
  #define SEGTYPE_SP_SAMPLE               0x00000003
  #define SEGTYPE_SP_COEFFICIENT          0x00000004
  
  #define DSP_SPOS_UU      0x0deadul     /* unused */
  #define DSP_SPOS_DC      0x0badul      /* don't care */
  #define DSP_SPOS_DC_DC   0x0bad0badul  /* don't care */
  #define DSP_SPOS_UUUU    0xdeadc0edul  /* unused */
  #define DSP_SPOS_UUHI    0xdeadul
  #define DSP_SPOS_UULO    0xc0edul
  #define DSP_SPOS_DCDC    0x0badf1d0ul  /* don't care */
  #define DSP_SPOS_DCDCHI  0x0badul
  #define DSP_SPOS_DCDCLO  0xf1d0ul
  
  #define DSP_MAX_TASK_NAME   60
  #define DSP_MAX_SYMBOL_NAME 100
  #define DSP_MAX_SCB_NAME    60
  #define DSP_MAX_SCB_DESC    200
  #define DSP_MAX_TASK_DESC   50
  
  #define DSP_MAX_PCM_CHANNELS 32
  #define DSP_MAX_SRC_NR       14
  
  #define DSP_PCM_MAIN_CHANNEL        1
  #define DSP_PCM_REAR_CHANNEL        2
  #define DSP_PCM_CENTER_LFE_CHANNEL  3
  #define DSP_PCM_S71_CHANNEL         4 /* surround 7.1 */
  #define DSP_IEC958_CHANNEL          5
  
  #define DSP_SPDIF_STATUS_OUTPUT_ENABLED       1
  #define DSP_SPDIF_STATUS_PLAYBACK_OPEN        2
  #define DSP_SPDIF_STATUS_HW_ENABLED           4
  #define DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED   8
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
67
  struct dsp_symbol_entry {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
68
69
70
71
72
  	u32 address;
  	char symbol_name[DSP_MAX_SYMBOL_NAME];
  	int symbol_type;
  
  	/* initialized by driver */
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
73
  	struct dsp_module_desc * module;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
74
  	int deleted;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
75
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
76

3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
77
  struct dsp_symbol_desc {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
78
  	int nsymbols;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
79
  	struct dsp_symbol_entry *symbols;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
80
81
82
  
  	/* initialized by driver */
  	int highest_frag_index;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
83
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
84

3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
85
  struct dsp_segment_desc {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
86
87
88
89
  	int segment_type;
  	u32 offset;
  	u32 size;
  	u32 * data;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
90
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
91

3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
92
  struct dsp_module_desc {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
93
  	char * module_name;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
94
  	struct dsp_symbol_desc symbol_table;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
95
  	int nsegments;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
96
  	struct dsp_segment_desc * segments;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
97
98
99
100
101
  
  	/* initialized by driver */
  	u32 overlay_begin_address;
  	u32 load_address;
  	int nfixups;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
102
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
103

3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
104
  struct dsp_scb_descriptor {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
105
106
107
  	char scb_name[DSP_MAX_SCB_NAME];
  	u32 address;
  	int index;
89f157d9e   Takashi Iwai   [ALSA] cs46xx - F...
108
  	u32 *data;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
109

3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
110
111
112
  	struct dsp_scb_descriptor * sub_list_ptr;
  	struct dsp_scb_descriptor * next_scb_ptr;
  	struct dsp_scb_descriptor * parent_scb_ptr;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
113

3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
114
115
  	struct dsp_symbol_entry * task_entry;
  	struct dsp_symbol_entry * scb_symbol;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
116

3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
117
  	struct snd_info_entry *proc_info;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
118
  	int ref_count;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
119

41116e926   Takashi Iwai   ALSA: cs46xx - Fi...
120
121
122
123
  	u16 volume[2];
  	unsigned int deleted :1;
  	unsigned int updated :1;
  	unsigned int volume_set :1;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
124
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
125

3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
126
  struct dsp_task_descriptor {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
127
128
129
130
  	char task_name[DSP_MAX_TASK_NAME];
  	int size;
  	u32 address;
  	int index;
89f157d9e   Takashi Iwai   [ALSA] cs46xx - F...
131
  	u32 *data;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
132
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
133

3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
134
  struct dsp_pcm_channel_descriptor {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
135
136
137
138
139
  	int active;
  	int src_slot;
  	int pcm_slot;
  	u32 sample_rate;
  	u32 unlinked;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
140
141
142
  	struct dsp_scb_descriptor * pcm_reader_scb;
  	struct dsp_scb_descriptor * src_scb;
  	struct dsp_scb_descriptor * mixer_scb;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
143
144
  
  	void * private_data;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
145
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
146

3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
147
  struct dsp_spos_instance {
25985edce   Lucas De Marchi   Fix common misspe...
148
  	struct dsp_symbol_desc symbol_table; /* currently available loaded symbols in SP */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
149
150
  
  	int nmodules;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
151
  	struct dsp_module_desc * modules; /* modules loaded into SP */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
152

3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
153
  	struct dsp_segment_desc code;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
154
155
  
  	/* Main PCM playback mixer */
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
156
  	struct dsp_scb_descriptor * master_mix_scb;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
157
158
159
160
  	u16 dac_volume_right;
  	u16 dac_volume_left;
  
  	/* Rear/surround PCM playback mixer */
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
161
  	struct dsp_scb_descriptor * rear_mix_scb;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
162
163
  
  	/* Center/LFE mixer */
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
164
  	struct dsp_scb_descriptor * center_lfe_mix_scb;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
165
166
167
  
  	int npcm_channels;
  	int nsrc_scb;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
168
  	struct dsp_pcm_channel_descriptor pcm_channels[DSP_MAX_PCM_CHANNELS];
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
169
170
171
  	int src_scb_slots[DSP_MAX_SRC_NR];
  
  	/* cache this symbols */
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
172
173
  	struct dsp_symbol_entry * null_algorithm; /* used by PCMreaderSCB's */
  	struct dsp_symbol_entry * s16_up;         /* used by SRCtaskSCB's */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
174
175
  
  	/* proc fs */  
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
176
177
178
179
180
181
  	struct snd_card *snd_card;
  	struct snd_info_entry * proc_dsp_dir;
  	struct snd_info_entry * proc_sym_info_entry;
  	struct snd_info_entry * proc_modules_info_entry;
  	struct snd_info_entry * proc_parameter_dump_info_entry;
  	struct snd_info_entry * proc_sample_dump_info_entry;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
182
183
184
185
  
  	/* SCB's descriptors */
  	int nscb;
  	int scb_highest_frag_index;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
186
187
188
  	struct dsp_scb_descriptor scbs[DSP_MAX_SCB_DESC];
  	struct snd_info_entry * proc_scb_info_entry;
  	struct dsp_scb_descriptor * the_null_scb;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
189
190
191
  
  	/* Task's descriptors */
  	int ntask;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
192
193
  	struct dsp_task_descriptor tasks[DSP_MAX_TASK_DESC];
  	struct snd_info_entry * proc_task_info_entry;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
194
195
196
197
198
199
200
201
202
203
204
205
  
  	/* SPDIF status */
  	int spdif_status_out;
  	int spdif_status_in;
  	u16 spdif_input_volume_right;
  	u16 spdif_input_volume_left;
  	/* spdif channel status,
  	   left right and user validity bits */
  	unsigned int spdif_csuv_default;
  	unsigned int spdif_csuv_stream;
  
  	/* SPDIF input sample rate converter */
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
206
  	struct dsp_scb_descriptor * spdif_in_src;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
207
  	/* SPDIF input asynch. receiver */
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
208
  	struct dsp_scb_descriptor * asynch_rx_scb;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
209
210
  
  	/* Capture record mixer SCB */
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
211
  	struct dsp_scb_descriptor * record_mixer_scb;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
212
213
      
  	/* CODEC input SCB */
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
214
  	struct dsp_scb_descriptor * codec_in_scb;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
215
216
  
  	/* reference snooper */
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
217
  	struct dsp_scb_descriptor * ref_snoop_scb;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
218
219
  
  	/* SPDIF output  PCM reference  */
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
220
  	struct dsp_scb_descriptor * spdif_pcm_input_scb;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
221
222
  
  	/* asynch TX task */
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
223
  	struct dsp_scb_descriptor * asynch_tx_scb;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
224
225
  
  	/* record sources */
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
226
227
  	struct dsp_scb_descriptor * pcm_input;
  	struct dsp_scb_descriptor * adc_input;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
228
229
  
  	int spdif_in_sample_rate;
3d19f804e   Takashi Iwai   [ALSA] Remove xxx...
230
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
231
232
  
  #endif /* __DSP_SPOS_H__ */