Lines Matching defs:dreamcastcard
218 struct snd_card_aica *dreamcastcard;
222 dreamcastcard = substream->pcm->private_data;
223 period_offset = dreamcastcard->clicks;
247 static void startup_aica(struct snd_card_aica *dreamcastcard)
250 dreamcastcard->channel, sizeof(struct aica_channel));
258 struct snd_card_aica *dreamcastcard;
259 dreamcastcard =
261 runtime = dreamcastcard->substream->runtime;
262 if (unlikely(dreamcastcard->dma_check == 0)) {
266 dreamcastcard->channel->flags |= 0x01;
268 dreamcastcard->substream);
269 startup_aica(dreamcastcard);
270 dreamcastcard->clicks =
276 dreamcastcard->substream);
277 snd_pcm_period_elapsed(dreamcastcard->substream);
278 dreamcastcard->clicks++;
279 if (unlikely(dreamcastcard->clicks >= AICA_PERIOD_NUMBER))
280 dreamcastcard->clicks %= AICA_PERIOD_NUMBER;
281 mod_timer(&dreamcastcard->timer, jiffies + 1);
287 struct snd_card_aica *dreamcastcard = from_timer(dreamcastcard,
289 struct snd_pcm_substream *substream = dreamcastcard->substream;
294 dreamcastcard = substream->pcm->private_data;
301 if (play_period == dreamcastcard->current_period) {
303 mod_timer(&(dreamcastcard->timer), jiffies + 1);
307 dreamcastcard->current_period = play_period;
308 if (unlikely(dreamcastcard->dma_check == 0))
309 dreamcastcard->dma_check = 1;
310 schedule_work(&(dreamcastcard->spu_dma_work));
315 struct snd_card_aica *dreamcastcard;
318 dreamcastcard = substream->pcm->private_data;
320 schedule_work(&(dreamcastcard->spu_dma_work));
321 mod_timer(&dreamcastcard->timer, jiffies + 4);
329 struct snd_card_aica *dreamcastcard;
332 dreamcastcard = substream->pcm->private_data;
339 channel->vol = dreamcastcard->master_volume;
343 dreamcastcard->channel = channel;
347 dreamcastcard->clicks = 0;
348 dreamcastcard->current_period = 0;
349 dreamcastcard->dma_check = 0;
356 struct snd_card_aica *dreamcastcard = substream->pcm->private_data;
357 flush_work(&(dreamcastcard->spu_dma_work));
358 del_timer(&dreamcastcard->timer);
359 dreamcastcard->substream = NULL;
360 kfree(dreamcastcard->channel);
368 struct snd_card_aica *dreamcastcard = substream->pcm->private_data;
370 dreamcastcard->channel->sfmt = SM_16BIT;
371 dreamcastcard->channel->freq = substream->runtime->rate;
372 dreamcastcard->substream = substream;
408 *dreamcastcard, int pcm_index)
414 snd_pcm_new(dreamcastcard->card, "AICA PCM", pcm_index, 1, 0,
418 pcm->private_data = dreamcastcard;
464 struct snd_card_aica *dreamcastcard;
465 dreamcastcard = kcontrol->private_data;
466 if (unlikely(!dreamcastcard->channel))
468 ucontrol->value.integer.value[0] = dreamcastcard->channel->vol;
475 struct snd_card_aica *dreamcastcard;
477 dreamcastcard = kcontrol->private_data;
478 if (unlikely(!dreamcastcard->channel))
483 if (unlikely(dreamcastcard->channel->vol == vol))
485 dreamcastcard->channel->vol = ucontrol->value.integer.value[0];
486 dreamcastcard->master_volume = ucontrol->value.integer.value[0];
488 dreamcastcard->channel, sizeof(struct aica_channel));
526 static int add_aicamixer_controls(struct snd_card_aica *dreamcastcard)
530 (dreamcastcard->card,
531 snd_ctl_new1(&snd_aica_pcmvolume_control, dreamcastcard));
535 (dreamcastcard->card,
536 snd_ctl_new1(&snd_aica_pcmswitch_control, dreamcastcard));
544 struct snd_card_aica *dreamcastcard;
545 dreamcastcard = platform_get_drvdata(devptr);
546 snd_card_free(dreamcastcard->card);
547 kfree(dreamcastcard);
553 struct snd_card_aica *dreamcastcard;
554 dreamcastcard = kzalloc(sizeof(struct snd_card_aica), GFP_KERNEL);
555 if (unlikely(!dreamcastcard))
558 THIS_MODULE, 0, &dreamcastcard->card);
560 kfree(dreamcastcard);
563 strcpy(dreamcastcard->card->driver, "snd_aica");
564 strcpy(dreamcastcard->card->shortname, SND_AICA_DRIVER);
565 strcpy(dreamcastcard->card->longname,
568 INIT_WORK(&(dreamcastcard->spu_dma_work), run_spu_dma);
569 timer_setup(&dreamcastcard->timer, aica_period_elapsed, 0);
571 err = snd_aicapcmchip(dreamcastcard, 0);
575 err = add_aicamixer_controls(dreamcastcard);
579 err = snd_card_register(dreamcastcard->card);
582 platform_set_drvdata(devptr, dreamcastcard);
587 snd_card_free(dreamcastcard->card);
588 kfree(dreamcastcard);