]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: txx9: txx9aclc: remove snd_pcm_ops
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 2 Oct 2019 05:32:41 +0000 (14:32 +0900)
committerMark Brown <broonie@kernel.org>
Tue, 8 Oct 2019 12:44:23 +0000 (13:44 +0100)
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877e5naf0m.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/txx9/txx9aclc.c

index 66044559f70f32ac01de7acafbc04fd9b8fc801e..33c78d33e5a1d45251061f94d876e36133d8f315 100644 (file)
@@ -47,12 +47,12 @@ static const struct snd_pcm_hardware txx9aclc_pcm_hardware = {
        .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_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
        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;
        int ret;
 
@@ -76,12 +76,14 @@ static int txx9aclc_pcm_hw_params(struct snd_pcm_substream *substream,
        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);
 }
 
-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 txx9aclc_dmadata *dmadata = runtime->private_data;
@@ -203,7 +205,8 @@ static void txx9aclc_dma_tasklet(unsigned long data)
        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_plat_drvdata *drvdata = txx9aclc_drvdata;
@@ -236,14 +239,16 @@ static int txx9aclc_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
 }
 
 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;
 
        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_dmadata *dmadata = &dev->dmadata[substream->stream];
@@ -261,7 +266,8 @@ static int txx9aclc_pcm_open(struct snd_pcm_substream *substream)
        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 dma_chan *chan = dmadata->dma_chan;
@@ -271,23 +277,12 @@ static int txx9aclc_pcm_close(struct snd_pcm_substream *substream)
        return 0;
 }
 
-static const struct snd_pcm_ops txx9aclc_pcm_ops = {
-       .open           = txx9aclc_pcm_open,
-       .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)
+static int txx9aclc_pcm_new(struct snd_soc_component *component,
+                           struct snd_soc_pcm_runtime *rtd)
 {
        struct snd_card *card = rtd->card->snd_card;
        struct snd_soc_dai *dai = rtd->cpu_dai;
        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 txx9aclc_soc_device *dev;
        struct resource *r;
@@ -409,8 +404,15 @@ static const struct snd_soc_component_driver txx9aclc_soc_component = {
        .name           = DRV_NAME,
        .probe          = txx9aclc_pcm_probe,
        .remove         = txx9aclc_pcm_remove,
-       .ops            = &txx9aclc_pcm_ops,
-       .pcm_new        = txx9aclc_pcm_new,
+       .open           = txx9aclc_pcm_open,
+       .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)