Commit a98e2e22 authored by Takashi Iwai's avatar Takashi Iwai Committed by Mauro Carvalho Chehab

media: solo6x10: Use managed buffer allocation

Clean up the driver with the new managed buffer allocation API.
The hw_params and hw_free callbacks became superfluous and dropped.

Cc: Bluecherry Maintainers <maintainers@bluecherrydvr.com>
Cc: Anton Sviridenko <anton@corp.bluecherry.net>
Cc: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
Cc: Ismael Luceno <ismael@iodev.co.uk>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 9453264e
...@@ -97,17 +97,6 @@ void solo_g723_isr(struct solo_dev *solo_dev) ...@@ -97,17 +97,6 @@ void solo_g723_isr(struct solo_dev *solo_dev)
} }
} }
static int snd_solo_hw_params(struct snd_pcm_substream *ss,
struct snd_pcm_hw_params *hw_params)
{
return snd_pcm_lib_malloc_pages(ss, params_buffer_bytes(hw_params));
}
static int snd_solo_hw_free(struct snd_pcm_substream *ss)
{
return snd_pcm_lib_free_pages(ss);
}
static const struct snd_pcm_hardware snd_solo_pcm_hw = { static const struct snd_pcm_hardware snd_solo_pcm_hw = {
.info = (SNDRV_PCM_INFO_MMAP | .info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_INTERLEAVED |
...@@ -271,8 +260,6 @@ static const struct snd_pcm_ops snd_solo_pcm_ops = { ...@@ -271,8 +260,6 @@ static const struct snd_pcm_ops snd_solo_pcm_ops = {
.open = snd_solo_pcm_open, .open = snd_solo_pcm_open,
.close = snd_solo_pcm_close, .close = snd_solo_pcm_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_solo_hw_params,
.hw_free = snd_solo_hw_free,
.prepare = snd_solo_pcm_prepare, .prepare = snd_solo_pcm_prepare,
.trigger = snd_solo_pcm_trigger, .trigger = snd_solo_pcm_trigger,
.pointer = snd_solo_pcm_pointer, .pointer = snd_solo_pcm_pointer,
...@@ -351,7 +338,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev) ...@@ -351,7 +338,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
ss; ss = ss->next, i++) ss; ss = ss->next, i++)
sprintf(ss->name, "Camera #%d Audio", i); sprintf(ss->name, "Camera #%d Audio", i);
snd_pcm_lib_preallocate_pages_for_all(pcm, snd_pcm_set_managed_buffer_all(pcm,
SNDRV_DMA_TYPE_CONTINUOUS, SNDRV_DMA_TYPE_CONTINUOUS,
NULL, NULL,
G723_PERIOD_BYTES * PERIODS, G723_PERIOD_BYTES * PERIODS,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment