Lines Matching refs:sgbuf

690 				       struct snd_dma_sg_fallback *sgbuf)  in __snd_dma_sg_fallback_free()  argument
695 if (sgbuf->pages && sgbuf->npages) { in __snd_dma_sg_fallback_free()
697 while (i < sgbuf->count) { in __snd_dma_sg_fallback_free()
698 size = sgbuf->npages[i]; in __snd_dma_sg_fallback_free()
701 do_free_pages(page_address(sgbuf->pages[i]), in __snd_dma_sg_fallback_free()
706 kvfree(sgbuf->pages); in __snd_dma_sg_fallback_free()
707 kvfree(sgbuf->npages); in __snd_dma_sg_fallback_free()
708 kfree(sgbuf); in __snd_dma_sg_fallback_free()
715 struct snd_dma_sg_fallback *sgbuf; in snd_dma_sg_fallback_alloc() local
722 sgbuf = kzalloc(sizeof(*sgbuf), GFP_KERNEL); in snd_dma_sg_fallback_alloc()
723 if (!sgbuf) in snd_dma_sg_fallback_alloc()
726 sgbuf->count = size >> PAGE_SHIFT; in snd_dma_sg_fallback_alloc()
727 sgbuf->pages = kvcalloc(sgbuf->count, sizeof(*sgbuf->pages), GFP_KERNEL); in snd_dma_sg_fallback_alloc()
728 sgbuf->npages = kvcalloc(sgbuf->count, sizeof(*sgbuf->npages), GFP_KERNEL); in snd_dma_sg_fallback_alloc()
729 if (!sgbuf->pages || !sgbuf->npages) in snd_dma_sg_fallback_alloc()
732 pagep = sgbuf->pages; in snd_dma_sg_fallback_alloc()
749 sgbuf->npages[idx] = npages; in snd_dma_sg_fallback_alloc()
756 if (sg_alloc_table_from_pages(&sgbuf->sgt, sgbuf->pages, sgbuf->count, in snd_dma_sg_fallback_alloc()
757 0, sgbuf->count << PAGE_SHIFT, GFP_KERNEL)) in snd_dma_sg_fallback_alloc()
760 if (dma_map_sgtable(dmab->dev.dev, &sgbuf->sgt, DMA_BIDIRECTIONAL, 0)) in snd_dma_sg_fallback_alloc()
763 p = vmap(sgbuf->pages, sgbuf->count, VM_MAP, PAGE_KERNEL); in snd_dma_sg_fallback_alloc()
767 dmab->private_data = sgbuf; in snd_dma_sg_fallback_alloc()
773 dma_unmap_sgtable(dmab->dev.dev, &sgbuf->sgt, DMA_BIDIRECTIONAL, 0); in snd_dma_sg_fallback_alloc()
775 sg_free_table(&sgbuf->sgt); in snd_dma_sg_fallback_alloc()
777 __snd_dma_sg_fallback_free(dmab, sgbuf); in snd_dma_sg_fallback_alloc()
783 struct snd_dma_sg_fallback *sgbuf = dmab->private_data; in snd_dma_sg_fallback_free() local
786 dma_unmap_sgtable(dmab->dev.dev, &sgbuf->sgt, DMA_BIDIRECTIONAL, 0); in snd_dma_sg_fallback_free()
787 sg_free_table(&sgbuf->sgt); in snd_dma_sg_fallback_free()
794 struct snd_dma_sg_fallback *sgbuf = dmab->private_data; in snd_dma_sg_fallback_mmap() local
798 return vm_map_pages(area, sgbuf->pages, sgbuf->count); in snd_dma_sg_fallback_mmap()