Lines Matching defs: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 scoped_guard(mutex, &opl4->access_mutex) {
67 if (opl4->used)
69 opl4->used++;
72 err = snd_opl4_seq_use_inc(opl4);
78 snd_opl4_synth_reset(opl4);
84 struct snd_opl4 *opl4 = private_data;
86 snd_opl4_synth_shutdown(opl4);
88 scoped_guard(mutex, &opl4->access_mutex) {
89 opl4->used--;
93 snd_opl4_seq_use_dec(opl4);
108 struct snd_opl4 *opl4 = private_data;
110 snd_midi_process_event(&opl4_ops, ev, opl4->chset);
116 struct snd_opl4 *opl4 = private_data;
118 snd_midi_channel_free_set(opl4->chset);
124 struct snd_opl4 *opl4;
128 opl4 = *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
129 if (!opl4)
132 if (snd_yrw801_detect(opl4) < 0)
135 opl4->chset = snd_midi_channel_alloc_set(16);
136 if (!opl4->chset)
138 opl4->chset->private_data = opl4;
141 client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num,
144 snd_midi_channel_free_set(opl4->chset);
147 opl4->seq_client = client;
148 opl4->chset->client = client;
157 pcallbacks.private_data = opl4;
159 opl4->chset->port = snd_seq_event_port_attach(client, &pcallbacks,
168 if (opl4->chset->port < 0) {
169 int err = opl4->chset->port;
170 snd_midi_channel_free_set(opl4->chset);
172 opl4->seq_client = -1;
181 struct snd_opl4 *opl4;
183 opl4 = *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
184 if (!opl4)
187 if (opl4->seq_client >= 0) {
188 snd_seq_delete_kernel_client(opl4->seq_client);
189 opl4->seq_client = -1;