28 #include <linux/module.h>
41 if (!try_module_get(opl3->
card->module))
49 module_put(opl3->
card->module);
69 opl3->voices[
idx].time = 0;
70 opl3->voices[
idx].keyon_reg = 0x00;
73 opl3->connection_reg = 0x00;
77 opl3->connection_reg);
90 if (opl3->sys_timer_status) {
92 opl3->sys_timer_status = 0;
94 spin_unlock_irqrestore(&opl3->sys_timer_lock, flags);
114 opl3->voices[6].state = opl3->voices[7].state =
120 opl3->drum_reg = 0x00;
127 opl3->synth_mode = SNDRV_OPL3_MODE_SEQ;
156 void *private_data,
int atomic,
int hop)
166 static void snd_opl3_synth_free_port(
void *private_data)
173 static int snd_opl3_synth_create_port(
struct snd_opl3 * opl3)
182 if (opl3->chset ==
NULL)
186 memset(&callbacks, 0,
sizeof(callbacks));
188 callbacks.use = snd_opl3_synth_use;
189 callbacks.unuse = snd_opl3_synth_unuse;
190 callbacks.event_input = snd_opl3_synth_event_input;
191 callbacks.private_free = snd_opl3_synth_free_port;
192 callbacks.private_data = opl3;
195 sprintf(name,
"OPL%i FM Port", opl_ver);
197 opl3->chset->client = opl3->seq_client;
208 if (opl3->chset->port < 0) {
210 port = opl3->chset->port;
232 opl3->seq_client = -1;
236 sprintf(name,
"OPL%i FM synth", opl_ver);
237 client = opl3->seq_client =
243 if ((err = snd_opl3_synth_create_port(opl3)) < 0) {
245 opl3->seq_client = -1;
252 opl3->tlist.data = (
unsigned long) opl3;
254 opl3->sys_timer_status = 0;
256 #ifdef CONFIG_SND_SEQUENCER_OSS
270 #ifdef CONFIG_SND_SEQUENCER_OSS
273 if (opl3->seq_client >= 0) {
275 opl3->seq_client = -1;
280 static int __init alsa_opl3_seq_init(
void)
284 snd_opl3_seq_new_device,
285 snd_opl3_seq_delete_device
292 static void __exit alsa_opl3_seq_exit(
void)