[PATCH] w1: Adds a sysfs entry (w1_master_search) that allows you to disable/enable...
[linux-2.6/verdex.git] / include / sound / cs46xx_dsp_spos.h
blob10014cb62423a0de06d43081e42890b5c5a03b5c
1 /*
2 * The driver for the Cirrus Logic's Sound Fusion CS46XX based soundcards
3 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef __CS46XX_DSP_SPOS_H__
23 #define __CS46XX_DSP_SPOS_H__
25 #include "cs46xx_dsp_scb_types.h"
26 #include "cs46xx_dsp_task_types.h"
28 #define SYMBOL_CONSTANT 0x0
29 #define SYMBOL_SAMPLE 0x1
30 #define SYMBOL_PARAMETER 0x2
31 #define SYMBOL_CODE 0x3
33 #define SEGTYPE_SP_PROGRAM 0x00000001
34 #define SEGTYPE_SP_PARAMETER 0x00000002
35 #define SEGTYPE_SP_SAMPLE 0x00000003
36 #define SEGTYPE_SP_COEFFICIENT 0x00000004
38 #define DSP_SPOS_UU 0x0deadul /* unused */
39 #define DSP_SPOS_DC 0x0badul /* don't care */
40 #define DSP_SPOS_DC_DC 0x0bad0badul /* don't care */
41 #define DSP_SPOS_UUUU 0xdeadc0edul /* unused */
42 #define DSP_SPOS_UUHI 0xdeadul
43 #define DSP_SPOS_UULO 0xc0edul
44 #define DSP_SPOS_DCDC 0x0badf1d0ul /* don't care */
45 #define DSP_SPOS_DCDCHI 0x0badul
46 #define DSP_SPOS_DCDCLO 0xf1d0ul
48 #define DSP_MAX_TASK_NAME 60
49 #define DSP_MAX_SYMBOL_NAME 100
50 #define DSP_MAX_SCB_NAME 60
51 #define DSP_MAX_SCB_DESC 200
52 #define DSP_MAX_TASK_DESC 50
54 #define DSP_MAX_PCM_CHANNELS 32
55 #define DSP_MAX_SRC_NR 14
57 #define DSP_PCM_MAIN_CHANNEL 1
58 #define DSP_PCM_REAR_CHANNEL 2
59 #define DSP_PCM_CENTER_LFE_CHANNEL 3
60 #define DSP_PCM_S71_CHANNEL 4 /* surround 7.1 */
61 #define DSP_IEC958_CHANNEL 5
63 #define DSP_SPDIF_STATUS_OUTPUT_ENABLED 1
64 #define DSP_SPDIF_STATUS_PLAYBACK_OPEN 2
65 #define DSP_SPDIF_STATUS_HW_ENABLED 4
66 #define DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED 8
68 struct _dsp_module_desc_t;
70 typedef struct _symbol_entry_t {
71 u32 address;
72 char symbol_name[DSP_MAX_SYMBOL_NAME];
73 int symbol_type;
75 /* initialized by driver */
76 struct _dsp_module_desc_t * module;
77 int deleted;
78 } symbol_entry_t;
80 typedef struct _symbol_desc_t {
81 int nsymbols;
83 symbol_entry_t * symbols;
85 /* initialized by driver */
86 int highest_frag_index;
87 } symbol_desc_t;
90 typedef struct _segment_desc_t {
91 int segment_type;
92 u32 offset;
93 u32 size;
94 u32 * data;
95 } segment_desc_t;
97 typedef struct _dsp_module_desc_t {
98 char * module_name;
99 symbol_desc_t symbol_table;
100 int nsegments;
101 segment_desc_t * segments;
103 /* initialized by driver */
104 u32 overlay_begin_address;
105 u32 load_address;
106 int nfixups;
107 } dsp_module_desc_t;
109 typedef struct _dsp_scb_descriptor_t {
110 char scb_name[DSP_MAX_SCB_NAME];
111 u32 address;
112 int index;
114 struct _dsp_scb_descriptor_t * sub_list_ptr;
115 struct _dsp_scb_descriptor_t * next_scb_ptr;
116 struct _dsp_scb_descriptor_t * parent_scb_ptr;
118 symbol_entry_t * task_entry;
119 symbol_entry_t * scb_symbol;
121 snd_info_entry_t *proc_info;
122 int ref_count;
123 spinlock_t lock;
125 int deleted;
126 } dsp_scb_descriptor_t;
128 typedef struct _dsp_task_descriptor_t {
129 char task_name[DSP_MAX_TASK_NAME];
130 int size;
131 u32 address;
132 int index;
133 } dsp_task_descriptor_t;
135 typedef struct _pcm_channel_descriptor_t {
136 int active;
137 int src_slot;
138 int pcm_slot;
139 u32 sample_rate;
140 u32 unlinked;
141 dsp_scb_descriptor_t * pcm_reader_scb;
142 dsp_scb_descriptor_t * src_scb;
143 dsp_scb_descriptor_t * mixer_scb;
145 void * private_data;
146 } pcm_channel_descriptor_t;
148 typedef struct _dsp_spos_instance_t {
149 symbol_desc_t symbol_table; /* currently availble loaded symbols in SP */
151 int nmodules;
152 dsp_module_desc_t * modules; /* modules loaded into SP */
154 segment_desc_t code;
156 /* Main PCM playback mixer */
157 dsp_scb_descriptor_t * master_mix_scb;
158 u16 dac_volume_right;
159 u16 dac_volume_left;
161 /* Rear/surround PCM playback mixer */
162 dsp_scb_descriptor_t * rear_mix_scb;
164 /* Center/LFE mixer */
165 dsp_scb_descriptor_t * center_lfe_mix_scb;
167 int npcm_channels;
168 int nsrc_scb;
169 pcm_channel_descriptor_t pcm_channels[DSP_MAX_PCM_CHANNELS];
170 int src_scb_slots[DSP_MAX_SRC_NR];
172 /* cache this symbols */
173 symbol_entry_t * null_algorithm; /* used by PCMreaderSCB's */
174 symbol_entry_t * s16_up; /* used by SRCtaskSCB's */
176 /* proc fs */
177 snd_card_t * snd_card;
178 snd_info_entry_t * proc_dsp_dir;
179 snd_info_entry_t * proc_sym_info_entry;
180 snd_info_entry_t * proc_modules_info_entry;
181 snd_info_entry_t * proc_parameter_dump_info_entry;
182 snd_info_entry_t * proc_sample_dump_info_entry;
184 /* SCB's descriptors */
185 int nscb;
186 int scb_highest_frag_index;
187 dsp_scb_descriptor_t scbs[DSP_MAX_SCB_DESC];
188 snd_info_entry_t * proc_scb_info_entry;
189 dsp_scb_descriptor_t * the_null_scb;
191 /* Task's descriptors */
192 int ntask;
193 dsp_task_descriptor_t tasks[DSP_MAX_TASK_DESC];
194 snd_info_entry_t * proc_task_info_entry;
196 /* SPDIF status */
197 int spdif_status_out;
198 int spdif_status_in;
199 u16 spdif_input_volume_right;
200 u16 spdif_input_volume_left;
201 /* spdif channel status,
202 left right and user validity bits */
203 unsigned int spdif_csuv_default;
204 unsigned int spdif_csuv_stream;
206 /* SPDIF input sample rate converter */
207 dsp_scb_descriptor_t * spdif_in_src;
208 /* SPDIF input asynch. receiver */
209 dsp_scb_descriptor_t * asynch_rx_scb;
211 /* Capture record mixer SCB */
212 dsp_scb_descriptor_t * record_mixer_scb;
214 /* CODEC input SCB */
215 dsp_scb_descriptor_t * codec_in_scb;
217 /* reference snooper */
218 dsp_scb_descriptor_t * ref_snoop_scb;
220 /* SPDIF output PCM reference */
221 dsp_scb_descriptor_t * spdif_pcm_input_scb;
223 /* asynch TX task */
224 dsp_scb_descriptor_t * asynch_tx_scb;
226 /* record sources */
227 dsp_scb_descriptor_t * pcm_input;
228 dsp_scb_descriptor_t * adc_input;
230 int spdif_in_sample_rate;
231 } dsp_spos_instance_t;
233 #endif /* __DSP_SPOS_H__ */