]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ASoC: intel: sst-mfld-platform-pcm: remove snd_pcm_ops
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 2 Oct 2019 05:31:41 +0000 (14:31 +0900)
committerMark Brown <broonie@kernel.org>
Tue, 8 Oct 2019 12:41:52 +0000 (13:41 +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/87muejaf2a.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/atom/sst-mfld-platform-pcm.c

index 8cc3cc363eb03cc09df92102e81f336207c51439..47e3d1943d7e3e8cd1035d0d5e01a8460b4cf7bb 100644 (file)
@@ -586,7 +586,8 @@ static struct snd_soc_dai_driver sst_platform_dai[] = {
 },
 };
 
-static int sst_platform_open(struct snd_pcm_substream *substream)
+static int sst_soc_open(struct snd_soc_component *component,
+                       struct snd_pcm_substream *substream)
 {
        struct snd_pcm_runtime *runtime;
 
@@ -598,15 +599,15 @@ static int sst_platform_open(struct snd_pcm_substream *substream)
        return 0;
 }
 
-static int sst_platform_pcm_trigger(struct snd_pcm_substream *substream,
-                                       int cmd)
+static int sst_soc_trigger(struct snd_soc_component *component,
+                          struct snd_pcm_substream *substream, int cmd)
 {
        int ret_val = 0, str_id;
        struct sst_runtime_stream *stream;
        int status;
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
 
-       dev_dbg(rtd->dev, "sst_platform_pcm_trigger called\n");
+       dev_dbg(rtd->dev, "%s called\n", __func__);
        if (substream->pcm->internal)
                return 0;
        stream = substream->runtime->private_data;
@@ -646,8 +647,8 @@ static int sst_platform_pcm_trigger(struct snd_pcm_substream *substream,
 }
 
 
-static snd_pcm_uframes_t sst_platform_pcm_pointer
-                       (struct snd_pcm_substream *substream)
+static snd_pcm_uframes_t sst_soc_pointer(struct snd_soc_component *component,
+                                        struct snd_pcm_substream *substream)
 {
        struct sst_runtime_stream *stream;
        int ret_val, status;
@@ -668,14 +669,8 @@ static snd_pcm_uframes_t sst_platform_pcm_pointer
        return str_info->buffer_ptr;
 }
 
-static const struct snd_pcm_ops sst_platform_ops = {
-       .open = sst_platform_open,
-       .ioctl = snd_pcm_lib_ioctl,
-       .trigger = sst_platform_pcm_trigger,
-       .pointer = sst_platform_pcm_pointer,
-};
-
-static int sst_pcm_new(struct snd_soc_pcm_runtime *rtd)
+static int sst_soc_pcm_new(struct snd_soc_component *component,
+                          struct snd_soc_pcm_runtime *rtd)
 {
        struct snd_soc_dai *dai = rtd->cpu_dai;
        struct snd_pcm *pcm = rtd->pcm;
@@ -709,9 +704,12 @@ static const struct snd_soc_component_driver sst_soc_platform_drv  = {
        .name           = DRV_NAME,
        .probe          = sst_soc_probe,
        .remove         = sst_soc_remove,
-       .ops            = &sst_platform_ops,
+       .open           = sst_soc_open,
+       .ioctl          = snd_soc_pcm_lib_ioctl,
+       .trigger        = sst_soc_trigger,
+       .pointer        = sst_soc_pointer,
        .compr_ops      = &sst_platform_compr_ops,
-       .pcm_new        = sst_pcm_new,
+       .pcm_construct  = sst_soc_pcm_new,
 };
 
 static int sst_platform_probe(struct platform_device *pdev)