Commit d244a1db authored by Takashi Iwai's avatar Takashi Iwai

ALSA: es1938: 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 got
dropped.

Link: https://lore.kernel.org/r/20191209094943.14984-39-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent b22b2478
...@@ -863,25 +863,6 @@ static int snd_es1938_capture_copy_kernel(struct snd_pcm_substream *substream, ...@@ -863,25 +863,6 @@ static int snd_es1938_capture_copy_kernel(struct snd_pcm_substream *substream,
return 0; return 0;
} }
/*
* buffer management
*/
static int snd_es1938_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{
int err;
if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0)
return err;
return 0;
}
static int snd_es1938_pcm_hw_free(struct snd_pcm_substream *substream)
{
return snd_pcm_lib_free_pages(substream);
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
* Audio1 Capture (ADC) * Audio1 Capture (ADC)
* ----------------------------------------------------------------------*/ * ----------------------------------------------------------------------*/
...@@ -997,8 +978,6 @@ static const struct snd_pcm_ops snd_es1938_playback_ops = { ...@@ -997,8 +978,6 @@ static const struct snd_pcm_ops snd_es1938_playback_ops = {
.open = snd_es1938_playback_open, .open = snd_es1938_playback_open,
.close = snd_es1938_playback_close, .close = snd_es1938_playback_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_es1938_pcm_hw_params,
.hw_free = snd_es1938_pcm_hw_free,
.prepare = snd_es1938_playback_prepare, .prepare = snd_es1938_playback_prepare,
.trigger = snd_es1938_playback_trigger, .trigger = snd_es1938_playback_trigger,
.pointer = snd_es1938_playback_pointer, .pointer = snd_es1938_playback_pointer,
...@@ -1008,8 +987,6 @@ static const struct snd_pcm_ops snd_es1938_capture_ops = { ...@@ -1008,8 +987,6 @@ static const struct snd_pcm_ops snd_es1938_capture_ops = {
.open = snd_es1938_capture_open, .open = snd_es1938_capture_open,
.close = snd_es1938_capture_close, .close = snd_es1938_capture_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_es1938_pcm_hw_params,
.hw_free = snd_es1938_pcm_hw_free,
.prepare = snd_es1938_capture_prepare, .prepare = snd_es1938_capture_prepare,
.trigger = snd_es1938_capture_trigger, .trigger = snd_es1938_capture_trigger,
.pointer = snd_es1938_capture_pointer, .pointer = snd_es1938_capture_pointer,
...@@ -1031,9 +1008,8 @@ static int snd_es1938_new_pcm(struct es1938 *chip, int device) ...@@ -1031,9 +1008,8 @@ static int snd_es1938_new_pcm(struct es1938 *chip, int device)
pcm->info_flags = 0; pcm->info_flags = 0;
strcpy(pcm->name, "ESS Solo-1"); strcpy(pcm->name, "ESS Solo-1");
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
&chip->pci->dev, &chip->pci->dev, 64*1024, 64*1024);
64*1024, 64*1024);
chip->pcm = pcm; chip->pcm = pcm;
return 0; return 0;
......
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