| 1 |
|
| 2 | #ifndef __SOUND_SND_WAVEFRONT_H__
|
| 3 | #define __SOUND_SND_WAVEFRONT_H__
|
| 4 |
|
| 5 | #include <sound/mpu401.h>
|
| 6 | #include <sound/hwdep.h>
|
| 7 | #include <sound/rawmidi.h>
|
| 8 | #include <sound/wavefront.h>
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 | struct _snd_wavefront_midi;
|
| 13 | struct _snd_wavefront_card;
|
| 14 | struct _snd_wavefront;
|
| 15 | struct snd_wss;
|
| 16 |
|
| 17 | typedef struct _snd_wavefront_midi snd_wavefront_midi_t;
|
| 18 | typedef struct _snd_wavefront_card snd_wavefront_card_t;
|
| 19 | typedef struct _snd_wavefront snd_wavefront_t;
|
| 20 |
|
| 21 | typedef enum { internal_mpu = 0, external_mpu = 1 } snd_wavefront_mpu_id;
|
| 22 |
|
| 23 | struct _snd_wavefront_midi {
|
| 24 | unsigned long base;
|
| 25 | char isvirtual;
|
| 26 | char istimer;
|
| 27 | snd_wavefront_mpu_id output_mpu;
|
| 28 | snd_wavefront_mpu_id input_mpu;
|
| 29 | unsigned int mode[2];
|
| 30 | struct snd_rawmidi_substream *substream_output[2];
|
| 31 | struct snd_rawmidi_substream *substream_input[2];
|
| 32 | struct timer_list timer;
|
| 33 | snd_wavefront_card_t *timer_card;
|
| 34 | spinlock_t open;
|
| 35 | spinlock_t virtual;
|
| 36 | };
|
| 37 |
|
| 38 | #define OUTPUT_READY 0x40
|
| 39 | #define INPUT_AVAIL 0x80
|
| 40 | #define MPU_ACK 0xFE
|
| 41 | #define UART_MODE_ON 0x3F
|
| 42 |
|
| 43 | extern const struct snd_rawmidi_ops snd_wavefront_midi_output;
|
| 44 | extern const struct snd_rawmidi_ops snd_wavefront_midi_input;
|
| 45 |
|
| 46 | extern void snd_wavefront_midi_enable_virtual (snd_wavefront_card_t *);
|
| 47 | extern void snd_wavefront_midi_disable_virtual (snd_wavefront_card_t *);
|
| 48 | extern void snd_wavefront_midi_interrupt (snd_wavefront_card_t *);
|
| 49 | extern int snd_wavefront_midi_start (snd_wavefront_card_t *);
|
| 50 | void snd_wavefront_midi_suspend(snd_wavefront_card_t *card);
|
| 51 | void snd_wavefront_midi_resume(snd_wavefront_card_t *card);
|
| 52 |
|
| 53 | struct _snd_wavefront {
|
| 54 | unsigned long irq;
|
| 55 | unsigned long base;
|
| 56 | struct resource *res_base;
|
| 57 |
|
| 58 | #define mpu_data_port base
|
| 59 | #define mpu_command_port base + 1
|
| 60 | #define mpu_status_port base + 1
|
| 61 | #define data_port base + 2
|
| 62 | #define status_port base + 3
|
| 63 | #define control_port base + 3
|
| 64 | #define block_port base + 4
|
| 65 | #define last_block_port base + 6
|
| 66 |
|
| 67 | |
| 68 | The ICS2115 takes care of flipping the relevant pins on the
|
| 69 | YS225 so that access to each of these ports does the right
|
| 70 | thing. Note: these are NOT documented by Turtle Beach.
|
| 71 |
|
| 72 |
|
| 73 | #define fx_status base + 8
|
| 74 | #define fx_op base + 8
|
| 75 | #define fx_lcr base + 9
|
| 76 | #define fx_dsp_addr base + 0xa
|
| 77 | #define fx_dsp_page base + 0xb
|
| 78 | #define fx_dsp_lsb base + 0xc
|
| 79 | #define fx_dsp_msb base + 0xd
|
| 80 | #define fx_mod_addr base + 0xe
|
| 81 | #define fx_mod_data base + 0xf
|
| 82 |
|
| 83 | volatile int irq_ok;
|
| 84 | volatile int irq_cnt;
|
| 85 | char debug;
|
| 86 | int freemem;
|
| 87 |
|
| 88 | char fw_version[2];
|
| 89 | char hw_version[2];
|
| 90 | char israw;
|
| 91 | char has_fx;
|
| 92 | char fx_initialized;
|
| 93 | char prog_status[WF_MAX_PROGRAM];
|
| 94 | char patch_status[WF_MAX_PATCH];
|
| 95 | char sample_status[WF_MAX_SAMPLE];
|
| 96 | int samples_used;
|
| 97 | char interrupts_are_midi;
|
| 98 | char rom_samples_rdonly;
|
| 99 | char midi_in_to_synth;
|
| 100 | spinlock_t irq_lock;
|
| 101 | wait_queue_head_t interrupt_sleeper;
|
| 102 | snd_wavefront_midi_t midi;
|
| 103 | struct snd_card *card;
|
| 104 | };
|
| 105 |
|
| 106 | struct _snd_wavefront_card {
|
| 107 | snd_wavefront_t wavefront;
|
| 108 | struct snd_wss *chip;
|
| 109 | #ifdef CONFIG_PNP
|
| 110 | struct pnp_dev *wss;
|
| 111 | struct pnp_dev *ctrl;
|
| 112 | struct pnp_dev *mpu;
|
| 113 | struct pnp_dev *synth;
|
| 114 | #endif
|
| 115 | };
|
| 116 |
|
| 117 | extern void snd_wavefront_internal_interrupt (snd_wavefront_card_t *card);
|
| 118 | void snd_wavefront_cache_firmware(snd_wavefront_t *dev);
|
| 119 | extern int snd_wavefront_start (snd_wavefront_t *dev);
|
| 120 | extern int snd_wavefront_detect (snd_wavefront_card_t *card);
|
| 121 | int snd_wavefront_resume_synth(snd_wavefront_card_t *card);
|
| 122 | extern int snd_wavefront_cmd (snd_wavefront_t *, int, unsigned char *,
|
| 123 | unsigned char *);
|
| 124 |
|
| 125 | extern int snd_wavefront_synth_ioctl (struct snd_hwdep *,
|
| 126 | struct file *,
|
| 127 | unsigned int cmd,
|
| 128 | unsigned long arg);
|
| 129 | extern int snd_wavefront_synth_open (struct snd_hwdep *, struct file *);
|
| 130 | extern int snd_wavefront_synth_release (struct snd_hwdep *, struct file *);
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 | extern int snd_wavefront_fx_start (snd_wavefront_t *);
|
| 135 | extern int snd_wavefront_fx_detect (snd_wavefront_t *);
|
| 136 | extern int snd_wavefront_fx_ioctl (struct snd_hwdep *,
|
| 137 | struct file *,
|
| 138 | unsigned int cmd,
|
| 139 | unsigned long arg);
|
| 140 | extern int snd_wavefront_fx_open (struct snd_hwdep *, struct file *);
|
| 141 | extern int snd_wavefront_fx_release (struct snd_hwdep *, struct file *);
|
| 142 |
|
| 143 | #endif
|