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

Lines Matching refs:opl4

273 void snd_opl4_synth_reset(struct snd_opl4 *opl4)
278 spin_lock_irqsave(&opl4->reg_lock, flags);
280 snd_opl4_write(opl4, OPL4_REG_MISC + i, OPL4_DAMP_BIT);
281 spin_unlock_irqrestore(&opl4->reg_lock, flags);
283 INIT_LIST_HEAD(&opl4->off_voices);
284 INIT_LIST_HEAD(&opl4->on_voices);
285 memset(opl4->voices, 0, sizeof(opl4->voices));
287 opl4->voices[i].number = i;
288 list_add_tail(&opl4->voices[i].list, &opl4->off_voices);
291 snd_midi_channel_set_clear(opl4->chset);
297 void snd_opl4_synth_shutdown(struct snd_opl4 *opl4)
302 spin_lock_irqsave(&opl4->reg_lock, flags);
304 snd_opl4_write(opl4, OPL4_REG_MISC + i,
305 opl4->voices[i].reg_misc & ~OPL4_KEY_ON_BIT);
306 spin_unlock_irqrestore(&opl4->reg_lock, flags);
312 static void snd_opl4_do_for_note(struct snd_opl4 *opl4, int note, struct snd_midi_channel *chan,
313 void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice))
319 spin_lock_irqsave(&opl4->reg_lock, flags);
321 voice = &opl4->voices[i];
323 func(opl4, voice);
326 spin_unlock_irqrestore(&opl4->reg_lock, flags);
332 static void snd_opl4_do_for_channel(struct snd_opl4 *opl4,
334 void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice))
340 spin_lock_irqsave(&opl4->reg_lock, flags);
342 voice = &opl4->voices[i];
344 func(opl4, voice);
347 spin_unlock_irqrestore(&opl4->reg_lock, flags);
353 static void snd_opl4_do_for_all(struct snd_opl4 *opl4,
354 void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice))
360 spin_lock_irqsave(&opl4->reg_lock, flags);
362 voice = &opl4->voices[i];
364 func(opl4, voice);
366 spin_unlock_irqrestore(&opl4->reg_lock, flags);
369 static void snd_opl4_update_volume(struct snd_opl4 *opl4, struct opl4_voice *voice)
374 att += snd_opl4_volume_table[opl4->chset->gs_master_volume & 0x7f];
383 snd_opl4_write(opl4, OPL4_REG_LEVEL + voice->number,
388 static void snd_opl4_update_pan(struct snd_opl4 *opl4, struct opl4_voice *voice)
400 snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
403 static void snd_opl4_update_vibrato_depth(struct snd_opl4 *opl4,
415 snd_opl4_write(opl4, OPL4_REG_LFO_VIBRATO + voice->number,
419 static void snd_opl4_update_pitch(struct snd_opl4 *opl4,
443 snd_opl4_write(opl4, OPL4_REG_OCTAVE + voice->number,
447 snd_opl4_write(opl4, OPL4_REG_F_NUMBER + voice->number, voice->reg_f_number);
450 static void snd_opl4_update_tone_parameters(struct snd_opl4 *opl4,
453 snd_opl4_write(opl4, OPL4_REG_ATTACK_DECAY1 + voice->number,
455 snd_opl4_write(opl4, OPL4_REG_LEVEL_DECAY2 + voice->number,
457 snd_opl4_write(opl4, OPL4_REG_RELEASE_CORRECTION + voice->number,
459 snd_opl4_write(opl4, OPL4_REG_TREMOLO + voice->number,
464 static struct opl4_voice *snd_opl4_get_voice(struct snd_opl4 *opl4)
467 if (!list_empty(&opl4->off_voices))
468 return list_entry(opl4->off_voices.next, struct opl4_voice, list);
470 snd_assert(!list_empty(&opl4->on_voices), );
471 return list_entry(opl4->on_voices.next, struct opl4_voice, list);
474 static void snd_opl4_wait_for_wave_headers(struct snd_opl4 *opl4)
478 while ((inb(opl4->fm_port) & OPL4_STATUS_LOAD) && --timeout > 0)
484 struct snd_opl4 *opl4 = private_data;
504 spin_lock_irqsave(&opl4->reg_lock, flags);
506 voice[i] = snd_opl4_get_voice(opl4);
508 list_add_tail(&voice[i]->list, &opl4->on_voices);
519 snd_opl4_write(opl4, OPL4_REG_F_NUMBER + voice[i]->number,
521 snd_opl4_write(opl4, OPL4_REG_TONE_NUMBER + voice[i]->number,
528 snd_opl4_update_pan(opl4, voice[i]);
529 snd_opl4_update_pitch(opl4, voice[i]);
531 snd_opl4_update_volume(opl4, voice[i]);
533 spin_unlock_irqrestore(&opl4->reg_lock, flags);
536 snd_opl4_wait_for_wave_headers(opl4);
539 spin_lock_irqsave(&opl4->reg_lock, flags);
541 snd_opl4_update_tone_parameters(opl4, voice[i]);
543 snd_opl4_update_vibrato_depth(opl4, voice[i]);
550 snd_opl4_write(opl4, OPL4_REG_MISC + voice[i]->number,
553 spin_unlock_irqrestore(&opl4->reg_lock, flags);
556 static void snd_opl4_voice_off(struct snd_opl4 *opl4, struct opl4_voice *voice)
559 list_add_tail(&voice->list, &opl4->off_voices);
562 snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
567 struct snd_opl4 *opl4 = private_data;
569 snd_opl4_do_for_note(opl4, note, chan, snd_opl4_voice_off);
572 static void snd_opl4_terminate_voice(struct snd_opl4 *opl4, struct opl4_voice *voice)
575 list_add_tail(&voice->list, &opl4->off_voices);
578 snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
583 struct snd_opl4 *opl4 = private_data;
585 snd_opl4_do_for_note(opl4, note, chan, snd_opl4_terminate_voice);
590 struct snd_opl4 *opl4 = private_data;
595 snd_opl4_do_for_channel(opl4, chan, snd_opl4_update_vibrato_depth);
598 snd_opl4_do_for_channel(opl4, chan, snd_opl4_update_volume);
601 snd_opl4_do_for_channel(opl4, chan, snd_opl4_update_pan);
604 snd_opl4_do_for_channel(opl4, chan, snd_opl4_update_volume);
610 snd_opl4_do_for_channel(opl4, chan, snd_opl4_update_vibrato_depth);
622 snd_opl4_do_for_channel(opl4, chan, snd_opl4_update_pitch);
630 struct snd_opl4 *opl4 = private_data;
633 snd_opl4_do_for_all(opl4, snd_opl4_update_volume);