Commit eb40b64f authored by Takashi Iwai's avatar Takashi Iwai

ALSA: es1688: 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-13-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 427f0ea4
...@@ -341,17 +341,6 @@ static int snd_es1688_trigger(struct snd_es1688 *chip, int cmd, unsigned char va ...@@ -341,17 +341,6 @@ static int snd_es1688_trigger(struct snd_es1688 *chip, int cmd, unsigned char va
return 0; return 0;
} }
static int snd_es1688_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{
return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
}
static int snd_es1688_hw_free(struct snd_pcm_substream *substream)
{
return snd_pcm_lib_free_pages(substream);
}
static int snd_es1688_playback_prepare(struct snd_pcm_substream *substream) static int snd_es1688_playback_prepare(struct snd_pcm_substream *substream)
{ {
unsigned long flags; unsigned long flags;
...@@ -693,8 +682,6 @@ static const struct snd_pcm_ops snd_es1688_playback_ops = { ...@@ -693,8 +682,6 @@ static const struct snd_pcm_ops snd_es1688_playback_ops = {
.open = snd_es1688_playback_open, .open = snd_es1688_playback_open,
.close = snd_es1688_playback_close, .close = snd_es1688_playback_close,
.ioctl = snd_es1688_ioctl, .ioctl = snd_es1688_ioctl,
.hw_params = snd_es1688_hw_params,
.hw_free = snd_es1688_hw_free,
.prepare = snd_es1688_playback_prepare, .prepare = snd_es1688_playback_prepare,
.trigger = snd_es1688_playback_trigger, .trigger = snd_es1688_playback_trigger,
.pointer = snd_es1688_playback_pointer, .pointer = snd_es1688_playback_pointer,
...@@ -704,8 +691,6 @@ static const struct snd_pcm_ops snd_es1688_capture_ops = { ...@@ -704,8 +691,6 @@ static const struct snd_pcm_ops snd_es1688_capture_ops = {
.open = snd_es1688_capture_open, .open = snd_es1688_capture_open,
.close = snd_es1688_capture_close, .close = snd_es1688_capture_close,
.ioctl = snd_es1688_ioctl, .ioctl = snd_es1688_ioctl,
.hw_params = snd_es1688_hw_params,
.hw_free = snd_es1688_hw_free,
.prepare = snd_es1688_capture_prepare, .prepare = snd_es1688_capture_prepare,
.trigger = snd_es1688_capture_trigger, .trigger = snd_es1688_capture_trigger,
.pointer = snd_es1688_capture_pointer, .pointer = snd_es1688_capture_pointer,
...@@ -728,9 +713,8 @@ int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device) ...@@ -728,9 +713,8 @@ int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device)
strcpy(pcm->name, snd_es1688_chip_id(chip)); strcpy(pcm->name, snd_es1688_chip_id(chip));
chip->pcm = pcm; chip->pcm = pcm;
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, card->dev,
card->dev, 64*1024, 64*1024);
64*1024, 64*1024);
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