• 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 refs:opl3

22 #include <sound/opl3.h>
66 static int snd_opl3_play_note(struct snd_opl3 * opl3, struct snd_dm_fm_note * note);
67 static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * voice);
68 static int snd_opl3_set_params(struct snd_opl3 * opl3, struct snd_dm_fm_params * params);
69 static int snd_opl3_set_mode(struct snd_opl3 * opl3, int mode);
70 static int snd_opl3_set_connection(struct snd_opl3 * opl3, int connection);
79 struct snd_opl3 *opl3 = hw->private_data;
81 mutex_lock(&opl3->access_mutex);
82 if (opl3->used) {
83 mutex_unlock(&opl3->access_mutex);
86 opl3->used++;
87 mutex_unlock(&opl3->access_mutex);
98 struct snd_opl3 *opl3 = hw->private_data;
101 snd_assert(opl3 != NULL, return -EINVAL);
109 info.fm_mode = opl3->fm_mode;
110 info.rhythm = opl3->rhythm;
120 snd_opl3_reset(opl3);
131 return snd_opl3_play_note(opl3, &note);
142 return snd_opl3_set_voice(opl3, &voice);
153 return snd_opl3_set_params(opl3, &params);
160 return snd_opl3_set_mode(opl3, (int) arg);
166 return snd_opl3_set_connection(opl3, (int) arg);
181 struct snd_opl3 *opl3 = hw->private_data;
183 snd_opl3_reset(opl3);
184 mutex_lock(&opl3->access_mutex);
185 opl3->used--;
186 mutex_unlock(&opl3->access_mutex);
193 void snd_opl3_reset(struct snd_opl3 * opl3)
202 max_voices = (opl3->hardware < OPL3_HW_OPL3) ?
217 opl3->command(opl3, opl3_reg, OPL3_TOTAL_LEVEL_MASK); /* Operator 1 volume */
219 opl3->command(opl3, opl3_reg, OPL3_TOTAL_LEVEL_MASK); /* Operator 2 volume */
222 opl3->command(opl3, opl3_reg, 0x00); /* Note off */
225 opl3->max_voices = MAX_OPL2_VOICES;
226 opl3->fm_mode = SNDRV_DM_FM_MODE_OPL2;
228 opl3->command(opl3, OPL3_LEFT | OPL3_REG_TEST, OPL3_ENABLE_WAVE_SELECT);
229 opl3->command(opl3, OPL3_LEFT | OPL3_REG_PERCUSSION, 0x00); /* Melodic mode */
230 opl3->rhythm = 0;
235 static int snd_opl3_play_note(struct snd_opl3 * opl3, struct snd_dm_fm_note * note)
245 if (note->voice >= ((opl3->fm_mode == SNDRV_DM_FM_MODE_OPL3) ?
263 opl3->command(opl3, opl3_reg, reg_val);
276 opl3->command(opl3, opl3_reg, reg_val);
282 static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * voice)
296 if (voice->voice >= ((opl3->fm_mode == SNDRV_DM_FM_MODE_OPL3) ?
331 opl3->command(opl3, opl3_reg, reg_val);
340 opl3->command(opl3, opl3_reg, reg_val);
349 opl3->command(opl3, opl3_reg, reg_val);
358 opl3->command(opl3, opl3_reg, reg_val);
366 if (opl3->fm_mode == SNDRV_DM_FM_MODE_OPL3) {
374 opl3->command(opl3, opl3_reg, reg_val);
379 opl3->command(opl3, opl3_reg, reg_val);
384 static int snd_opl3_set_params(struct snd_opl3 * opl3, struct snd_dm_fm_params * params)
392 opl3->command(opl3, OPL3_LEFT | OPL3_REG_KBD_SPLIT, reg_val);
404 opl3->rhythm = 1;
406 opl3->rhythm = 0;
420 opl3->command(opl3, OPL3_LEFT | OPL3_REG_PERCUSSION, reg_val);
424 static int snd_opl3_set_mode(struct snd_opl3 * opl3, int mode)
426 if ((mode == SNDRV_DM_FM_MODE_OPL3) && (opl3->hardware < OPL3_HW_OPL3))
429 opl3->fm_mode = mode;
430 if (opl3->hardware >= OPL3_HW_OPL3)
431 opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT, 0x00); /* Clear 4-op connections */
436 static int snd_opl3_set_connection(struct snd_opl3 * opl3, int connection)
441 if (opl3->fm_mode != SNDRV_DM_FM_MODE_OPL3)
447 opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT, reg_val);