aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/pcm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound/pcm.h')
-rw-r--r--include/sound/pcm.h39
1 files changed, 33 insertions, 6 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 51d58ccda2d8..40c5a6fa6bcd 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -25,6 +25,7 @@
25 25
26#include <sound/asound.h> 26#include <sound/asound.h>
27#include <sound/memalloc.h> 27#include <sound/memalloc.h>
28#include <sound/minors.h>
28#include <linux/poll.h> 29#include <linux/poll.h>
29#include <linux/mm.h> 30#include <linux/mm.h>
30#include <linux/bitops.h> 31#include <linux/bitops.h>
@@ -84,7 +85,11 @@ struct snd_pcm_ops {
84 * 85 *
85 */ 86 */
86 87
87#define SNDRV_PCM_DEVICES 8 88#if defined(CONFIG_SND_DYNAMIC_MINORS)
89#define SNDRV_PCM_DEVICES (SNDRV_OS_MINORS-2)
90#else
91#define SNDRV_PCM_DEVICES 8
92#endif
88 93
89#define SNDRV_PCM_IOCTL1_FALSE ((void *)0) 94#define SNDRV_PCM_IOCTL1_FALSE ((void *)0)
90#define SNDRV_PCM_IOCTL1_TRUE ((void *)1) 95#define SNDRV_PCM_IOCTL1_TRUE ((void *)1)
@@ -416,7 +421,7 @@ struct snd_pcm_str {
416struct snd_pcm { 421struct snd_pcm {
417 struct snd_card *card; 422 struct snd_card *card;
418 struct list_head list; 423 struct list_head list;
419 unsigned int device; /* device number */ 424 int device; /* device number */
420 unsigned int info_flags; 425 unsigned int info_flags;
421 unsigned short dev_class; 426 unsigned short dev_class;
422 unsigned short dev_subclass; 427 unsigned short dev_subclass;
@@ -969,10 +974,30 @@ int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm,
969int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); 974int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size);
970int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); 975int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream);
971 976
972#define snd_pcm_substream_sgbuf(substream) ((substream)->runtime->dma_buffer_p->private_data) 977/*
973#define snd_pcm_sgbuf_pages(size) snd_sgbuf_aligned_pages(size) 978 * SG-buffer handling
974#define snd_pcm_sgbuf_get_addr(sgbuf,ofs) snd_sgbuf_get_addr(sgbuf,ofs) 979 */
975struct 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
983static inline dma_addr_t
984snd_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
990static inline void *
991snd_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
997struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream,
998 unsigned long offset);
999unsigned int snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream,
1000 unsigned int ofs, unsigned int size);
976 1001
977/* handle mmap counter - PCM mmap callback should handle this counter properly */ 1002/* handle mmap counter - PCM mmap callback should handle this counter properly */
978static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) 1003static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area)
@@ -1010,4 +1035,6 @@ static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max)
1010 (IEC958_AES1_CON_PCM_CODER<<8)|\ 1035 (IEC958_AES1_CON_PCM_CODER<<8)|\
1011 (IEC958_AES3_CON_FS_48000<<24)) 1036 (IEC958_AES3_CON_FS_48000<<24))
1012 1037
1038#define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime)
1039
1013#endif /* __SOUND_PCM_H */ 1040#endif /* __SOUND_PCM_H */