]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ASoC: soc-dai: add snd_soc_dai_compr_pointer()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 23 Apr 2020 23:15:49 +0000 (08:15 +0900)
committerMark Brown <broonie@kernel.org>
Wed, 29 Apr 2020 12:27:48 +0000 (13:27 +0100)
dai related function should be implemented at soc-dai.c.
This patch adds snd_soc_dai_compr_pointer().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87h7x9ssii.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-dai.h
sound/soc/soc-compress.c
sound/soc/soc-dai.c

index 16dc9248f7f0e979aa51acb1f5eb6319e0fa484f..8101ec030e637f917ea13b3e2eb5d5a60211ad31 100644 (file)
@@ -185,6 +185,9 @@ int snd_soc_dai_compr_get_params(struct snd_soc_dai *dai,
 int snd_soc_dai_compr_ack(struct snd_soc_dai *dai,
                          struct snd_compr_stream *cstream,
                          size_t bytes);
+int snd_soc_dai_compr_pointer(struct snd_soc_dai *dai,
+                             struct snd_compr_stream *cstream,
+                             struct snd_compr_tstamp *tstamp);
 
 struct snd_soc_dai_ops {
        /*
index 945e664c78b2ffaa12f22aa26b9585fc47e9c4f5..93b2c88bb1eb0270ed58b5d72c3fe0ee933a6810 100644 (file)
@@ -648,8 +648,9 @@ static int soc_compr_pointer(struct snd_compr_stream *cstream,
 
        mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
 
-       if (cpu_dai->driver->cops && cpu_dai->driver->cops->pointer)
-               cpu_dai->driver->cops->pointer(cstream, tstamp, cpu_dai);
+       ret = snd_soc_dai_compr_pointer(cpu_dai, cstream, tstamp);
+       if (ret < 0)
+               goto out;
 
        for_each_rtd_components(rtd, i, component) {
                if (!component->driver->compress_ops ||
@@ -660,7 +661,7 @@ static int soc_compr_pointer(struct snd_compr_stream *cstream,
                        component, cstream, tstamp);
                break;
        }
-
+out:
        mutex_unlock(&rtd->card->pcm_mutex);
        return ret;
 }
index bf52ecb26c0e4ee3b3840012568bd5e598b6f2d9..89fcf194c45edced77b1b028e36725219f9fac9f 100644 (file)
@@ -581,3 +581,17 @@ int snd_soc_dai_compr_ack(struct snd_soc_dai *dai,
        return soc_dai_ret(dai, ret);
 }
 EXPORT_SYMBOL_GPL(snd_soc_dai_compr_ack);
+
+int snd_soc_dai_compr_pointer(struct snd_soc_dai *dai,
+                             struct snd_compr_stream *cstream,
+                             struct snd_compr_tstamp *tstamp)
+{
+       int ret = 0;
+
+       if (dai->driver->cops &&
+           dai->driver->cops->pointer)
+               ret = dai->driver->cops->pointer(cstream, tstamp, dai);
+
+       return soc_dai_ret(dai, ret);
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_compr_pointer);