diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-08-21 07:00:13 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-08-25 03:57:18 -0400 |
commit | 77a23f2695bb2de0cd74599400dc55109c531b72 (patch) | |
tree | 4960195e04016928dea83deb85e0f3bf97024a8a /include/sound/pcm.h | |
parent | 46480b3a5f88f20dbf25d95fe74d7b4798d5bc86 (diff) |
ALSA: Clean up SG-buffer helper functions and macros
Clean up SG-buffer helper functions and macros. Helpers take substream
as arguments now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'include/sound/pcm.h')
-rw-r--r-- | include/sound/pcm.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 9ce74633e6ff..8db89630c821 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -974,10 +974,29 @@ int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm, | |||
974 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); | 974 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); |
975 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); | 975 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); |
976 | 976 | ||
977 | #define snd_pcm_substream_sgbuf(substream) ((substream)->runtime->dma_buffer_p->private_data) | 977 | /* |
978 | #define snd_pcm_sgbuf_pages(size) snd_sgbuf_aligned_pages(size) | 978 | * SG-buffer handling |
979 | #define snd_pcm_sgbuf_get_addr(sgbuf,ofs) snd_sgbuf_get_addr(sgbuf,ofs) | 979 | */ |
980 | struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigned long offset); | 980 | #define snd_pcm_substream_sgbuf(substream) \ |
981 | ((substream)->runtime->dma_buffer_p->private_data) | ||
982 | |||
983 | static inline dma_addr_t | ||
984 | snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs) | ||
985 | { | ||
986 | struct snd_sg_buf *sg = snd_pcm_substream_sgbuf(substream); | ||
987 | return snd_sgbuf_get_addr(sg, ofs); | ||
988 | } | ||
989 | |||
990 | static inline void * | ||
991 | snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs) | ||
992 | { | ||
993 | struct snd_sg_buf *sg = snd_pcm_substream_sgbuf(substream); | ||
994 | return snd_sgbuf_get_ptr(sg, ofs); | ||
995 | } | ||
996 | |||
997 | struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, | ||
998 | unsigned long offset); | ||
999 | |||
981 | 1000 | ||
982 | /* handle mmap counter - PCM mmap callback should handle this counter properly */ | 1001 | /* handle mmap counter - PCM mmap callback should handle this counter properly */ |
983 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) | 1002 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) |