• Home
  • Raw
  • Download

Lines Matching refs:opl3

39 int snd_opl3_synth_use_inc(struct snd_opl3 * opl3)  in snd_opl3_synth_use_inc()  argument
41 if (!try_module_get(opl3->card->module)) in snd_opl3_synth_use_inc()
47 void snd_opl3_synth_use_dec(struct snd_opl3 * opl3) in snd_opl3_synth_use_dec() argument
49 module_put(opl3->card->module); in snd_opl3_synth_use_dec()
52 int snd_opl3_synth_setup(struct snd_opl3 * opl3) in snd_opl3_synth_setup() argument
55 struct snd_hwdep *hwdep = opl3->hwdep; in snd_opl3_synth_setup()
65 snd_opl3_reset(opl3); in snd_opl3_synth_setup()
68 opl3->voices[idx].state = SNDRV_OPL3_ST_OFF; in snd_opl3_synth_setup()
69 opl3->voices[idx].time = 0; in snd_opl3_synth_setup()
70 opl3->voices[idx].keyon_reg = 0x00; in snd_opl3_synth_setup()
72 opl3->use_time = 0; in snd_opl3_synth_setup()
73 opl3->connection_reg = 0x00; in snd_opl3_synth_setup()
74 if (opl3->hardware >= OPL3_HW_OPL3) { in snd_opl3_synth_setup()
76 opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT, in snd_opl3_synth_setup()
77 opl3->connection_reg); in snd_opl3_synth_setup()
78 opl3->max_voices = MAX_OPL3_VOICES; in snd_opl3_synth_setup()
83 void snd_opl3_synth_cleanup(struct snd_opl3 * opl3) in snd_opl3_synth_cleanup() argument
89 spin_lock_irqsave(&opl3->sys_timer_lock, flags); in snd_opl3_synth_cleanup()
90 if (opl3->sys_timer_status) { in snd_opl3_synth_cleanup()
91 del_timer(&opl3->tlist); in snd_opl3_synth_cleanup()
92 opl3->sys_timer_status = 0; in snd_opl3_synth_cleanup()
94 spin_unlock_irqrestore(&opl3->sys_timer_lock, flags); in snd_opl3_synth_cleanup()
96 snd_opl3_reset(opl3); in snd_opl3_synth_cleanup()
97 hwdep = opl3->hwdep; in snd_opl3_synth_cleanup()
106 struct snd_opl3 *opl3 = private_data; in snd_opl3_synth_use() local
109 if ((err = snd_opl3_synth_setup(opl3)) < 0) in snd_opl3_synth_use()
114 opl3->voices[6].state = opl3->voices[7].state = in snd_opl3_synth_use()
115 opl3->voices[8].state = SNDRV_OPL3_ST_NOT_AVAIL; in snd_opl3_synth_use()
116 snd_opl3_load_drums(opl3); in snd_opl3_synth_use()
117 opl3->drum_reg = OPL3_PERCUSSION_ENABLE; in snd_opl3_synth_use()
118 opl3->command(opl3, OPL3_LEFT | OPL3_REG_PERCUSSION, opl3->drum_reg); in snd_opl3_synth_use()
120 opl3->drum_reg = 0x00; in snd_opl3_synth_use()
124 if ((err = snd_opl3_synth_use_inc(opl3)) < 0) in snd_opl3_synth_use()
127 opl3->synth_mode = SNDRV_OPL3_MODE_SEQ; in snd_opl3_synth_use()
133 struct snd_opl3 *opl3 = private_data; in snd_opl3_synth_unuse() local
135 snd_opl3_synth_cleanup(opl3); in snd_opl3_synth_unuse()
138 snd_opl3_synth_use_dec(opl3); in snd_opl3_synth_unuse()
158 struct snd_opl3 *opl3 = private_data; in snd_opl3_synth_event_input() local
160 snd_midi_process_event(&opl3_ops, ev, opl3->chset); in snd_opl3_synth_event_input()
168 struct snd_opl3 *opl3 = private_data; in snd_opl3_synth_free_port() local
170 snd_midi_channel_free_set(opl3->chset); in snd_opl3_synth_free_port()
173 static int snd_opl3_synth_create_port(struct snd_opl3 * opl3) in snd_opl3_synth_create_port() argument
179 voices = (opl3->hardware < OPL3_HW_OPL3) ? in snd_opl3_synth_create_port()
181 opl3->chset = snd_midi_channel_alloc_set(16); in snd_opl3_synth_create_port()
182 if (opl3->chset == NULL) in snd_opl3_synth_create_port()
184 opl3->chset->private_data = opl3; in snd_opl3_synth_create_port()
192 callbacks.private_data = opl3; in snd_opl3_synth_create_port()
194 opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8; in snd_opl3_synth_create_port()
197 opl3->chset->client = opl3->seq_client; in snd_opl3_synth_create_port()
198 opl3->chset->port = snd_seq_event_port_attach(opl3->seq_client, &callbacks, in snd_opl3_synth_create_port()
208 if (opl3->chset->port < 0) { in snd_opl3_synth_create_port()
210 port = opl3->chset->port; in snd_opl3_synth_create_port()
211 snd_midi_channel_free_set(opl3->chset); in snd_opl3_synth_create_port()
221 struct snd_opl3 *opl3; in snd_opl3_seq_new_device() local
226 opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev); in snd_opl3_seq_new_device()
227 if (opl3 == NULL) in snd_opl3_seq_new_device()
230 spin_lock_init(&opl3->voice_lock); in snd_opl3_seq_new_device()
232 opl3->seq_client = -1; in snd_opl3_seq_new_device()
235 opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8; in snd_opl3_seq_new_device()
237 client = opl3->seq_client = in snd_opl3_seq_new_device()
238 snd_seq_create_kernel_client(opl3->card, opl3->seq_dev_num, in snd_opl3_seq_new_device()
243 if ((err = snd_opl3_synth_create_port(opl3)) < 0) { in snd_opl3_seq_new_device()
245 opl3->seq_client = -1; in snd_opl3_seq_new_device()
250 init_timer(&opl3->tlist); in snd_opl3_seq_new_device()
251 opl3->tlist.function = snd_opl3_timer_func; in snd_opl3_seq_new_device()
252 opl3->tlist.data = (unsigned long) opl3; in snd_opl3_seq_new_device()
253 spin_lock_init(&opl3->sys_timer_lock); in snd_opl3_seq_new_device()
254 opl3->sys_timer_status = 0; in snd_opl3_seq_new_device()
257 snd_opl3_init_seq_oss(opl3, name); in snd_opl3_seq_new_device()
264 struct snd_opl3 *opl3; in snd_opl3_seq_delete_device() local
266 opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev); in snd_opl3_seq_delete_device()
267 if (opl3 == NULL) in snd_opl3_seq_delete_device()
271 snd_opl3_free_seq_oss(opl3); in snd_opl3_seq_delete_device()
273 if (opl3->seq_client >= 0) { in snd_opl3_seq_delete_device()
274 snd_seq_delete_kernel_client(opl3->seq_client); in snd_opl3_seq_delete_device()
275 opl3->seq_client = -1; in snd_opl3_seq_delete_device()