152 #ifndef _ECHOAUDIO_H_
153 #define _ECHOAUDIO_H_
172 #define VENDOR_ID 0x1057
173 #define DEVICE_ID_56301 0x1801
174 #define DEVICE_ID_56361 0x3410
175 #define SUBVENDOR_ID 0xECC0
181 #define DARLA20 0x0010
182 #define GINA20 0x0020
183 #define LAYLA20 0x0030
184 #define DARLA24 0x0040
185 #define GINA24 0x0050
186 #define LAYLA24 0x0060
189 #define INDIGO 0x0090
190 #define INDIGO_IO 0x00a0
191 #define INDIGO_DJ 0x00b0
193 #define INDIGO_IOX 0x00d0
194 #define INDIGO_DJX 0x00e0
195 #define ECHO3G 0x0100
207 #define ECHO_MAXAUDIOINPUTS 32
208 #define ECHO_MAXAUDIOOUTPUTS 32
209 #define ECHO_MAXAUDIOPIPES 32
211 #define E3G_MAX_OUTPUTS 16
212 #define ECHO_MAXMIDIJACKS 1
213 #define ECHO_MIDI_QUEUE_SZ 512
214 #define ECHO_MTC_QUEUE_SZ 32
220 #define MIDI_ACTIVITY_TIMEOUT_USEC 200000
232 #define ECHO_CLOCK_INTERNAL 0
233 #define ECHO_CLOCK_WORD 1
234 #define ECHO_CLOCK_SUPER 2
235 #define ECHO_CLOCK_SPDIF 3
236 #define ECHO_CLOCK_ADAT 4
237 #define ECHO_CLOCK_ESYNC 5
238 #define ECHO_CLOCK_ESYNC96 6
239 #define ECHO_CLOCK_MTC 7
240 #define ECHO_CLOCK_NUMBER 8
241 #define ECHO_CLOCKS 0xffff
247 #define ECHO_CLOCK_BIT_INTERNAL (1 << ECHO_CLOCK_INTERNAL)
248 #define ECHO_CLOCK_BIT_WORD (1 << ECHO_CLOCK_WORD)
249 #define ECHO_CLOCK_BIT_SUPER (1 << ECHO_CLOCK_SUPER)
250 #define ECHO_CLOCK_BIT_SPDIF (1 << ECHO_CLOCK_SPDIF)
251 #define ECHO_CLOCK_BIT_ADAT (1 << ECHO_CLOCK_ADAT)
252 #define ECHO_CLOCK_BIT_ESYNC (1 << ECHO_CLOCK_ESYNC)
253 #define ECHO_CLOCK_BIT_ESYNC96 (1 << ECHO_CLOCK_ESYNC96)
254 #define ECHO_CLOCK_BIT_MTC (1<<ECHO_CLOCK_MTC)
266 #define DIGITAL_MODE_NONE 0xFF
267 #define DIGITAL_MODE_SPDIF_RCA 0
268 #define DIGITAL_MODE_SPDIF_OPTICAL 1
269 #define DIGITAL_MODE_ADAT 2
270 #define DIGITAL_MODE_SPDIF_CDROM 3
271 #define DIGITAL_MODES 4
276 #define ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_RCA (1 << DIGITAL_MODE_SPDIF_RCA)
277 #define ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_OPTICAL (1 << DIGITAL_MODE_SPDIF_OPTICAL)
278 #define ECHOCAPS_HAS_DIGITAL_MODE_ADAT (1 << DIGITAL_MODE_ADAT)
279 #define ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_CDROM (1 << DIGITAL_MODE_SPDIF_CDROM)
282 #define EXT_3GBOX_NC 0x01
283 #define EXT_3GBOX_NOT_SET 0x02
286 #define ECHOGAIN_MUTED (-128)
287 #define ECHOGAIN_MINOUT (-128)
288 #define ECHOGAIN_MAXOUT (6)
289 #define ECHOGAIN_MININP (-50)
290 #define ECHOGAIN_MAXINP (50)
292 #define PIPE_STATE_STOPPED 0
293 #define PIPE_STATE_PAUSED 1
294 #define PIPE_STATE_STARTED 2
295 #define PIPE_STATE_PENDING 3
299 #ifdef CONFIG_SND_DEBUG
300 #define DE_INIT(x) snd_printk x
306 #ifdef CONFIG_SND_DEBUG
307 #define DE_HWP(x) snd_printk x
313 #ifdef CONFIG_SND_DEBUG
314 #define DE_ACT(x) snd_printk x
320 #ifdef CONFIG_SND_DEBUG
321 #define DE_MID(x) snd_printk x
380 #ifdef ECHOCARD_HAS_MIDI
420 #ifdef ECHOCARD_ECHO3G
422 char px_digital_out, px_analog_in, px_digital_in, px_num;
423 char bx_digital_out, bx_analog_in, bx_digital_in, bx_num;
452 #ifdef CONFIG_PM_SLEEP
456 #ifdef ECHOCARD_HAS_MIDI
469 static int get_firmware(
const struct firmware **fw_entry,
473 #ifdef ECHOCARD_HAS_MIDI
475 static void snd_echo_midi_output_trigger(
505 static inline int px_digital_out(
const struct echoaudio *
chip)
515 static inline int px_digital_in(
const struct echoaudio *
chip)
525 static inline int bx_digital_out(
const struct echoaudio *
chip)
535 static inline int bx_digital_in(
const struct echoaudio *
chip)
545 static inline int num_pipes_out(
const struct echoaudio *
chip)
547 return px_analog_in(chip);
552 return px_num(chip) - px_analog_in(chip);
555 static inline int num_busses_out(
const struct echoaudio *
chip)
557 return bx_analog_in(chip);
560 static inline int num_busses_in(
const struct echoaudio *
chip)
562 return bx_num(chip) - bx_analog_in(chip);
565 static inline int num_analog_busses_out(
const struct echoaudio *
chip)
567 return bx_digital_out(chip);
570 static inline int num_analog_busses_in(
const struct echoaudio *
chip)
572 return bx_digital_in(chip) - bx_analog_in(chip);
575 static inline int num_digital_busses_out(
const struct echoaudio *
chip)
577 return num_busses_out(chip) - num_analog_busses_out(chip);
580 static inline int num_digital_busses_in(
const struct echoaudio *
chip)
582 return num_busses_in(chip) - num_analog_busses_in(chip);
589 return out * num_busses_in(chip) +
in;
594 #define pci_device(chip) (&chip->pci->dev)