Lines Matching refs:dreamcastcard

219 	struct snd_card_aica *dreamcastcard;  in aica_dma_transfer()  local
223 dreamcastcard = substream->pcm->private_data; in aica_dma_transfer()
224 period_offset = dreamcastcard->clicks; in aica_dma_transfer()
248 static void startup_aica(struct snd_card_aica *dreamcastcard) in startup_aica() argument
251 dreamcastcard->channel, sizeof(struct aica_channel)); in startup_aica()
259 struct snd_card_aica *dreamcastcard; in run_spu_dma() local
260 dreamcastcard = in run_spu_dma()
262 runtime = dreamcastcard->substream->runtime; in run_spu_dma()
263 if (unlikely(dreamcastcard->dma_check == 0)) { in run_spu_dma()
267 dreamcastcard->channel->flags |= 0x01; in run_spu_dma()
269 dreamcastcard->substream); in run_spu_dma()
270 startup_aica(dreamcastcard); in run_spu_dma()
271 dreamcastcard->clicks = in run_spu_dma()
277 dreamcastcard->substream); in run_spu_dma()
278 snd_pcm_period_elapsed(dreamcastcard->substream); in run_spu_dma()
279 dreamcastcard->clicks++; in run_spu_dma()
280 if (unlikely(dreamcastcard->clicks >= AICA_PERIOD_NUMBER)) in run_spu_dma()
281 dreamcastcard->clicks %= AICA_PERIOD_NUMBER; in run_spu_dma()
282 mod_timer(&dreamcastcard->timer, jiffies + 1); in run_spu_dma()
288 struct snd_card_aica *dreamcastcard = from_timer(dreamcastcard, in aica_period_elapsed() local
290 struct snd_pcm_substream *substream = dreamcastcard->substream; in aica_period_elapsed()
295 dreamcastcard = substream->pcm->private_data; in aica_period_elapsed()
302 if (play_period == dreamcastcard->current_period) { in aica_period_elapsed()
304 mod_timer(&(dreamcastcard->timer), jiffies + 1); in aica_period_elapsed()
308 dreamcastcard->current_period = play_period; in aica_period_elapsed()
309 if (unlikely(dreamcastcard->dma_check == 0)) in aica_period_elapsed()
310 dreamcastcard->dma_check = 1; in aica_period_elapsed()
311 schedule_work(&(dreamcastcard->spu_dma_work)); in aica_period_elapsed()
316 struct snd_card_aica *dreamcastcard; in spu_begin_dma() local
319 dreamcastcard = substream->pcm->private_data; in spu_begin_dma()
321 schedule_work(&(dreamcastcard->spu_dma_work)); in spu_begin_dma()
322 mod_timer(&dreamcastcard->timer, jiffies + 4); in spu_begin_dma()
330 struct snd_card_aica *dreamcastcard; in snd_aicapcm_pcm_open() local
333 dreamcastcard = substream->pcm->private_data; in snd_aicapcm_pcm_open()
340 channel->vol = dreamcastcard->master_volume; in snd_aicapcm_pcm_open()
344 dreamcastcard->channel = channel; in snd_aicapcm_pcm_open()
348 dreamcastcard->clicks = 0; in snd_aicapcm_pcm_open()
349 dreamcastcard->current_period = 0; in snd_aicapcm_pcm_open()
350 dreamcastcard->dma_check = 0; in snd_aicapcm_pcm_open()
357 struct snd_card_aica *dreamcastcard = substream->pcm->private_data; in snd_aicapcm_pcm_close() local
358 flush_work(&(dreamcastcard->spu_dma_work)); in snd_aicapcm_pcm_close()
359 del_timer(&dreamcastcard->timer); in snd_aicapcm_pcm_close()
360 dreamcastcard->substream = NULL; in snd_aicapcm_pcm_close()
361 kfree(dreamcastcard->channel); in snd_aicapcm_pcm_close()
369 struct snd_card_aica *dreamcastcard = substream->pcm->private_data; in snd_aicapcm_pcm_prepare() local
371 dreamcastcard->channel->sfmt = SM_16BIT; in snd_aicapcm_pcm_prepare()
372 dreamcastcard->channel->freq = substream->runtime->rate; in snd_aicapcm_pcm_prepare()
373 dreamcastcard->substream = substream; in snd_aicapcm_pcm_prepare()
409 *dreamcastcard, int pcm_index) in snd_aicapcmchip()
415 snd_pcm_new(dreamcastcard->card, "AICA PCM", pcm_index, 1, 0, in snd_aicapcmchip()
419 pcm->private_data = dreamcastcard; in snd_aicapcmchip()
465 struct snd_card_aica *dreamcastcard; in aica_pcmvolume_get() local
466 dreamcastcard = kcontrol->private_data; in aica_pcmvolume_get()
467 if (unlikely(!dreamcastcard->channel)) in aica_pcmvolume_get()
469 ucontrol->value.integer.value[0] = dreamcastcard->channel->vol; in aica_pcmvolume_get()
476 struct snd_card_aica *dreamcastcard; in aica_pcmvolume_put() local
478 dreamcastcard = kcontrol->private_data; in aica_pcmvolume_put()
479 if (unlikely(!dreamcastcard->channel)) in aica_pcmvolume_put()
484 if (unlikely(dreamcastcard->channel->vol == vol)) in aica_pcmvolume_put()
486 dreamcastcard->channel->vol = ucontrol->value.integer.value[0]; in aica_pcmvolume_put()
487 dreamcastcard->master_volume = ucontrol->value.integer.value[0]; in aica_pcmvolume_put()
489 dreamcastcard->channel, sizeof(struct aica_channel)); in aica_pcmvolume_put()
527 static int add_aicamixer_controls(struct snd_card_aica *dreamcastcard) in add_aicamixer_controls() argument
531 (dreamcastcard->card, in add_aicamixer_controls()
532 snd_ctl_new1(&snd_aica_pcmvolume_control, dreamcastcard)); in add_aicamixer_controls()
536 (dreamcastcard->card, in add_aicamixer_controls()
537 snd_ctl_new1(&snd_aica_pcmswitch_control, dreamcastcard)); in add_aicamixer_controls()
545 struct snd_card_aica *dreamcastcard; in snd_aica_remove() local
546 dreamcastcard = platform_get_drvdata(devptr); in snd_aica_remove()
547 if (unlikely(!dreamcastcard)) in snd_aica_remove()
549 snd_card_free(dreamcastcard->card); in snd_aica_remove()
550 kfree(dreamcastcard); in snd_aica_remove()
557 struct snd_card_aica *dreamcastcard; in snd_aica_probe() local
558 dreamcastcard = kzalloc(sizeof(struct snd_card_aica), GFP_KERNEL); in snd_aica_probe()
559 if (unlikely(!dreamcastcard)) in snd_aica_probe()
562 THIS_MODULE, 0, &dreamcastcard->card); in snd_aica_probe()
564 kfree(dreamcastcard); in snd_aica_probe()
567 strcpy(dreamcastcard->card->driver, "snd_aica"); in snd_aica_probe()
568 strcpy(dreamcastcard->card->shortname, SND_AICA_DRIVER); in snd_aica_probe()
569 strcpy(dreamcastcard->card->longname, in snd_aica_probe()
572 INIT_WORK(&(dreamcastcard->spu_dma_work), run_spu_dma); in snd_aica_probe()
573 timer_setup(&dreamcastcard->timer, aica_period_elapsed, 0); in snd_aica_probe()
575 err = snd_aicapcmchip(dreamcastcard, 0); in snd_aica_probe()
579 err = add_aicamixer_controls(dreamcastcard); in snd_aica_probe()
583 err = snd_card_register(dreamcastcard->card); in snd_aica_probe()
586 platform_set_drvdata(devptr, dreamcastcard); in snd_aica_probe()
591 snd_card_free(dreamcastcard->card); in snd_aica_probe()
592 kfree(dreamcastcard); in snd_aica_probe()