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 | |
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')
-rw-r--r-- | sound/pci/rme9652/hdsp.c | 14 | ||||
-rw-r--r-- | sound/pci/rme9652/rme9652.c | 14 |
2 files changed, 18 insertions, 10 deletions
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index b35ed5f0c042..a673cc438b91 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c | |||
@@ -559,18 +559,22 @@ static int snd_hammerfall_get_buffer(struct pci_dev *pci, struct snd_dma_buffer | |||
559 | { | 559 | { |
560 | dmab->dev.type = SNDRV_DMA_TYPE_DEV; | 560 | dmab->dev.type = SNDRV_DMA_TYPE_DEV; |
561 | dmab->dev.dev = snd_dma_pci_data(pci); | 561 | dmab->dev.dev = snd_dma_pci_data(pci); |
562 | if (! snd_dma_get_reserved_buf(dmab, snd_dma_pci_buf_id(pci))) { | 562 | if (snd_dma_get_reserved_buf(dmab, snd_dma_pci_buf_id(pci))) { |
563 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), | 563 | if (dmab->bytes >= size) |
564 | size, dmab) < 0) | 564 | return 0; |
565 | return -ENOMEM; | ||
566 | } | 565 | } |
566 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), | ||
567 | size, dmab) < 0) | ||
568 | return -ENOMEM; | ||
567 | return 0; | 569 | return 0; |
568 | } | 570 | } |
569 | 571 | ||
570 | static void snd_hammerfall_free_buffer(struct snd_dma_buffer *dmab, struct pci_dev *pci) | 572 | static void snd_hammerfall_free_buffer(struct snd_dma_buffer *dmab, struct pci_dev *pci) |
571 | { | 573 | { |
572 | if (dmab->area) | 574 | if (dmab->area) { |
575 | dmab->dev.dev = NULL; /* make it anonymous */ | ||
573 | snd_dma_reserve_buf(dmab, snd_dma_pci_buf_id(pci)); | 576 | snd_dma_reserve_buf(dmab, snd_dma_pci_buf_id(pci)); |
577 | } | ||
574 | } | 578 | } |
575 | 579 | ||
576 | 580 | ||
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 | ||