diff options
Diffstat (limited to 'include/sound/memalloc.h')
| -rw-r--r-- | include/sound/memalloc.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index 9c3db3dce32b..67561b997915 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h | |||
| @@ -24,6 +24,8 @@ | |||
| 24 | #ifndef __SOUND_MEMALLOC_H | 24 | #ifndef __SOUND_MEMALLOC_H |
| 25 | #define __SOUND_MEMALLOC_H | 25 | #define __SOUND_MEMALLOC_H |
| 26 | 26 | ||
| 27 | #include <asm/page.h> | ||
| 28 | |||
| 27 | struct device; | 29 | struct device; |
| 28 | 30 | ||
| 29 | /* | 31 | /* |
| @@ -67,6 +69,14 @@ struct snd_dma_buffer { | |||
| 67 | void *private_data; /* private for allocator; don't touch */ | 69 | void *private_data; /* private for allocator; don't touch */ |
| 68 | }; | 70 | }; |
| 69 | 71 | ||
| 72 | /* | ||
| 73 | * return the pages matching with the given byte size | ||
| 74 | */ | ||
| 75 | static inline unsigned int snd_sgbuf_aligned_pages(size_t size) | ||
| 76 | { | ||
| 77 | return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; | ||
| 78 | } | ||
| 79 | |||
| 70 | #ifdef CONFIG_SND_DMA_SGBUF | 80 | #ifdef CONFIG_SND_DMA_SGBUF |
| 71 | /* | 81 | /* |
| 72 | * Scatter-Gather generic device pages | 82 | * Scatter-Gather generic device pages |
| @@ -91,14 +101,6 @@ struct snd_sg_buf { | |||
| 91 | }; | 101 | }; |
| 92 | 102 | ||
| 93 | /* | 103 | /* |
| 94 | * return the pages matching with the given byte size | ||
| 95 | */ | ||
| 96 | static inline unsigned int snd_sgbuf_aligned_pages(size_t size) | ||
| 97 | { | ||
| 98 | return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; | ||
| 99 | } | ||
| 100 | |||
| 101 | /* | ||
| 102 | * return the physical address at the corresponding offset | 104 | * return the physical address at the corresponding offset |
| 103 | */ | 105 | */ |
| 104 | static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab, | 106 | static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab, |
