xref: /openbmc/linux/sound/core/memalloc_local.h (revision 63705da3)
1 // SPDX-License-Identifier: GPL-2.0-only
2 #ifndef __MEMALLOC_LOCAL_H
3 #define __MEMALLOC_LOCAL_H
4 
5 struct snd_malloc_ops {
6 	void *(*alloc)(struct snd_dma_buffer *dmab, size_t size);
7 	void (*free)(struct snd_dma_buffer *dmab);
8 	dma_addr_t (*get_addr)(struct snd_dma_buffer *dmab, size_t offset);
9 	struct page *(*get_page)(struct snd_dma_buffer *dmab, size_t offset);
10 	unsigned int (*get_chunk_size)(struct snd_dma_buffer *dmab,
11 				       unsigned int ofs, unsigned int size);
12 	int (*mmap)(struct snd_dma_buffer *dmab, struct vm_area_struct *area);
13 	void (*sync)(struct snd_dma_buffer *dmab, enum snd_dma_sync_mode mode);
14 };
15 
16 #ifdef CONFIG_SND_DMA_SGBUF
17 extern const struct snd_malloc_ops snd_dma_sg_ops;
18 #endif
19 
20 #endif /* __MEMALLOC_LOCAL_H */
21