• Home
  • Raw
  • Download

Lines Matching refs:opl3

60 static int snd_opl3_play_note(struct snd_opl3 * opl3, struct snd_dm_fm_note * note);
61 static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * voice);
62 static int snd_opl3_set_params(struct snd_opl3 * opl3, struct snd_dm_fm_params * params);
63 static int snd_opl3_set_mode(struct snd_opl3 * opl3, int mode);
64 static int snd_opl3_set_connection(struct snd_opl3 * opl3, int connection);
82 struct snd_opl3 *opl3 = hw->private_data; in snd_opl3_ioctl() local
85 if (snd_BUG_ON(!opl3)) in snd_opl3_ioctl()
96 info.fm_mode = opl3->fm_mode; in snd_opl3_ioctl()
97 info.rhythm = opl3->rhythm; in snd_opl3_ioctl()
107 snd_opl3_reset(opl3); in snd_opl3_ioctl()
118 return snd_opl3_play_note(opl3, &note); in snd_opl3_ioctl()
129 return snd_opl3_set_voice(opl3, &voice); in snd_opl3_ioctl()
140 return snd_opl3_set_params(opl3, &params); in snd_opl3_ioctl()
147 return snd_opl3_set_mode(opl3, (int) arg); in snd_opl3_ioctl()
153 return snd_opl3_set_connection(opl3, (int) arg); in snd_opl3_ioctl()
157 snd_opl3_clear_patches(opl3); in snd_opl3_ioctl()
174 struct snd_opl3 *opl3 = hw->private_data; in snd_opl3_release() local
176 snd_opl3_reset(opl3); in snd_opl3_release()
187 struct snd_opl3 *opl3 = hw->private_data; in snd_opl3_write() local
203 err = snd_opl3_load_patch(opl3, inst.prog, inst.bank, type, in snd_opl3_write()
241 int snd_opl3_load_patch(struct snd_opl3 *opl3, in snd_opl3_load_patch() argument
250 patch = snd_opl3_find_patch(opl3, prog, bank, 1); in snd_opl3_load_patch()
304 struct fm_patch *snd_opl3_find_patch(struct snd_opl3 *opl3, int prog, int bank, in snd_opl3_find_patch() argument
311 for (patch = opl3->patch_table[key]; patch; patch = patch->next) { in snd_opl3_find_patch()
323 patch->next = opl3->patch_table[key]; in snd_opl3_find_patch()
324 opl3->patch_table[key] = patch; in snd_opl3_find_patch()
332 void snd_opl3_clear_patches(struct snd_opl3 *opl3) in snd_opl3_clear_patches() argument
337 for (patch = opl3->patch_table[i]; patch; patch = next) { in snd_opl3_clear_patches()
342 memset(opl3->patch_table, 0, sizeof(opl3->patch_table)); in snd_opl3_clear_patches()
348 void snd_opl3_reset(struct snd_opl3 * opl3) in snd_opl3_reset() argument
357 max_voices = (opl3->hardware < OPL3_HW_OPL3) ? in snd_opl3_reset()
372 opl3->command(opl3, opl3_reg, OPL3_TOTAL_LEVEL_MASK); /* Operator 1 volume */ in snd_opl3_reset()
374 opl3->command(opl3, opl3_reg, OPL3_TOTAL_LEVEL_MASK); /* Operator 2 volume */ in snd_opl3_reset()
377 opl3->command(opl3, opl3_reg, 0x00); /* Note off */ in snd_opl3_reset()
380 opl3->max_voices = MAX_OPL2_VOICES; in snd_opl3_reset()
381 opl3->fm_mode = SNDRV_DM_FM_MODE_OPL2; in snd_opl3_reset()
383 opl3->command(opl3, OPL3_LEFT | OPL3_REG_TEST, OPL3_ENABLE_WAVE_SELECT); in snd_opl3_reset()
384 opl3->command(opl3, OPL3_LEFT | OPL3_REG_PERCUSSION, 0x00); /* Melodic mode */ in snd_opl3_reset()
385 opl3->rhythm = 0; in snd_opl3_reset()
390 static int snd_opl3_play_note(struct snd_opl3 * opl3, struct snd_dm_fm_note * note) in snd_opl3_play_note() argument
400 if (note->voice >= ((opl3->fm_mode == SNDRV_DM_FM_MODE_OPL3) ? in snd_opl3_play_note()
418 opl3->command(opl3, opl3_reg, reg_val); in snd_opl3_play_note()
431 opl3->command(opl3, opl3_reg, reg_val); in snd_opl3_play_note()
437 static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * voice) in snd_opl3_set_voice() argument
451 if (voice->voice >= ((opl3->fm_mode == SNDRV_DM_FM_MODE_OPL3) ? in snd_opl3_set_voice()
488 opl3->command(opl3, opl3_reg, reg_val); in snd_opl3_set_voice()
497 opl3->command(opl3, opl3_reg, reg_val); in snd_opl3_set_voice()
506 opl3->command(opl3, opl3_reg, reg_val); in snd_opl3_set_voice()
515 opl3->command(opl3, opl3_reg, reg_val); in snd_opl3_set_voice()
523 if (opl3->fm_mode == SNDRV_DM_FM_MODE_OPL3) { in snd_opl3_set_voice()
531 opl3->command(opl3, opl3_reg, reg_val); in snd_opl3_set_voice()
536 opl3->command(opl3, opl3_reg, reg_val); in snd_opl3_set_voice()
541 static int snd_opl3_set_params(struct snd_opl3 * opl3, struct snd_dm_fm_params * params) in snd_opl3_set_params() argument
549 opl3->command(opl3, OPL3_LEFT | OPL3_REG_KBD_SPLIT, reg_val); in snd_opl3_set_params()
561 opl3->rhythm = 1; in snd_opl3_set_params()
563 opl3->rhythm = 0; in snd_opl3_set_params()
577 opl3->command(opl3, OPL3_LEFT | OPL3_REG_PERCUSSION, reg_val); in snd_opl3_set_params()
581 static int snd_opl3_set_mode(struct snd_opl3 * opl3, int mode) in snd_opl3_set_mode() argument
583 if ((mode == SNDRV_DM_FM_MODE_OPL3) && (opl3->hardware < OPL3_HW_OPL3)) in snd_opl3_set_mode()
586 opl3->fm_mode = mode; in snd_opl3_set_mode()
587 if (opl3->hardware >= OPL3_HW_OPL3) in snd_opl3_set_mode()
588 opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT, 0x00); /* Clear 4-op connections */ in snd_opl3_set_mode()
593 static int snd_opl3_set_connection(struct snd_opl3 * opl3, int connection) in snd_opl3_set_connection() argument
598 if (opl3->fm_mode != SNDRV_DM_FM_MODE_OPL3) in snd_opl3_set_connection()
604 opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT, reg_val); in snd_opl3_set_connection()