mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
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>
This commit is contained in:
parent
fc76f86376
commit
4a9f911861
1 changed files with 5 additions and 7 deletions
|
@ -450,13 +450,13 @@ static int usb6fire_pcm_close(struct snd_pcm_substream *alsa_sub)
|
||||||
static int usb6fire_pcm_hw_params(struct snd_pcm_substream *alsa_sub,
|
static int usb6fire_pcm_hw_params(struct snd_pcm_substream *alsa_sub,
|
||||||
struct snd_pcm_hw_params *hw_params)
|
struct snd_pcm_hw_params *hw_params)
|
||||||
{
|
{
|
||||||
return snd_pcm_lib_malloc_pages(alsa_sub,
|
return snd_pcm_lib_alloc_vmalloc_buffer(alsa_sub,
|
||||||
params_buffer_bytes(hw_params));
|
params_buffer_bytes(hw_params));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int usb6fire_pcm_hw_free(struct snd_pcm_substream *alsa_sub)
|
static int usb6fire_pcm_hw_free(struct snd_pcm_substream *alsa_sub)
|
||||||
{
|
{
|
||||||
return snd_pcm_lib_free_pages(alsa_sub);
|
return snd_pcm_lib_free_vmalloc_buffer(alsa_sub);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub)
|
static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub)
|
||||||
|
@ -560,6 +560,8 @@ static struct snd_pcm_ops pcm_ops = {
|
||||||
.prepare = usb6fire_pcm_prepare,
|
.prepare = usb6fire_pcm_prepare,
|
||||||
.trigger = usb6fire_pcm_trigger,
|
.trigger = usb6fire_pcm_trigger,
|
||||||
.pointer = usb6fire_pcm_pointer,
|
.pointer = usb6fire_pcm_pointer,
|
||||||
|
.page = snd_pcm_lib_get_vmalloc_page,
|
||||||
|
.mmap = snd_pcm_lib_mmap_vmalloc,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void usb6fire_pcm_init_urb(struct pcm_urb *urb,
|
static void usb6fire_pcm_init_urb(struct pcm_urb *urb,
|
||||||
|
@ -622,10 +624,6 @@ int usb6fire_pcm_init(struct sfire_chip *chip)
|
||||||
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &pcm_ops);
|
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &pcm_ops);
|
||||||
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_ops);
|
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_ops);
|
||||||
|
|
||||||
ret = snd_pcm_lib_preallocate_pages_for_all(pcm,
|
|
||||||
SNDRV_DMA_TYPE_CONTINUOUS,
|
|
||||||
snd_dma_continuous_data(GFP_KERNEL),
|
|
||||||
MAX_BUFSIZE, MAX_BUFSIZE);
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
kfree(rt);
|
kfree(rt);
|
||||||
snd_printk(KERN_ERR PREFIX
|
snd_printk(KERN_ERR PREFIX
|
||||||
|
|
Loading…
Reference in a new issue