• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/sound/drivers/opl3/

Lines Matching defs:opl3

38 int snd_opl3_synth_use_inc(struct snd_opl3 * opl3)
40 if (!try_module_get(opl3->card->module))
46 void snd_opl3_synth_use_dec(struct snd_opl3 * opl3)
48 module_put(opl3->card->module);
51 int snd_opl3_synth_setup(struct snd_opl3 * opl3)
55 mutex_lock(&opl3->access_mutex);
56 if (opl3->used) {
57 mutex_unlock(&opl3->access_mutex);
60 opl3->used++;
61 mutex_unlock(&opl3->access_mutex);
63 snd_opl3_reset(opl3);
66 opl3->voices[idx].state = SNDRV_OPL3_ST_OFF;
67 opl3->voices[idx].time = 0;
68 opl3->voices[idx].keyon_reg = 0x00;
70 opl3->use_time = 0;
71 opl3->connection_reg = 0x00;
72 if (opl3->hardware >= OPL3_HW_OPL3) {
74 opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT,
75 opl3->connection_reg);
76 opl3->max_voices = MAX_OPL3_VOICES;
81 void snd_opl3_synth_cleanup(struct snd_opl3 * opl3)
86 spin_lock_irqsave(&opl3->sys_timer_lock, flags);
87 if (opl3->sys_timer_status) {
88 del_timer(&opl3->tlist);
89 opl3->sys_timer_status = 0;
91 spin_unlock_irqrestore(&opl3->sys_timer_lock, flags);
93 snd_opl3_reset(opl3);
94 mutex_lock(&opl3->access_mutex);
95 opl3->used--;
96 mutex_unlock(&opl3->access_mutex);
101 struct snd_opl3 *opl3 = private_data;
104 if ((err = snd_opl3_synth_setup(opl3)) < 0)
109 opl3->voices[6].state = opl3->voices[7].state =
110 opl3->voices[8].state = SNDRV_OPL3_ST_NOT_AVAIL;
111 snd_opl3_load_drums(opl3);
112 opl3->drum_reg = OPL3_PERCUSSION_ENABLE;
113 opl3->command(opl3, OPL3_LEFT | OPL3_REG_PERCUSSION, opl3->drum_reg);
115 opl3->drum_reg = 0x00;
119 if ((err = snd_opl3_synth_use_inc(opl3)) < 0)
122 opl3->synth_mode = SNDRV_OPL3_MODE_SEQ;
128 struct snd_opl3 *opl3 = private_data;
130 snd_opl3_synth_cleanup(opl3);
133 snd_opl3_synth_use_dec(opl3);
153 struct snd_opl3 *opl3 = private_data;
158 snd_seq_instr_event(&opl3->fm_ops, opl3->ilist, ev,
159 opl3->seq_client, atomic, hop);
162 snd_midi_process_event(&opl3_ops, ev, opl3->chset);
171 struct snd_opl3 *opl3 = private_data;
173 snd_midi_channel_free_set(opl3->chset);
176 static int snd_opl3_synth_create_port(struct snd_opl3 * opl3)
182 voices = (opl3->hardware < OPL3_HW_OPL3) ?
184 opl3->chset = snd_midi_channel_alloc_set(16);
185 if (opl3->chset == NULL)
187 opl3->chset->private_data = opl3;
195 callbacks.private_data = opl3;
197 opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8;
200 opl3->chset->client = opl3->seq_client;
201 opl3->chset->port = snd_seq_event_port_attach(opl3->seq_client, &callbacks,
211 if (opl3->chset->port < 0) {
213 port = opl3->chset->port;
214 snd_midi_channel_free_set(opl3->chset);
224 struct snd_opl3 *opl3;
229 opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
230 if (opl3 == NULL)
233 spin_lock_init(&opl3->voice_lock);
235 opl3->seq_client = -1;
238 opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8;
240 client = opl3->seq_client =
241 snd_seq_create_kernel_client(opl3->card, opl3->seq_dev_num,
246 if ((err = snd_opl3_synth_create_port(opl3)) < 0) {
248 opl3->seq_client = -1;
253 opl3->ilist = snd_seq_instr_list_new();
254 if (opl3->ilist == NULL) {
256 opl3->seq_client = -1;
259 opl3->ilist->flags = SNDRV_SEQ_INSTR_FLG_DIRECT;
260 snd_seq_fm_init(&opl3->fm_ops, NULL);
263 init_timer(&opl3->tlist);
264 opl3->tlist.function = snd_opl3_timer_func;
265 opl3->tlist.data = (unsigned long) opl3;
266 spin_lock_init(&opl3->sys_timer_lock);
267 opl3->sys_timer_status = 0;
270 snd_opl3_init_seq_oss(opl3, name);
277 struct snd_opl3 *opl3;
279 opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
280 if (opl3 == NULL)
284 snd_opl3_free_seq_oss(opl3);
286 if (opl3->seq_client >= 0) {
287 snd_seq_delete_kernel_client(opl3->seq_client);
288 opl3->seq_client = -1;
290 if (opl3->ilist)
291 snd_seq_instr_list_free(&opl3->ilist);