diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-05-30 12:27:03 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-06-22 06:27:47 -0400 |
commit | b6a969155b04416185f368bd4e2f1d49b17c1ee1 (patch) | |
tree | c6db67bdc4b4d107902cf6ced9d66fb0ab15600c /sound/pci/rme9652/rme9652.c | |
parent | 4d572776d4dfa2d5385a2ec3acec3cc059149e13 (diff) |
[ALSA] Add write support to snd-page-alloc proc file
Documentation,Memalloc module,RME HDSP driver,RME9652 driver
Add the write support to snd-page-alloc proc file for buffer pre-allocation.
Removed the pre-allocation codes via module options.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/rme9652/rme9652.c')
-rw-r--r-- | sound/pci/rme9652/rme9652.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c index 5861f234af21..f3037402d58f 100644 --- a/sound/pci/rme9652/rme9652.c +++ b/sound/pci/rme9652/rme9652.c | |||
@@ -303,18 +303,22 @@ static int snd_hammerfall_get_buffer(struct pci_dev *pci, struct snd_dma_buffer | |||
303 | { | 303 | { |
304 | dmab->dev.type = SNDRV_DMA_TYPE_DEV; | 304 | dmab->dev.type = SNDRV_DMA_TYPE_DEV; |
305 | dmab->dev.dev = snd_dma_pci_data(pci); | 305 | dmab->dev.dev = snd_dma_pci_data(pci); |
306 | if (! snd_dma_get_reserved_buf(dmab, snd_dma_pci_buf_id(pci))) { | 306 | if (snd_dma_get_reserved_buf(dmab, snd_dma_pci_buf_id(pci))) { |
307 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), | 307 | if (dmab->bytes >= size) |
308 | size, dmab) < 0) | 308 | return 0; |
309 | return -ENOMEM; | ||
310 | } | 309 | } |
310 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), | ||
311 | size, dmab) < 0) | ||
312 | return -ENOMEM; | ||
311 | return 0; | 313 | return 0; |
312 | } | 314 | } |
313 | 315 | ||
314 | static void snd_hammerfall_free_buffer(struct snd_dma_buffer *dmab, struct pci_dev *pci) | 316 | static void snd_hammerfall_free_buffer(struct snd_dma_buffer *dmab, struct pci_dev *pci) |
315 | { | 317 | { |
316 | if (dmab->area) | 318 | if (dmab->area) { |
319 | dmab->dev.dev = NULL; /* make it anonymous */ | ||
317 | snd_dma_reserve_buf(dmab, snd_dma_pci_buf_id(pci)); | 320 | snd_dma_reserve_buf(dmab, snd_dma_pci_buf_id(pci)); |
321 | } | ||
318 | } | 322 | } |
319 | 323 | ||
320 | 324 | ||