Lines Matching refs:dreamcastcard

238 	struct snd_card_aica *dreamcastcard;  in aica_dma_transfer()  local
242 dreamcastcard = substream->pcm->private_data; in aica_dma_transfer()
243 period_offset = dreamcastcard->clicks; in aica_dma_transfer()
267 static void startup_aica(struct snd_card_aica *dreamcastcard) in startup_aica() argument
270 dreamcastcard->channel, sizeof(struct aica_channel)); in startup_aica()
278 struct snd_card_aica *dreamcastcard; in run_spu_dma() local
279 dreamcastcard = in run_spu_dma()
281 runtime = dreamcastcard->substream->runtime; in run_spu_dma()
282 if (unlikely(dreamcastcard->dma_check == 0)) { in run_spu_dma()
286 dreamcastcard->channel->flags |= 0x01; in run_spu_dma()
288 dreamcastcard->substream); in run_spu_dma()
289 startup_aica(dreamcastcard); in run_spu_dma()
290 dreamcastcard->clicks = in run_spu_dma()
296 dreamcastcard->substream); in run_spu_dma()
297 snd_pcm_period_elapsed(dreamcastcard->substream); in run_spu_dma()
298 dreamcastcard->clicks++; in run_spu_dma()
299 if (unlikely(dreamcastcard->clicks >= AICA_PERIOD_NUMBER)) in run_spu_dma()
300 dreamcastcard->clicks %= AICA_PERIOD_NUMBER; in run_spu_dma()
301 mod_timer(&dreamcastcard->timer, jiffies + 1); in run_spu_dma()
311 struct snd_card_aica *dreamcastcard; in aica_period_elapsed() local
314 dreamcastcard = substream->pcm->private_data; in aica_period_elapsed()
321 if (play_period == dreamcastcard->current_period) { in aica_period_elapsed()
323 mod_timer(&(dreamcastcard->timer), jiffies + 1); in aica_period_elapsed()
327 dreamcastcard->current_period = play_period; in aica_period_elapsed()
328 if (unlikely(dreamcastcard->dma_check == 0)) in aica_period_elapsed()
329 dreamcastcard->dma_check = 1; in aica_period_elapsed()
330 queue_work(aica_queue, &(dreamcastcard->spu_dma_work)); in aica_period_elapsed()
335 struct snd_card_aica *dreamcastcard; in spu_begin_dma() local
338 dreamcastcard = substream->pcm->private_data; in spu_begin_dma()
340 queue_work(aica_queue, &(dreamcastcard->spu_dma_work)); in spu_begin_dma()
342 if (unlikely(dreamcastcard->timer.data)) { in spu_begin_dma()
343 mod_timer(&dreamcastcard->timer, jiffies + 4); in spu_begin_dma()
346 setup_timer(&dreamcastcard->timer, aica_period_elapsed, in spu_begin_dma()
348 mod_timer(&dreamcastcard->timer, jiffies + 4); in spu_begin_dma()
356 struct snd_card_aica *dreamcastcard; in snd_aicapcm_pcm_open() local
359 dreamcastcard = substream->pcm->private_data; in snd_aicapcm_pcm_open()
366 channel->vol = dreamcastcard->master_volume; in snd_aicapcm_pcm_open()
370 dreamcastcard->channel = channel; in snd_aicapcm_pcm_open()
374 dreamcastcard->clicks = 0; in snd_aicapcm_pcm_open()
375 dreamcastcard->current_period = 0; in snd_aicapcm_pcm_open()
376 dreamcastcard->dma_check = 0; in snd_aicapcm_pcm_open()
383 struct snd_card_aica *dreamcastcard = substream->pcm->private_data; in snd_aicapcm_pcm_close() local
385 if (dreamcastcard->timer.data) in snd_aicapcm_pcm_close()
386 del_timer(&dreamcastcard->timer); in snd_aicapcm_pcm_close()
387 kfree(dreamcastcard->channel); in snd_aicapcm_pcm_close()
412 struct snd_card_aica *dreamcastcard = substream->pcm->private_data; in snd_aicapcm_pcm_prepare() local
414 dreamcastcard->channel->sfmt = SM_16BIT; in snd_aicapcm_pcm_prepare()
415 dreamcastcard->channel->freq = substream->runtime->rate; in snd_aicapcm_pcm_prepare()
416 dreamcastcard->substream = substream; in snd_aicapcm_pcm_prepare()
455 *dreamcastcard, int pcm_index) in snd_aicapcmchip()
461 snd_pcm_new(dreamcastcard->card, "AICA PCM", pcm_index, 1, 0, in snd_aicapcmchip()
465 pcm->private_data = dreamcastcard; in snd_aicapcmchip()
513 struct snd_card_aica *dreamcastcard; in aica_pcmvolume_get() local
514 dreamcastcard = kcontrol->private_data; in aica_pcmvolume_get()
515 if (unlikely(!dreamcastcard->channel)) in aica_pcmvolume_get()
517 ucontrol->value.integer.value[0] = dreamcastcard->channel->vol; in aica_pcmvolume_get()
524 struct snd_card_aica *dreamcastcard; in aica_pcmvolume_put() local
526 dreamcastcard = kcontrol->private_data; in aica_pcmvolume_put()
527 if (unlikely(!dreamcastcard->channel)) in aica_pcmvolume_put()
532 if (unlikely(dreamcastcard->channel->vol == vol)) in aica_pcmvolume_put()
534 dreamcastcard->channel->vol = ucontrol->value.integer.value[0]; in aica_pcmvolume_put()
535 dreamcastcard->master_volume = ucontrol->value.integer.value[0]; in aica_pcmvolume_put()
537 dreamcastcard->channel, sizeof(struct aica_channel)); in aica_pcmvolume_put()
575 static int add_aicamixer_controls(struct snd_card_aica *dreamcastcard) in add_aicamixer_controls() argument
579 (dreamcastcard->card, in add_aicamixer_controls()
580 snd_ctl_new1(&snd_aica_pcmvolume_control, dreamcastcard)); in add_aicamixer_controls()
584 (dreamcastcard->card, in add_aicamixer_controls()
585 snd_ctl_new1(&snd_aica_pcmswitch_control, dreamcastcard)); in add_aicamixer_controls()
593 struct snd_card_aica *dreamcastcard; in snd_aica_remove() local
594 dreamcastcard = platform_get_drvdata(devptr); in snd_aica_remove()
595 if (unlikely(!dreamcastcard)) in snd_aica_remove()
597 snd_card_free(dreamcastcard->card); in snd_aica_remove()
598 kfree(dreamcastcard); in snd_aica_remove()
605 struct snd_card_aica *dreamcastcard; in snd_aica_probe() local
606 dreamcastcard = kmalloc(sizeof(struct snd_card_aica), GFP_KERNEL); in snd_aica_probe()
607 if (unlikely(!dreamcastcard)) in snd_aica_probe()
610 THIS_MODULE, 0, &dreamcastcard->card); in snd_aica_probe()
612 kfree(dreamcastcard); in snd_aica_probe()
615 strcpy(dreamcastcard->card->driver, "snd_aica"); in snd_aica_probe()
616 strcpy(dreamcastcard->card->shortname, SND_AICA_DRIVER); in snd_aica_probe()
617 strcpy(dreamcastcard->card->longname, in snd_aica_probe()
620 INIT_WORK(&(dreamcastcard->spu_dma_work), run_spu_dma); in snd_aica_probe()
622 err = snd_aicapcmchip(dreamcastcard, 0); in snd_aica_probe()
625 dreamcastcard->timer.data = 0; in snd_aica_probe()
626 dreamcastcard->channel = NULL; in snd_aica_probe()
628 err = add_aicamixer_controls(dreamcastcard); in snd_aica_probe()
632 err = snd_card_register(dreamcastcard->card); in snd_aica_probe()
635 platform_set_drvdata(devptr, dreamcastcard); in snd_aica_probe()
643 snd_card_free(dreamcastcard->card); in snd_aica_probe()
644 kfree(dreamcastcard); in snd_aica_probe()