Lines Matching defs:emu
24 static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
30 for (i = emu->next_free_voice, j = 0; j < NUM_G; i = (i + skip) % NUM_G, j += skip) {
32 dev_dbg(emu->card->dev, "i %d j %d next free %d!\n",
33 i, j, emu->next_free_voice);
43 voice = &emu->voices[i + k];
51 voice = &emu->voices[i + k];
54 /* dev_dbg(emu->card->dev, "allocated voice %d\n", i + k); */
58 *rvoice = &emu->voices[i];
59 emu->next_free_voice = (i + number) % NUM_G;
67 static void voice_free(struct snd_emu10k1 *emu,
71 snd_emu10k1_voice_init(emu, pvoice->number);
77 int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int count, int channels,
90 spin_lock_irqsave(&emu->voice_lock, flags);
92 result = voice_alloc(emu, type, count, epcm, &rvoice[got]);
96 dev_dbg(emu->card->dev, "voice alloc - %i, %i of %i\n",
101 if (type != EMU10K1_SYNTH && emu->get_synth_voice) {
103 result = emu->get_synth_voice(emu);
105 voice_free(emu, &emu->voices[result]);
111 voice_free(emu, rvoice[i] + j);
116 spin_unlock_irqrestore(&emu->voice_lock, flags);
123 int snd_emu10k1_voice_free(struct snd_emu10k1 *emu,
131 spin_lock_irqsave(&emu->voice_lock, flags);
134 voice_free(emu, pvoice++);
136 spin_unlock_irqrestore(&emu->voice_lock, flags);