summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-11-08 10:46:40 +0100
committerTakashi Iwai <tiwai@suse.de>2019-11-09 18:02:53 +0100
commite610748ad4388f02a2cd8b3ad051a662c03dbfbc (patch)
tree7c039e6f1bdad61816f3a602378cf443fed8f404 /sound/soc
parentf541220cd590e4a7436913d6f7d41ff4aba67982 (diff)
ASoC: cros_ec_codec: Convert to the common vmalloc memalloc
The recent change (*) in the ALSA memalloc core allows us to drop the special vmalloc-specific allocation and page handling. This patch coverts to the common code. (*) 1fe7f397cfe2: ALSA: memalloc: Add vmalloc buffer allocation support 7e8edae39fd1: ALSA: pcm: Handle special page mapping in the default mmap handler Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20191108094641.20086-8-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/cros_ec_codec.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sound/soc/codecs/cros_ec_codec.c b/sound/soc/codecs/cros_ec_codec.c
index dd14caf9091a..7b17f39a6a10 100644
--- a/sound/soc/codecs/cros_ec_codec.c
+++ b/sound/soc/codecs/cros_ec_codec.c
@@ -918,8 +918,7 @@ static int wov_pcm_hw_params(struct snd_soc_component *component,
priv->wov_burst_read = true;
mutex_unlock(&priv->wov_dma_lock);
- return snd_pcm_lib_alloc_vmalloc_buffer(substream,
- params_buffer_bytes(hw_params));
+ return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
}
static int wov_pcm_hw_free(struct snd_soc_component *component,
@@ -935,7 +934,7 @@ static int wov_pcm_hw_free(struct snd_soc_component *component,
cancel_delayed_work_sync(&priv->wov_copy_work);
- return snd_pcm_lib_free_vmalloc_buffer(substream);
+ return snd_pcm_lib_free_pages(substream);
}
static snd_pcm_uframes_t wov_pcm_pointer(struct snd_soc_component *component,
@@ -948,11 +947,12 @@ static snd_pcm_uframes_t wov_pcm_pointer(struct snd_soc_component *component,
return bytes_to_frames(runtime, priv->wov_dma_offset);
}
-static struct page *wov_pcm_page(struct snd_soc_component *component,
- struct snd_pcm_substream *substream,
- unsigned long offset)
+static int wov_pcm_new(struct snd_soc_component *component,
+ struct snd_soc_pcm_runtime *rtd)
{
- return snd_pcm_lib_get_vmalloc_page(substream, offset);
+ snd_pcm_lib_preallocate_pages_for_all(rtd->pcm, SNDRV_DMA_TYPE_VMALLOC,
+ NULL, 0, 0);
+ return 0;
}
static const struct snd_soc_component_driver wov_component_driver = {
@@ -964,7 +964,7 @@ static const struct snd_soc_component_driver wov_component_driver = {
.hw_params = wov_pcm_hw_params,
.hw_free = wov_pcm_hw_free,
.pointer = wov_pcm_pointer,
- .page = wov_pcm_page,
+ .pcm_construct = wov_pcm_new,
};
static int cros_ec_codec_platform_probe(struct platform_device *pdev)