1
diff -ru alsa-kernel/include/gus.h new-kernel/include/gus.h
2
--- alsa-kernel/include/gus.h 2007-10-30 12:01:55.000000000 +0100
3
+++ new-kernel/include/gus.h 2007-10-15 11:25:08.000000000 +0200
6
#include "seq_midi_emul.h"
7
#include "seq_device.h"
8
+#include "ainstr_iw.h"
9
+#include "ainstr_gf1.h"
10
+#include "ainstr_simple.h"
13
+#define SNDRV_SEQ_DEV_ID_GUS "gus-synth"
17
#define GUSP(gus, x) ((gus)->gf1.port + SNDRV_g_u_s_##x)
22
+struct snd_gus_sample_ops {
23
+ void (*sample_start)(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_position_t position);
24
+ void (*sample_stop)(struct snd_gus_card *gus, struct snd_gus_voice *voice, int mode);
25
+ void (*sample_freq)(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_frequency_t freq);
26
+ void (*sample_volume)(struct snd_gus_card *gus, struct snd_gus_voice *voice, struct snd_seq_ev_volume *volume);
27
+ void (*sample_loop)(struct snd_gus_card *card, struct snd_gus_voice *voice, struct snd_seq_ev_loop *loop);
28
+ void (*sample_pos)(struct snd_gus_card *card, struct snd_gus_voice *voice, snd_seq_position_t position);
29
+ void (*sample_private1)(struct snd_gus_card *card, struct snd_gus_voice *voice, unsigned char *data);
32
#define SNDRV_GF1_VOICE_TYPE_PCM 0
33
#define SNDRV_GF1_VOICE_TYPE_SYNTH 1
34
#define SNDRV_GF1_VOICE_TYPE_MIDI 2
37
struct snd_gus_sample_ops *sample_ops;
39
+ struct snd_seq_instr instr;
41
/* running status / registers */
43
+ struct snd_seq_ev_volume sample_volume;
45
unsigned short fc_register;
46
unsigned short fc_lfo;
47
unsigned short gf1_volume;
51
struct snd_gus_port seq_ports[4];
52
+ struct snd_seq_kinstr_list *ilist;
53
+ struct snd_iwffff_ops iwffff_ops;
54
+ struct snd_gf1_ops gf1_ops;
55
+ struct snd_simple_ops simple_ops;
60
struct snd_rawmidi_substream *midi_substream_output;
61
struct snd_rawmidi_substream *midi_substream_input;
63
+ struct snd_seq_device *seq_dev;
66
spinlock_t voice_alloc;
67
spinlock_t active_voice_lock;
70
int snd_gf1_rawmidi_new(struct snd_gus_card * gus, int device, struct snd_rawmidi **rrawmidi);
73
+extern void snd_engine_instrument_register(unsigned short mode,
74
+ struct _SND_INSTRUMENT_VOICE_COMMANDS *voice_cmds,
75
+ struct _SND_INSTRUMENT_NOTE_COMMANDS *note_cmds,
76
+ struct _SND_INSTRUMENT_CHANNEL_COMMANDS *channel_cmds);
77
+extern int snd_engine_instrument_register_ask(unsigned short mode);
81
int snd_gus_dram_write(struct snd_gus_card *gus, char __user *ptr,
82
unsigned int addr, unsigned int size);
83
int snd_gus_dram_read(struct snd_gus_card *gus, char __user *ptr,
84
unsigned int addr, unsigned int size, int rom);
86
+#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
89
+void snd_gus_sample_event(struct snd_seq_event *ev, struct snd_gus_port *p);
92
+void snd_gf1_simple_init(struct snd_gus_voice *voice);
95
+int snd_gus_iwffff_put_sample(void *private_data, struct iwffff_wave *wave,
96
+ char __user *data, long len, int atomic);
97
+int snd_gus_iwffff_get_sample(void *private_data, struct iwffff_wave *wave,
98
+ char __user *data, long len, int atomic);
99
+int snd_gus_iwffff_remove_sample(void *private_data, struct iwffff_wave *wave,
101
+int snd_gus_gf1_put_sample(void *private_data, struct gf1_wave *wave,
102
+ char __user *data, long len, int atomic);
103
+int snd_gus_gf1_get_sample(void *private_data, struct gf1_wave *wave,
104
+ char __user *data, long len, int atomic);
105
+int snd_gus_gf1_remove_sample(void *private_data, struct gf1_wave *wave,
107
+int snd_gus_simple_put_sample(void *private_data, struct simple_instrument *instr,
108
+ char __user *data, long len, int atomic);
109
+int snd_gus_simple_get_sample(void *private_data, struct simple_instrument *instr,
110
+ char __user *data, long len, int atomic);
111
+int snd_gus_simple_remove_sample(void *private_data, struct simple_instrument *instr,
114
+#endif /* CONFIG_SND_SEQUENCER */
116
#endif /* __SOUND_GUS_H */
117
diff -ru alsa-kernel/isa/gus/gus_main.c new-kernel/isa/gus/gus_main.c
118
--- alsa-kernel/isa/gus/gus_main.c 2007-10-30 12:01:55.000000000 +0100
119
+++ new-kernel/isa/gus/gus_main.c 2007-10-16 14:44:00.000000000 +0200
122
if (gus->gf1.res_port2 == NULL)
124
+#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
125
+ if (gus->seq_dev) {
126
+ snd_device_free(gus->card, gus->seq_dev);
127
+ gus->seq_dev = NULL;
131
snd_gus_init_dma_irq(gus, 0);
137
+#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
138
+static void snd_gus_seq_dev_free(struct snd_seq_device *seq_dev)
140
+ struct snd_gus_card *gus = seq_dev->private_data;
141
+ gus->seq_dev = NULL;
145
int snd_gus_initialize(struct snd_gus_card *gus)
150
if ((err = snd_gus_init_dma_irq(gus, 1)) < 0)
152
+#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
153
+ if (snd_seq_device_new(gus->card, 1, SNDRV_SEQ_DEV_ID_GUS,
154
+ sizeof(struct snd_gus_card *), &gus->seq_dev) >= 0) {
155
+ strcpy(gus->seq_dev->name, "GUS");
156
+ *(struct snd_gus_card **)SNDRV_SEQ_DEVICE_ARGPTR(gus->seq_dev) = gus;
157
+ gus->seq_dev->private_data = gus;
158
+ gus->seq_dev->private_free = snd_gus_seq_dev_free;
162
gus->initialized = 1;
164
diff -ru alsa-kernel/isa/gus/Makefile new-kernel/isa/gus/Makefile
165
--- alsa-kernel/isa/gus/Makefile 2007-10-30 12:01:55.000000000 +0100
166
+++ new-kernel/isa/gus/Makefile 2007-10-15 11:25:09.000000000 +0200
168
gus_pcm.o gus_mixer.o \
171
+snd-gus-synth-objs := gus_synth.o gus_sample.o gus_simple.o gus_instr.o
173
snd-gusclassic-objs := gusclassic.o
174
snd-gusextreme-objs := gusextreme.o
176
snd-interwave-objs := interwave.o
177
snd-interwave-stb-objs := interwave-stb.o
180
+# this function returns:
181
+# "m" - CONFIG_SND_SEQUENCER is m
182
+# <empty string> - CONFIG_SND_SEQUENCER is undefined
183
+# otherwise parameter #1 value
185
+sequencer = $(if $(subst y,,$(CONFIG_SND_SEQUENCER)),$(if $(1),m),$(if $(CONFIG_SND_SEQUENCER),$(1)))
187
# Toplevel Module Dependency
188
obj-$(CONFIG_SND_GUSCLASSIC) += snd-gusclassic.o snd-gus-lib.o
189
obj-$(CONFIG_SND_GUSMAX) += snd-gusmax.o snd-gus-lib.o
190
obj-$(CONFIG_SND_GUSEXTREME) += snd-gusextreme.o snd-gus-lib.o
191
obj-$(CONFIG_SND_INTERWAVE) += snd-interwave.o snd-gus-lib.o
192
obj-$(CONFIG_SND_INTERWAVE_STB) += snd-interwave-stb.o snd-gus-lib.o
193
+obj-$(call sequencer,$(CONFIG_SND_GUS_SYNTH)) += snd-gus-synth.o
195
+obj-m := $(sort $(obj-m))