Commit c645ea11 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: uniphier: aio-dma: remove snd_pcm_ops

snd_pcm_ops is no longer needed.
Let's use component driver callback.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878sq3af0r.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2bcba424
...@@ -93,7 +93,8 @@ static irqreturn_t aiodma_irq(int irq, void *p) ...@@ -93,7 +93,8 @@ static irqreturn_t aiodma_irq(int irq, void *p)
return ret; return ret;
} }
static int uniphier_aiodma_open(struct snd_pcm_substream *substream) static int uniphier_aiodma_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
...@@ -103,7 +104,8 @@ static int uniphier_aiodma_open(struct snd_pcm_substream *substream) ...@@ -103,7 +104,8 @@ static int uniphier_aiodma_open(struct snd_pcm_substream *substream)
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256); SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256);
} }
static int uniphier_aiodma_hw_params(struct snd_pcm_substream *substream, static int uniphier_aiodma_hw_params(struct snd_soc_component *component,
struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
{ {
snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
...@@ -112,7 +114,8 @@ static int uniphier_aiodma_hw_params(struct snd_pcm_substream *substream, ...@@ -112,7 +114,8 @@ static int uniphier_aiodma_hw_params(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static int uniphier_aiodma_hw_free(struct snd_pcm_substream *substream) static int uniphier_aiodma_hw_free(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ {
snd_pcm_set_runtime_buffer(substream, NULL); snd_pcm_set_runtime_buffer(substream, NULL);
substream->runtime->dma_bytes = 0; substream->runtime->dma_bytes = 0;
...@@ -120,7 +123,8 @@ static int uniphier_aiodma_hw_free(struct snd_pcm_substream *substream) ...@@ -120,7 +123,8 @@ static int uniphier_aiodma_hw_free(struct snd_pcm_substream *substream)
return 0; return 0;
} }
static int uniphier_aiodma_prepare(struct snd_pcm_substream *substream) static int uniphier_aiodma_prepare(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
...@@ -146,7 +150,8 @@ static int uniphier_aiodma_prepare(struct snd_pcm_substream *substream) ...@@ -146,7 +150,8 @@ static int uniphier_aiodma_prepare(struct snd_pcm_substream *substream)
return 0; return 0;
} }
static int uniphier_aiodma_trigger(struct snd_pcm_substream *substream, int cmd) static int uniphier_aiodma_trigger(struct snd_soc_component *component,
struct snd_pcm_substream *substream, int cmd)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
...@@ -181,6 +186,7 @@ static int uniphier_aiodma_trigger(struct snd_pcm_substream *substream, int cmd) ...@@ -181,6 +186,7 @@ static int uniphier_aiodma_trigger(struct snd_pcm_substream *substream, int cmd)
} }
static snd_pcm_uframes_t uniphier_aiodma_pointer( static snd_pcm_uframes_t uniphier_aiodma_pointer(
struct snd_soc_component *component,
struct snd_pcm_substream *substream) struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
...@@ -204,7 +210,8 @@ static snd_pcm_uframes_t uniphier_aiodma_pointer( ...@@ -204,7 +210,8 @@ static snd_pcm_uframes_t uniphier_aiodma_pointer(
return pos; return pos;
} }
static int uniphier_aiodma_mmap(struct snd_pcm_substream *substream, static int uniphier_aiodma_mmap(struct snd_soc_component *component,
struct snd_pcm_substream *substream,
struct vm_area_struct *vma) struct vm_area_struct *vma)
{ {
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
...@@ -214,18 +221,8 @@ static int uniphier_aiodma_mmap(struct snd_pcm_substream *substream, ...@@ -214,18 +221,8 @@ static int uniphier_aiodma_mmap(struct snd_pcm_substream *substream,
vma->vm_end - vma->vm_start, vma->vm_page_prot); vma->vm_end - vma->vm_start, vma->vm_page_prot);
} }
static const struct snd_pcm_ops uniphier_aiodma_ops = { static int uniphier_aiodma_new(struct snd_soc_component *component,
.open = uniphier_aiodma_open, struct snd_soc_pcm_runtime *rtd)
.ioctl = snd_pcm_lib_ioctl,
.hw_params = uniphier_aiodma_hw_params,
.hw_free = uniphier_aiodma_hw_free,
.prepare = uniphier_aiodma_prepare,
.trigger = uniphier_aiodma_trigger,
.pointer = uniphier_aiodma_pointer,
.mmap = uniphier_aiodma_mmap,
};
static int uniphier_aiodma_new(struct snd_soc_pcm_runtime *rtd)
{ {
struct device *dev = rtd->card->snd_card->dev; struct device *dev = rtd->card->snd_card->dev;
struct snd_pcm *pcm = rtd->pcm; struct snd_pcm *pcm = rtd->pcm;
...@@ -242,16 +239,24 @@ static int uniphier_aiodma_new(struct snd_soc_pcm_runtime *rtd) ...@@ -242,16 +239,24 @@ static int uniphier_aiodma_new(struct snd_soc_pcm_runtime *rtd)
return 0; return 0;
} }
static void uniphier_aiodma_free(struct snd_pcm *pcm) static void uniphier_aiodma_free(struct snd_soc_component *component,
struct snd_pcm *pcm)
{ {
snd_pcm_lib_preallocate_free_for_all(pcm); snd_pcm_lib_preallocate_free_for_all(pcm);
} }
static const struct snd_soc_component_driver uniphier_soc_platform = { static const struct snd_soc_component_driver uniphier_soc_platform = {
.pcm_new = uniphier_aiodma_new, .open = uniphier_aiodma_open,
.pcm_free = uniphier_aiodma_free, .ioctl = snd_soc_pcm_lib_ioctl,
.ops = &uniphier_aiodma_ops, .hw_params = uniphier_aiodma_hw_params,
.compr_ops = &uniphier_aio_compr_ops, .hw_free = uniphier_aiodma_hw_free,
.prepare = uniphier_aiodma_prepare,
.trigger = uniphier_aiodma_trigger,
.pointer = uniphier_aiodma_pointer,
.mmap = uniphier_aiodma_mmap,
.pcm_construct = uniphier_aiodma_new,
.pcm_destruct = uniphier_aiodma_free,
.compr_ops = &uniphier_aio_compr_ops,
}; };
static const struct regmap_config aiodma_regmap_config = { static const struct regmap_config aiodma_regmap_config = {
......
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