aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorAntonio Ospite <ao2@amarulasolutions.com>2013-06-21 07:11:50 -0400
committerTakashi Iwai <tiwai@suse.de>2013-06-21 08:36:41 -0400
commit4a9f9118619b20a7c10327667d6595b6bfa4beb1 (patch)
tree8cd0be065b86ad2bfe1db071b545cc7bee728f62 /sound/usb
parentfc76f8637650f422eb67385d5a584bf30befddaa (diff)
ALSA: snd-usb-6fire: use vmalloc buffers
For USB devices it's not necessary to allocate physically contiguous buffers. Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/6fire/pcm.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sound/usb/6fire/pcm.c b/sound/usb/6fire/pcm.c
index 40dd50a80f55..c5b9cac37dc4 100644
--- a/sound/usb/6fire/pcm.c
+++ b/sound/usb/6fire/pcm.c
@@ -450,13 +450,13 @@ static int usb6fire_pcm_close(struct snd_pcm_substream *alsa_sub)
450static int usb6fire_pcm_hw_params(struct snd_pcm_substream *alsa_sub, 450static int usb6fire_pcm_hw_params(struct snd_pcm_substream *alsa_sub,
451 struct snd_pcm_hw_params *hw_params) 451 struct snd_pcm_hw_params *hw_params)
452{ 452{
453 return snd_pcm_lib_malloc_pages(alsa_sub, 453 return snd_pcm_lib_alloc_vmalloc_buffer(alsa_sub,
454 params_buffer_bytes(hw_params)); 454 params_buffer_bytes(hw_params));
455} 455}
456 456
457static int usb6fire_pcm_hw_free(struct snd_pcm_substream *alsa_sub) 457static int usb6fire_pcm_hw_free(struct snd_pcm_substream *alsa_sub)
458{ 458{
459 return snd_pcm_lib_free_pages(alsa_sub); 459 return snd_pcm_lib_free_vmalloc_buffer(alsa_sub);
460} 460}
461 461
462static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub) 462static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub)
@@ -560,6 +560,8 @@ static struct snd_pcm_ops pcm_ops = {
560 .prepare = usb6fire_pcm_prepare, 560 .prepare = usb6fire_pcm_prepare,
561 .trigger = usb6fire_pcm_trigger, 561 .trigger = usb6fire_pcm_trigger,
562 .pointer = usb6fire_pcm_pointer, 562 .pointer = usb6fire_pcm_pointer,
563 .page = snd_pcm_lib_get_vmalloc_page,
564 .mmap = snd_pcm_lib_mmap_vmalloc,
563}; 565};
564 566
565static void usb6fire_pcm_init_urb(struct pcm_urb *urb, 567static void usb6fire_pcm_init_urb(struct pcm_urb *urb,
@@ -622,10 +624,6 @@ int usb6fire_pcm_init(struct sfire_chip *chip)
622 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &pcm_ops); 624 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &pcm_ops);
623 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_ops); 625 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_ops);
624 626
625 ret = snd_pcm_lib_preallocate_pages_for_all(pcm,
626 SNDRV_DMA_TYPE_CONTINUOUS,
627 snd_dma_continuous_data(GFP_KERNEL),
628 MAX_BUFSIZE, MAX_BUFSIZE);
629 if (ret) { 627 if (ret) {
630 kfree(rt); 628 kfree(rt);
631 snd_printk(KERN_ERR PREFIX 629 snd_printk(KERN_ERR PREFIX