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