37 #include <linux/module.h>
49 static int snd_opl4_seq_use_inc(
struct snd_opl4 *opl4)
51 if (!try_module_get(opl4->
card->module))
56 static void snd_opl4_seq_use_dec(
struct snd_opl4 *opl4)
58 module_put(opl4->
card->module);
75 err = snd_opl4_seq_use_inc(opl4);
99 snd_opl4_seq_use_dec(opl4);
112 void *private_data,
int atomic,
int hop)
120 static void snd_opl4_seq_free_port(
void *private_data)
143 opl4->chset->private_data = opl4;
152 opl4->seq_client =
client;
153 opl4->chset->client =
client;
156 memset(&pcallbacks, 0,
sizeof(pcallbacks));
158 pcallbacks.use = snd_opl4_seq_use;
159 pcallbacks.unuse = snd_opl4_seq_unuse;
160 pcallbacks.event_input = snd_opl4_seq_event_input;
161 pcallbacks.private_free = snd_opl4_seq_free_port;
162 pcallbacks.private_data = opl4;
172 "OPL4 Wavetable Port");
173 if (opl4->chset->port < 0) {
174 int err = opl4->chset->port;
177 opl4->seq_client = -1;
191 if (opl4->seq_client >= 0) {
193 opl4->seq_client = -1;
198 static int __init alsa_opl4_synth_init(
void)
201 snd_opl4_seq_new_device,
202 snd_opl4_seq_delete_device
209 static void __exit alsa_opl4_synth_exit(
void)