Lines Matching refs:dmab
35 int str, size_t size, struct snd_dma_buffer *dmab) in do_alloc_pages() argument
48 err = snd_dma_alloc_dir_pages(type, dev, dir, size, dmab); in do_alloc_pages()
51 card->total_pcm_alloc_bytes += dmab->bytes; in do_alloc_pages()
57 static void do_free_pages(struct snd_card *card, struct snd_dma_buffer *dmab) in do_free_pages() argument
59 if (!dmab->area) in do_free_pages()
62 WARN_ON(card->total_pcm_alloc_bytes < dmab->bytes); in do_free_pages()
63 card->total_pcm_alloc_bytes -= dmab->bytes; in do_free_pages()
65 snd_dma_free_pages(dmab); in do_free_pages()
66 dmab->area = NULL; in do_free_pages()
78 struct snd_dma_buffer *dmab = &substream->dma_buffer; in preallocate_pcm_pages() local
84 err = do_alloc_pages(card, dmab->dev.type, dmab->dev.dev, in preallocate_pcm_pages()
85 substream->stream, size, dmab); in preallocate_pcm_pages()
92 dmab->bytes = 0; /* tell error */ in preallocate_pcm_pages()
400 struct snd_dma_buffer *dmab = NULL; in snd_pcm_lib_malloc_pages() local
422 dmab = &substream->dma_buffer; /* use the pre-allocated buffer */ in snd_pcm_lib_malloc_pages()
427 dmab = kzalloc(sizeof(*dmab), GFP_KERNEL); in snd_pcm_lib_malloc_pages()
428 if (! dmab) in snd_pcm_lib_malloc_pages()
430 dmab->dev = substream->dma_buffer.dev; in snd_pcm_lib_malloc_pages()
435 size, dmab) < 0) { in snd_pcm_lib_malloc_pages()
436 kfree(dmab); in snd_pcm_lib_malloc_pages()
444 snd_pcm_set_runtime_buffer(substream, dmab); in snd_pcm_lib_malloc_pages()