• 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

23 #include <sound/opl3.h>
71 static int snd_opl3_play_note(struct snd_opl3 * opl3, struct snd_dm_fm_note * note);
72 static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * voice);
73 static int snd_opl3_set_params(struct snd_opl3 * opl3, struct snd_dm_fm_params * params);
74 static int snd_opl3_set_mode(struct snd_opl3 * opl3, int mode);
75 static int snd_opl3_set_connection(struct snd_opl3 * opl3, int connection);
93 struct snd_opl3 *opl3 = hw->private_data;
96 if (snd_BUG_ON(!opl3))
105 info.fm_mode = opl3->fm_mode;
106 info.rhythm = opl3->rhythm;
116 snd_opl3_reset(opl3);
127 return snd_opl3_play_note(opl3, &note);
138 return snd_opl3_set_voice(opl3, &voice);
149 return snd_opl3_set_params(opl3, &params);
156 return snd_opl3_set_mode(opl3, (int) arg);
162 return snd_opl3_set_connection(opl3, (int) arg);
166 snd_opl3_clear_patches(opl3);
183 struct snd_opl3 *opl3 = hw->private_data;
185 snd_opl3_reset(opl3);
196 struct snd_opl3 *opl3 = hw->private_data;
212 err = snd_opl3_load_patch(opl3, inst.prog, inst.bank, type,
250 int snd_opl3_load_patch(struct snd_opl3 *opl3,
259 patch = snd_opl3_find_patch(opl3, prog, bank, 1);
313 struct fm_patch *snd_opl3_find_patch(struct snd_opl3 *opl3, int prog, int bank,
320 for (patch = opl3->patch_table[key]; patch; patch = patch->next) {
332 patch->next = opl3->patch_table[key];
333 opl3->patch_table[key] = patch;
341 void snd_opl3_clear_patches(struct snd_opl3 *opl3)
346 for (patch = opl3->patch_table[i]; patch; patch = next) {
351 memset(opl3->patch_table, 0, sizeof(opl3->patch_table));
357 void snd_opl3_reset(struct snd_opl3 * opl3)
366 max_voices = (opl3->hardware < OPL3_HW_OPL3) ?
381 opl3->command(opl3, opl3_reg, OPL3_TOTAL_LEVEL_MASK); /* Operator 1 volume */
383 opl3->command(opl3, opl3_reg, OPL3_TOTAL_LEVEL_MASK); /* Operator 2 volume */
386 opl3->command(opl3, opl3_reg, 0x00); /* Note off */
389 opl3->max_voices = MAX_OPL2_VOICES;
390 opl3->fm_mode = SNDRV_DM_FM_MODE_OPL2;
392 opl3->command(opl3, OPL3_LEFT | OPL3_REG_TEST, OPL3_ENABLE_WAVE_SELECT);
393 opl3->command(opl3, OPL3_LEFT | OPL3_REG_PERCUSSION, 0x00); /* Melodic mode */
394 opl3->rhythm = 0;
399 static int snd_opl3_play_note(struct snd_opl3 * opl3, struct snd_dm_fm_note * note)
409 if (note->voice >= ((opl3->fm_mode == SNDRV_DM_FM_MODE_OPL3) ?
427 opl3->command(opl3, opl3_reg, reg_val);
440 opl3->command(opl3, opl3_reg, reg_val);
446 static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * voice)
460 if (voice->voice >= ((opl3->fm_mode == SNDRV_DM_FM_MODE_OPL3) ?
495 opl3->command(opl3, opl3_reg, reg_val);
504 opl3->command(opl3, opl3_reg, reg_val);
513 opl3->command(opl3, opl3_reg, reg_val);
522 opl3->command(opl3, opl3_reg, reg_val);
530 if (opl3->fm_mode == SNDRV_DM_FM_MODE_OPL3) {
538 opl3->command(opl3, opl3_reg, reg_val);
543 opl3->command(opl3, opl3_reg, reg_val);
548 static int snd_opl3_set_params(struct snd_opl3 * opl3, struct snd_dm_fm_params * params)
556 opl3->command(opl3, OPL3_LEFT | OPL3_REG_KBD_SPLIT, reg_val);
568 opl3->rhythm = 1;
570 opl3->rhythm = 0;
584 opl3->command(opl3, OPL3_LEFT | OPL3_REG_PERCUSSION, reg_val);
588 static int snd_opl3_set_mode(struct snd_opl3 * opl3, int mode)
590 if ((mode == SNDRV_DM_FM_MODE_OPL3) && (opl3->hardware < OPL3_HW_OPL3))
593 opl3->fm_mode = mode;
594 if (opl3->hardware >= OPL3_HW_OPL3)
595 opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT, 0x00); /* Clear 4-op connections */
600 static int snd_opl3_set_connection(struct snd_opl3 * opl3, int connection)
605 if (opl3->fm_mode != SNDRV_DM_FM_MODE_OPL3)
611 opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT, reg_val);