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

ASoC: txx9: txx9aclc: 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/877e5naf0m.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent c645ea11
...@@ -47,12 +47,12 @@ static const struct snd_pcm_hardware txx9aclc_pcm_hardware = { ...@@ -47,12 +47,12 @@ static const struct snd_pcm_hardware txx9aclc_pcm_hardware = {
.buffer_bytes_max = 32 * 1024, .buffer_bytes_max = 32 * 1024,
}; };
static int txx9aclc_pcm_hw_params(struct snd_pcm_substream *substream, static int txx9aclc_pcm_hw_params(struct snd_soc_component *component,
struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
{ {
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct txx9aclc_dmadata *dmadata = runtime->private_data; struct txx9aclc_dmadata *dmadata = runtime->private_data;
int ret; int ret;
...@@ -76,12 +76,14 @@ static int txx9aclc_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -76,12 +76,14 @@ static int txx9aclc_pcm_hw_params(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static int txx9aclc_pcm_hw_free(struct snd_pcm_substream *substream) static int txx9aclc_pcm_hw_free(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ {
return snd_pcm_lib_free_pages(substream); return snd_pcm_lib_free_pages(substream);
} }
static int txx9aclc_pcm_prepare(struct snd_pcm_substream *substream) static int txx9aclc_pcm_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 txx9aclc_dmadata *dmadata = runtime->private_data; struct txx9aclc_dmadata *dmadata = runtime->private_data;
...@@ -203,7 +205,8 @@ static void txx9aclc_dma_tasklet(unsigned long data) ...@@ -203,7 +205,8 @@ static void txx9aclc_dma_tasklet(unsigned long data)
spin_unlock_irqrestore(&dmadata->dma_lock, flags); spin_unlock_irqrestore(&dmadata->dma_lock, flags);
} }
static int txx9aclc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) static int txx9aclc_pcm_trigger(struct snd_soc_component *component,
struct snd_pcm_substream *substream, int cmd)
{ {
struct txx9aclc_dmadata *dmadata = substream->runtime->private_data; struct txx9aclc_dmadata *dmadata = substream->runtime->private_data;
struct txx9aclc_plat_drvdata *drvdata = txx9aclc_drvdata; struct txx9aclc_plat_drvdata *drvdata = txx9aclc_drvdata;
...@@ -236,14 +239,16 @@ static int txx9aclc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) ...@@ -236,14 +239,16 @@ static int txx9aclc_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
} }
static snd_pcm_uframes_t static snd_pcm_uframes_t
txx9aclc_pcm_pointer(struct snd_pcm_substream *substream) txx9aclc_pcm_pointer(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ {
struct txx9aclc_dmadata *dmadata = substream->runtime->private_data; struct txx9aclc_dmadata *dmadata = substream->runtime->private_data;
return bytes_to_frames(substream->runtime, dmadata->pos); return bytes_to_frames(substream->runtime, dmadata->pos);
} }
static int txx9aclc_pcm_open(struct snd_pcm_substream *substream) static int txx9aclc_pcm_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ {
struct txx9aclc_soc_device *dev = &txx9aclc_soc_device; struct txx9aclc_soc_device *dev = &txx9aclc_soc_device;
struct txx9aclc_dmadata *dmadata = &dev->dmadata[substream->stream]; struct txx9aclc_dmadata *dmadata = &dev->dmadata[substream->stream];
...@@ -261,7 +266,8 @@ static int txx9aclc_pcm_open(struct snd_pcm_substream *substream) ...@@ -261,7 +266,8 @@ static int txx9aclc_pcm_open(struct snd_pcm_substream *substream)
return 0; return 0;
} }
static int txx9aclc_pcm_close(struct snd_pcm_substream *substream) static int txx9aclc_pcm_close(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ {
struct txx9aclc_dmadata *dmadata = substream->runtime->private_data; struct txx9aclc_dmadata *dmadata = substream->runtime->private_data;
struct dma_chan *chan = dmadata->dma_chan; struct dma_chan *chan = dmadata->dma_chan;
...@@ -271,23 +277,12 @@ static int txx9aclc_pcm_close(struct snd_pcm_substream *substream) ...@@ -271,23 +277,12 @@ static int txx9aclc_pcm_close(struct snd_pcm_substream *substream)
return 0; return 0;
} }
static const struct snd_pcm_ops txx9aclc_pcm_ops = { static int txx9aclc_pcm_new(struct snd_soc_component *component,
.open = txx9aclc_pcm_open, struct snd_soc_pcm_runtime *rtd)
.close = txx9aclc_pcm_close,
.ioctl = snd_pcm_lib_ioctl,
.hw_params = txx9aclc_pcm_hw_params,
.hw_free = txx9aclc_pcm_hw_free,
.prepare = txx9aclc_pcm_prepare,
.trigger = txx9aclc_pcm_trigger,
.pointer = txx9aclc_pcm_pointer,
};
static int txx9aclc_pcm_new(struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_card *card = rtd->card->snd_card; struct snd_card *card = rtd->card->snd_card;
struct snd_soc_dai *dai = rtd->cpu_dai; struct snd_soc_dai *dai = rtd->cpu_dai;
struct snd_pcm *pcm = rtd->pcm; struct snd_pcm *pcm = rtd->pcm;
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct platform_device *pdev = to_platform_device(component->dev); struct platform_device *pdev = to_platform_device(component->dev);
struct txx9aclc_soc_device *dev; struct txx9aclc_soc_device *dev;
struct resource *r; struct resource *r;
...@@ -409,8 +404,15 @@ static const struct snd_soc_component_driver txx9aclc_soc_component = { ...@@ -409,8 +404,15 @@ static const struct snd_soc_component_driver txx9aclc_soc_component = {
.name = DRV_NAME, .name = DRV_NAME,
.probe = txx9aclc_pcm_probe, .probe = txx9aclc_pcm_probe,
.remove = txx9aclc_pcm_remove, .remove = txx9aclc_pcm_remove,
.ops = &txx9aclc_pcm_ops, .open = txx9aclc_pcm_open,
.pcm_new = txx9aclc_pcm_new, .close = txx9aclc_pcm_close,
.ioctl = snd_soc_pcm_lib_ioctl,
.hw_params = txx9aclc_pcm_hw_params,
.hw_free = txx9aclc_pcm_hw_free,
.prepare = txx9aclc_pcm_prepare,
.trigger = txx9aclc_pcm_trigger,
.pointer = txx9aclc_pcm_pointer,
.pcm_construct = txx9aclc_pcm_new,
}; };
static int txx9aclc_soc_platform_probe(struct platform_device *pdev) static int txx9aclc_soc_platform_probe(struct platform_device *pdev)
......
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