summaryrefslogtreecommitdiffstats
path: root/sound/core/memalloc_local.h
blob: 9f2e0a608b494a727fd5e988bfe000f091ba533d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// SPDX-License-Identifier: GPL-2.0-only
#ifndef __MEMALLOC_LOCAL_H
#define __MEMALLOC_LOCAL_H

struct snd_malloc_ops {
	void *(*alloc)(struct snd_dma_buffer *dmab, size_t size);
	void (*free)(struct snd_dma_buffer *dmab);
	dma_addr_t (*get_addr)(struct snd_dma_buffer *dmab, size_t offset);
	struct page *(*get_page)(struct snd_dma_buffer *dmab, size_t offset);
	unsigned int (*get_chunk_size)(struct snd_dma_buffer *dmab,
				       unsigned int ofs, unsigned int size);
	int (*mmap)(struct snd_dma_buffer *dmab, struct vm_area_struct *area);
};

#ifdef CONFIG_SND_DMA_SGBUF
extern const struct snd_malloc_ops snd_dma_sg_ops;
#endif

#endif /* __MEMALLOC_LOCAL_H */