Lines Matching refs:opl4
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);
63 struct snd_opl4 *opl4 = private_data;
66 mutex_lock(&opl4->access_mutex);
68 if (opl4->used) {
69 mutex_unlock(&opl4->access_mutex);
72 opl4->used++;
75 err = snd_opl4_seq_use_inc(opl4);
77 mutex_unlock(&opl4->access_mutex);
82 mutex_unlock(&opl4->access_mutex);
84 snd_opl4_synth_reset(opl4);
90 struct snd_opl4 *opl4 = private_data;
92 snd_opl4_synth_shutdown(opl4);
94 mutex_lock(&opl4->access_mutex);
95 opl4->used--;
96 mutex_unlock(&opl4->access_mutex);
99 snd_opl4_seq_use_dec(opl4);
114 struct snd_opl4 *opl4 = private_data;
116 snd_midi_process_event(&opl4_ops, ev, opl4->chset);
122 struct snd_opl4 *opl4 = private_data;
124 snd_midi_channel_free_set(opl4->chset);
130 struct snd_opl4 *opl4;
134 opl4 = *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
135 if (!opl4)
138 if (snd_yrw801_detect(opl4) < 0)
141 opl4->chset = snd_midi_channel_alloc_set(16);
142 if (!opl4->chset)
144 opl4->chset->private_data = opl4;
147 client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num,
150 snd_midi_channel_free_set(opl4->chset);
153 opl4->seq_client = client;
154 opl4->chset->client = client;
163 pcallbacks.private_data = opl4;
165 opl4->chset->port = snd_seq_event_port_attach(client, &pcallbacks,
174 if (opl4->chset->port < 0) {
175 int err = opl4->chset->port;
176 snd_midi_channel_free_set(opl4->chset);
178 opl4->seq_client = -1;
187 struct snd_opl4 *opl4;
189 opl4 = *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
190 if (!opl4)
193 if (opl4->seq_client >= 0) {
194 snd_seq_delete_kernel_client(opl4->seq_client);
195 opl4->seq_client = -1;