• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/sound/pci/

Lines Matching refs:voice

59 struct voice {
73 struct voice *timing;
107 /* voice_lock protects allocation/freeing of the voice descriptions
111 struct voice voices[64];
112 struct voice capture_voice;
179 static void sis_update_sso(struct voice *voice, u16 period)
181 void __iomem *base = voice->ctrl_base;
183 voice->sso += period;
184 if (voice->sso >= voice->buffer_size)
185 voice->sso -= voice->buffer_size;
188 if (voice->sso < 8)
189 voice->sso = 8;
192 writew(voice->sso & 0xffff, base + SIS_PLAY_DMA_SSO_ESO + 2);
195 static void sis_update_voice(struct voice *voice)
197 if (voice->flags & VOICE_SSO_TIMING) {
198 sis_update_sso(voice, voice->period_size);
199 } else if (voice->flags & VOICE_SYNC_TIMING) {
205 if (voice->vperiod > voice->period_size) {
206 voice->vperiod -= voice->period_size;
207 if (voice->vperiod < voice->period_size)
208 sis_update_sso(voice, voice->vperiod);
210 sis_update_sso(voice, voice->period_size);
219 sync = voice->sync_cso;
220 sync -= readw(voice->sync_base + SIS_CAPTURE_DMA_FORMAT_CSO);
221 if (sync > (voice->sync_buffer_size / 2))
222 sync -= voice->sync_buffer_size;
232 sis_update_sso(voice, sync);
252 voice->vperiod = voice->sync_period_size + 1;
254 voice->vperiod = voice->sync_period_size + sync + 10;
256 if (voice->vperiod < voice->buffer_size) {
257 sis_update_sso(voice, voice->vperiod);
258 voice->vperiod = 0;
260 sis_update_sso(voice, voice->period_size);
262 sync = voice->sync_cso + voice->sync_period_size;
263 if (sync >= voice->sync_buffer_size)
264 sync -= voice->sync_buffer_size;
265 voice->sync_cso = sync;
268 snd_pcm_period_elapsed(voice->substream);
271 static void sis_voice_irq(u32 status, struct voice *voice)
278 voice += bit;
279 sis_update_voice(voice);
280 voice++;
288 struct voice *voice;
318 voice = &sis->capture_voice;
319 if (!voice->timing)
320 snd_pcm_period_elapsed(voice->substream);
376 static void sis_free_voice(struct sis7019 *sis, struct voice *voice)
381 if (voice->timing) {
383 voice->timing->flags &= ~(VOICE_IN_USE | VOICE_SSO_TIMING |
385 voice->timing = NULL;
387 voice->flags &= ~(VOICE_IN_USE | VOICE_SSO_TIMING | VOICE_SYNC_TIMING);
391 static struct voice *__sis_alloc_playback_voice(struct sis7019 *sis)
394 struct voice *voice;
398 voice = &sis->voices[i];
399 if (voice->flags & VOICE_IN_USE)
401 voice->flags |= VOICE_IN_USE;
404 voice = NULL;
407 return voice;
410 static struct voice *sis_alloc_playback_voice(struct sis7019 *sis)
412 struct voice *voice;
416 voice = __sis_alloc_playback_voice(sis);
419 return voice;
427 struct voice *voice = runtime->private_data;
433 * timing voice, as we can use the capture channel's interrupts
441 if (needed && !voice->timing) {
443 voice->timing = __sis_alloc_playback_voice(sis);
444 if (voice->timing)
447 if (!voice->timing)
449 voice->timing->substream = substream;
450 } else if (!needed && voice->timing) {
451 sis_free_voice(sis, voice);
452 voice->timing = NULL;
462 struct voice *voice;
464 voice = sis_alloc_playback_voice(sis);
465 if (!voice)
468 voice->substream = substream;
469 runtime->private_data = voice;
483 struct voice *voice = runtime->private_data;
485 sis_free_voice(sis, voice);
504 struct voice *voice = runtime->private_data;
505 void __iomem *ctrl_base = voice->ctrl_base;
506 void __iomem *wave_base = voice->wave_base;
532 voice->flags |= VOICE_SSO_TIMING;
533 voice->sso = runtime->period_size - 1;
534 voice->period_size = runtime->period_size;
535 voice->buffer_size = runtime->buffer_size;
572 struct voice *voice;
603 voice = s->runtime->private_data;
604 if (voice->flags & VOICE_CAPTURE) {
605 record |= 1 << voice->num;
606 voice = voice->timing;
609 /* voice could be NULL if this a recording stream, and it
612 if (voice)
613 play[voice->num / 32] |= 1 << (voice->num & 0x1f);
639 struct voice *voice = runtime->private_data;
642 cso = readl(voice->ctrl_base + SIS_PLAY_DMA_FORMAT_CSO);
651 struct voice *voice = &sis->capture_voice;
655 if (voice->flags & VOICE_IN_USE)
656 voice = NULL;
658 voice->flags |= VOICE_IN_USE;
661 if (!voice)
664 voice->substream = substream;
665 runtime->private_data = voice;
699 static void sis_prepare_timing_voice(struct voice *voice,
704 struct voice *timing = voice->timing;
758 timing->sync_base = voice->ctrl_base;
805 struct voice *voice = runtime->private_data;
806 void __iomem *rec_base = voice->ctrl_base;
826 * use a timing voice to clock out the periods. Otherwise, we can
829 if (voice->timing) {
830 sis_prepare_timing_voice(voice, substream);
1268 struct voice *voice;
1326 voice = &sis->voices[i];
1327 voice->num = i;
1328 voice->ctrl_base = SIS_PLAY_DMA_ADDR(sis->ioaddr, i);
1329 voice->wave_base = SIS_WAVE_ADDR(sis->ioaddr, i);
1332 voice = &sis->capture_voice;
1333 voice->flags = VOICE_CAPTURE;
1334 voice->num = SIS_CAPTURE_CHAN_AC97_PCM_IN;
1335 voice->ctrl_base = SIS_CAPTURE_DMA_ADDR(sis->ioaddr, voice->num);