• Home
  • Raw
  • Download

Lines Matching refs:card

119 static int snd_ps3_verify_dma_stop(struct snd_ps3_card_info *card,  in snd_ps3_verify_dma_stop()  argument
161 static void snd_ps3_wait_for_dma_stop(struct snd_ps3_card_info *card) in snd_ps3_wait_for_dma_stop() argument
173 stop_forced = snd_ps3_verify_dma_stop(card, 700, 1); in snd_ps3_wait_for_dma_stop()
190 static void snd_ps3_kick_dma(struct snd_ps3_card_info *card) in snd_ps3_kick_dma() argument
201 static dma_addr_t v_to_bus(struct snd_ps3_card_info *card, void *paddr, int ch) in v_to_bus() argument
203 return card->dma_start_bus_addr[ch] + in v_to_bus()
204 (paddr - card->dma_start_vaddr[ch]); in v_to_bus()
212 static void snd_ps3_bump_buffer(struct snd_ps3_card_info *card, in snd_ps3_bump_buffer() argument
217 card->dma_last_transfer_vaddr[ch] = in snd_ps3_bump_buffer()
218 card->dma_next_transfer_vaddr[ch]; in snd_ps3_bump_buffer()
219 card->dma_next_transfer_vaddr[ch] += byte_count; in snd_ps3_bump_buffer()
220 if ((card->dma_start_vaddr[ch] + (card->dma_buffer_size / 2)) <= in snd_ps3_bump_buffer()
221 card->dma_next_transfer_vaddr[ch]) { in snd_ps3_bump_buffer()
222 card->dma_next_transfer_vaddr[ch] = card->dma_start_vaddr[ch]; in snd_ps3_bump_buffer()
228 static int snd_ps3_program_dma(struct snd_ps3_card_info *card, in snd_ps3_program_dma() argument
256 snd_ps3_verify_dma_stop(card, 700, 0); in snd_ps3_program_dma()
258 spin_lock_irqsave(&card->dma_lock, irqsave); in snd_ps3_program_dma()
260 start_vaddr = card->dma_next_transfer_vaddr[0]; in snd_ps3_program_dma()
264 dma_addr = card->null_buffer_start_dma_addr; in snd_ps3_program_dma()
267 v_to_bus(card, in snd_ps3_program_dma()
268 card->dma_next_transfer_vaddr[ch], in snd_ps3_program_dma()
289 snd_ps3_bump_buffer(card, ch, in snd_ps3_program_dma()
306 spin_unlock_irqrestore(&card->dma_lock, irqsave); in snd_ps3_program_dma()
319 struct snd_ps3_card_info *card = dev_id; in snd_ps3_interrupt() local
321 if (!card->running) { in snd_ps3_interrupt()
338 if (card->silent) { in snd_ps3_interrupt()
340 snd_ps3_program_dma(card, in snd_ps3_interrupt()
344 snd_ps3_kick_dma(card); in snd_ps3_interrupt()
345 card->silent--; in snd_ps3_interrupt()
347 snd_ps3_program_dma(card, in snd_ps3_interrupt()
351 snd_ps3_kick_dma(card); in snd_ps3_interrupt()
352 snd_pcm_period_elapsed(card->substream); in snd_ps3_interrupt()
365 snd_ps3_program_dma(card, in snd_ps3_interrupt()
367 snd_ps3_kick_dma(card); in snd_ps3_interrupt()
368 snd_ps3_program_dma(card, in snd_ps3_interrupt()
370 snd_ps3_kick_dma(card); in snd_ps3_interrupt()
390 static int snd_ps3_change_avsetting(struct snd_ps3_card_info *card) in snd_ps3_change_avsetting() argument
395 ret = ps3av_set_audio_mode(card->avs.avs_audio_ch, in snd_ps3_change_avsetting()
396 card->avs.avs_audio_rate, in snd_ps3_change_avsetting()
397 card->avs.avs_audio_width, in snd_ps3_change_avsetting()
398 card->avs.avs_audio_format, in snd_ps3_change_avsetting()
399 card->avs.avs_audio_source); in snd_ps3_change_avsetting()
454 struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); in snd_ps3_set_avsetting() local
458 avs = card->avs; in snd_ps3_set_avsetting()
465 card->avs.avs_audio_rate, card->avs.avs_audio_width); in snd_ps3_set_avsetting()
503 if (memcmp(&card->avs, &avs, sizeof(avs))) { in snd_ps3_set_avsetting()
505 card->avs.avs_audio_rate, card->avs.avs_audio_width); in snd_ps3_set_avsetting()
507 card->avs = avs; in snd_ps3_set_avsetting()
508 snd_ps3_change_avsetting(card); in snd_ps3_set_avsetting()
528 struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); in snd_ps3_pcm_open() local
533 card->substream = substream; in snd_ps3_pcm_open()
537 card->start_delay = snd_ps3_start_delay; in snd_ps3_pcm_open()
597 struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); in snd_ps3_pcm_prepare() local
609 card->silent = snd_ps3_delay_to_bytes(substream, in snd_ps3_pcm_prepare()
610 card->start_delay) / in snd_ps3_pcm_prepare()
615 spin_lock_irqsave(&card->dma_lock, irqsave); in snd_ps3_pcm_prepare()
617 card->dma_buffer_size = runtime->dma_bytes; in snd_ps3_pcm_prepare()
619 card->dma_last_transfer_vaddr[SND_PS3_CH_L] = in snd_ps3_pcm_prepare()
620 card->dma_next_transfer_vaddr[SND_PS3_CH_L] = in snd_ps3_pcm_prepare()
621 card->dma_start_vaddr[SND_PS3_CH_L] = in snd_ps3_pcm_prepare()
623 card->dma_start_bus_addr[SND_PS3_CH_L] = runtime->dma_addr; in snd_ps3_pcm_prepare()
625 card->dma_last_transfer_vaddr[SND_PS3_CH_R] = in snd_ps3_pcm_prepare()
626 card->dma_next_transfer_vaddr[SND_PS3_CH_R] = in snd_ps3_pcm_prepare()
627 card->dma_start_vaddr[SND_PS3_CH_R] = in snd_ps3_pcm_prepare()
629 card->dma_start_bus_addr[SND_PS3_CH_R] = in snd_ps3_pcm_prepare()
633 card->dma_start_vaddr[SND_PS3_CH_L], in snd_ps3_pcm_prepare()
634 card->dma_start_bus_addr[SND_PS3_CH_L]); in snd_ps3_pcm_prepare()
637 spin_unlock_irqrestore(&card->dma_lock, irqsave); in snd_ps3_pcm_prepare()
648 struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); in snd_ps3_pcm_trigger() local
656 spin_lock(&card->dma_lock); in snd_ps3_pcm_trigger()
658 card->running = 1; in snd_ps3_pcm_trigger()
660 spin_unlock(&card->dma_lock); in snd_ps3_pcm_trigger()
662 snd_ps3_program_dma(card, in snd_ps3_pcm_trigger()
664 snd_ps3_kick_dma(card); in snd_ps3_pcm_trigger()
669 snd_ps3_program_dma(card, SND_PS3_DMA_FILLTYPE_SILENT_RUNNING); in snd_ps3_pcm_trigger()
670 snd_ps3_kick_dma(card); in snd_ps3_pcm_trigger()
674 spin_lock(&card->dma_lock); in snd_ps3_pcm_trigger()
676 card->running = 0; in snd_ps3_pcm_trigger()
678 spin_unlock(&card->dma_lock); in snd_ps3_pcm_trigger()
679 snd_ps3_wait_for_dma_stop(card); in snd_ps3_pcm_trigger()
695 struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); in snd_ps3_pcm_pointer() local
699 spin_lock(&card->dma_lock); in snd_ps3_pcm_pointer()
701 bytes = (size_t)(card->dma_last_transfer_vaddr[SND_PS3_CH_L] - in snd_ps3_pcm_pointer()
702 card->dma_start_vaddr[SND_PS3_CH_L]); in snd_ps3_pcm_pointer()
704 spin_unlock(&card->dma_lock); in snd_ps3_pcm_pointer()
885 static void snd_ps3_audio_fixup(struct snd_ps3_card_info *card) in snd_ps3_audio_fixup() argument
909 static int snd_ps3_init_avsetting(struct snd_ps3_card_info *card) in snd_ps3_init_avsetting() argument
913 card->avs.avs_audio_ch = PS3AV_CMD_AUDIO_NUM_OF_CH_2; in snd_ps3_init_avsetting()
914 card->avs.avs_audio_rate = PS3AV_CMD_AUDIO_FS_48K; in snd_ps3_init_avsetting()
915 card->avs.avs_audio_width = PS3AV_CMD_AUDIO_WORD_BITS_16; in snd_ps3_init_avsetting()
916 card->avs.avs_audio_format = PS3AV_CMD_AUDIO_FORMAT_PCM; in snd_ps3_init_avsetting()
917 card->avs.avs_audio_source = PS3AV_CMD_AUDIO_SOURCE_SERIAL; in snd_ps3_init_avsetting()
918 memcpy(card->avs.avs_cs_info, ps3av_mode_cs_info, 8); in snd_ps3_init_avsetting()
920 ret = snd_ps3_change_avsetting(card); in snd_ps3_init_avsetting()
922 snd_ps3_audio_fixup(card); in snd_ps3_init_avsetting()
925 snd_ps3_program_dma(card, SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL); in snd_ps3_init_avsetting()
926 snd_ps3_kick_dma(card); in snd_ps3_init_avsetting()
985 ret = snd_card_create(index, id, THIS_MODULE, 0, &the_card.card); in snd_ps3_driver_probe()
989 strcpy(the_card.card->driver, "PS3"); in snd_ps3_driver_probe()
990 strcpy(the_card.card->shortname, "PS3"); in snd_ps3_driver_probe()
991 strcpy(the_card.card->longname, "PS3 sound"); in snd_ps3_driver_probe()
995 ret = snd_ctl_add(the_card.card, in snd_ps3_driver_probe()
1003 ret = snd_pcm_new(the_card.card, in snd_ps3_driver_probe()
1053 snd_card_set_dev(the_card.card, &dev->core); in snd_ps3_driver_probe()
1054 ret = snd_card_register(the_card.card); in snd_ps3_driver_probe()
1059 the_card.card->longname, the_card.start_delay); in snd_ps3_driver_probe()
1070 snd_card_free(the_card.card); in snd_ps3_driver_probe()
1100 ret = snd_card_free(the_card.card); in snd_ps3_driver_remove()