• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/sound/drivers/opl3/

Lines Matching refs: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)
54 struct snd_hwdep *hwdep = opl3->hwdep;
64 snd_opl3_reset(opl3);
67 opl3->voices[idx].state = SNDRV_OPL3_ST_OFF;
68 opl3->voices[idx].time = 0;
69 opl3->voices[idx].keyon_reg = 0x00;
71 opl3->use_time = 0;
72 opl3->connection_reg = 0x00;
73 if (opl3->hardware >= OPL3_HW_OPL3) {
75 opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT,
76 opl3->connection_reg);
77 opl3->max_voices = MAX_OPL3_VOICES;
82 void snd_opl3_synth_cleanup(struct snd_opl3 * opl3)
88 spin_lock_irqsave(&opl3->sys_timer_lock, flags);
89 if (opl3->sys_timer_status) {
90 del_timer(&opl3->tlist);
91 opl3->sys_timer_status = 0;
93 spin_unlock_irqrestore(&opl3->sys_timer_lock, flags);
95 snd_opl3_reset(opl3);
96 hwdep = opl3->hwdep;
105 struct snd_opl3 *opl3 = private_data;
108 if ((err = snd_opl3_synth_setup(opl3)) < 0)
113 opl3->voices[6].state = opl3->voices[7].state =
114 opl3->voices[8].state = SNDRV_OPL3_ST_NOT_AVAIL;
115 snd_opl3_load_drums(opl3);
116 opl3->drum_reg = OPL3_PERCUSSION_ENABLE;
117 opl3->command(opl3, OPL3_LEFT | OPL3_REG_PERCUSSION, opl3->drum_reg);
119 opl3->drum_reg = 0x00;
123 if ((err = snd_opl3_synth_use_inc(opl3)) < 0)
126 opl3->synth_mode = SNDRV_OPL3_MODE_SEQ;
132 struct snd_opl3 *opl3 = private_data;
134 snd_opl3_synth_cleanup(opl3);
137 snd_opl3_synth_use_dec(opl3);
157 struct snd_opl3 *opl3 = private_data;
159 snd_midi_process_event(&opl3_ops, ev, opl3->chset);
167 struct snd_opl3 *opl3 = private_data;
169 snd_midi_channel_free_set(opl3->chset);
172 static int snd_opl3_synth_create_port(struct snd_opl3 * opl3)
178 voices = (opl3->hardware < OPL3_HW_OPL3) ?
180 opl3->chset = snd_midi_channel_alloc_set(16);
181 if (opl3->chset == NULL)
183 opl3->chset->private_data = opl3;
191 callbacks.private_data = opl3;
193 opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8;
196 opl3->chset->client = opl3->seq_client;
197 opl3->chset->port = snd_seq_event_port_attach(opl3->seq_client, &callbacks,
207 if (opl3->chset->port < 0) {
209 port = opl3->chset->port;
210 snd_midi_channel_free_set(opl3->chset);
220 struct snd_opl3 *opl3;
225 opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
226 if (opl3 == NULL)
229 spin_lock_init(&opl3->voice_lock);
231 opl3->seq_client = -1;
234 opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8;
236 client = opl3->seq_client =
237 snd_seq_create_kernel_client(opl3->card, opl3->seq_dev_num,
242 if ((err = snd_opl3_synth_create_port(opl3)) < 0) {
244 opl3->seq_client = -1;
249 init_timer(&opl3->tlist);
250 opl3->tlist.function = snd_opl3_timer_func;
251 opl3->tlist.data = (unsigned long) opl3;
252 spin_lock_init(&opl3->sys_timer_lock);
253 opl3->sys_timer_status = 0;
256 snd_opl3_init_seq_oss(opl3, name);
263 struct snd_opl3 *opl3;
265 opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
266 if (opl3 == NULL)
270 snd_opl3_free_seq_oss(opl3);
272 if (opl3->seq_client >= 0) {
273 snd_seq_delete_kernel_client(opl3->seq_client);
274 opl3->seq_client = -1;