aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorAntonio Ospite <ao2@amarulasolutions.com>2013-06-21 07:11:49 -0400
committerTakashi Iwai <tiwai@suse.de>2013-06-21 08:35:52 -0400
commitfc76f8637650f422eb67385d5a584bf30befddaa (patch)
treea1b287a6b4ab2891caf18cd9374e8adba3242a24 /sound/usb
parent3dd446a7e5bb001ec681232ac63a558f5e0509ed (diff)
ALSA: snd-usb-caiaq: 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/caiaq/audio.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
index c1916184e2e1..7103b0908d13 100644
--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -183,14 +183,15 @@ static int snd_usb_caiaq_substream_close(struct snd_pcm_substream *substream)
183static int snd_usb_caiaq_pcm_hw_params(struct snd_pcm_substream *sub, 183static int snd_usb_caiaq_pcm_hw_params(struct snd_pcm_substream *sub,
184 struct snd_pcm_hw_params *hw_params) 184 struct snd_pcm_hw_params *hw_params)
185{ 185{
186 return snd_pcm_lib_malloc_pages(sub, params_buffer_bytes(hw_params)); 186 return snd_pcm_lib_alloc_vmalloc_buffer(sub,
187 params_buffer_bytes(hw_params));
187} 188}
188 189
189static int snd_usb_caiaq_pcm_hw_free(struct snd_pcm_substream *sub) 190static int snd_usb_caiaq_pcm_hw_free(struct snd_pcm_substream *sub)
190{ 191{
191 struct snd_usb_caiaqdev *cdev = snd_pcm_substream_chip(sub); 192 struct snd_usb_caiaqdev *cdev = snd_pcm_substream_chip(sub);
192 deactivate_substream(cdev, sub); 193 deactivate_substream(cdev, sub);
193 return snd_pcm_lib_free_pages(sub); 194 return snd_pcm_lib_free_vmalloc_buffer(sub);
194} 195}
195 196
196/* this should probably go upstream */ 197/* this should probably go upstream */
@@ -345,7 +346,9 @@ static struct snd_pcm_ops snd_usb_caiaq_ops = {
345 .hw_free = snd_usb_caiaq_pcm_hw_free, 346 .hw_free = snd_usb_caiaq_pcm_hw_free,
346 .prepare = snd_usb_caiaq_pcm_prepare, 347 .prepare = snd_usb_caiaq_pcm_prepare,
347 .trigger = snd_usb_caiaq_pcm_trigger, 348 .trigger = snd_usb_caiaq_pcm_trigger,
348 .pointer = snd_usb_caiaq_pcm_pointer 349 .pointer = snd_usb_caiaq_pcm_pointer,
350 .page = snd_pcm_lib_get_vmalloc_page,
351 .mmap = snd_pcm_lib_mmap_vmalloc,
349}; 352};
350 353
351static void check_for_elapsed_periods(struct snd_usb_caiaqdev *cdev, 354static void check_for_elapsed_periods(struct snd_usb_caiaqdev *cdev,
@@ -852,11 +855,6 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *cdev)
852 snd_pcm_set_ops(cdev->pcm, SNDRV_PCM_STREAM_CAPTURE, 855 snd_pcm_set_ops(cdev->pcm, SNDRV_PCM_STREAM_CAPTURE,
853 &snd_usb_caiaq_ops); 856 &snd_usb_caiaq_ops);
854 857
855 snd_pcm_lib_preallocate_pages_for_all(cdev->pcm,
856 SNDRV_DMA_TYPE_CONTINUOUS,
857 snd_dma_continuous_data(GFP_KERNEL),
858 MAX_BUFFER_SIZE, MAX_BUFFER_SIZE);
859
860 cdev->data_cb_info = 858 cdev->data_cb_info =
861 kmalloc(sizeof(struct snd_usb_caiaq_cb_info) * N_URBS, 859 kmalloc(sizeof(struct snd_usb_caiaq_cb_info) * N_URBS,
862 GFP_KERNEL); 860 GFP_KERNEL);