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

ASoC: soc-component: add snd_soc_component_compr_free()

component related function should be implemented at
soc-component.c.
This patch moves soc-compress soc_compr_components_free()
to soc-component as snd_soc_component_compr_free().
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87eekx7v7r.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent a4e427c5
...@@ -446,6 +446,8 @@ int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component, ...@@ -446,6 +446,8 @@ int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component,
const char **dai_name); const char **dai_name);
int snd_soc_component_compr_open(struct snd_compr_stream *cstream, int snd_soc_component_compr_open(struct snd_compr_stream *cstream,
struct snd_soc_component **last); struct snd_soc_component **last);
void snd_soc_component_compr_free(struct snd_compr_stream *cstream,
struct snd_soc_component *last);
int snd_soc_pcm_component_pointer(struct snd_pcm_substream *substream); int snd_soc_pcm_component_pointer(struct snd_pcm_substream *substream);
int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream, int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream,
......
...@@ -444,6 +444,24 @@ int snd_soc_component_compr_open(struct snd_compr_stream *cstream, ...@@ -444,6 +444,24 @@ int snd_soc_component_compr_open(struct snd_compr_stream *cstream,
} }
EXPORT_SYMBOL_GPL(snd_soc_component_compr_open); EXPORT_SYMBOL_GPL(snd_soc_component_compr_open);
void snd_soc_component_compr_free(struct snd_compr_stream *cstream,
struct snd_soc_component *last)
{
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
struct snd_soc_component *component;
int i;
for_each_rtd_components(rtd, i, component) {
if (component == last)
break;
if (component->driver->compress_ops &&
component->driver->compress_ops->free)
component->driver->compress_ops->free(component, cstream);
}
}
EXPORT_SYMBOL_GPL(snd_soc_component_compr_free);
static unsigned int soc_component_read_no_lock( static unsigned int soc_component_read_no_lock(
struct snd_soc_component *component, struct snd_soc_component *component,
unsigned int reg) unsigned int reg)
......
...@@ -22,27 +22,6 @@ ...@@ -22,27 +22,6 @@
#include <sound/soc-link.h> #include <sound/soc-link.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
static int soc_compr_components_free(struct snd_compr_stream *cstream,
struct snd_soc_component *last)
{
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
struct snd_soc_component *component;
int i;
for_each_rtd_components(rtd, i, component) {
if (component == last)
break;
if (!component->driver->compress_ops ||
!component->driver->compress_ops->free)
continue;
component->driver->compress_ops->free(component, cstream);
}
return 0;
}
static int soc_compr_open(struct snd_compr_stream *cstream) static int soc_compr_open(struct snd_compr_stream *cstream)
{ {
struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data;
...@@ -76,7 +55,7 @@ static int soc_compr_open(struct snd_compr_stream *cstream) ...@@ -76,7 +55,7 @@ static int soc_compr_open(struct snd_compr_stream *cstream)
return 0; return 0;
machine_err: machine_err:
soc_compr_components_free(cstream, component); snd_soc_component_compr_free(cstream, component);
snd_soc_dai_compr_shutdown(cpu_dai, cstream); snd_soc_dai_compr_shutdown(cpu_dai, cstream);
out: out:
...@@ -150,7 +129,7 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream) ...@@ -150,7 +129,7 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
return 0; return 0;
machine_err: machine_err:
soc_compr_components_free(cstream, component); snd_soc_component_compr_free(cstream, component);
open_err: open_err:
snd_soc_dai_compr_shutdown(cpu_dai, cstream); snd_soc_dai_compr_shutdown(cpu_dai, cstream);
out: out:
...@@ -182,7 +161,7 @@ static int soc_compr_free(struct snd_compr_stream *cstream) ...@@ -182,7 +161,7 @@ static int soc_compr_free(struct snd_compr_stream *cstream)
snd_soc_link_compr_shutdown(cstream); snd_soc_link_compr_shutdown(cstream);
soc_compr_components_free(cstream, NULL); snd_soc_component_compr_free(cstream, NULL);
snd_soc_dai_compr_shutdown(cpu_dai, cstream); snd_soc_dai_compr_shutdown(cpu_dai, cstream);
...@@ -230,7 +209,7 @@ static int soc_compr_free_fe(struct snd_compr_stream *cstream) ...@@ -230,7 +209,7 @@ static int soc_compr_free_fe(struct snd_compr_stream *cstream)
snd_soc_link_compr_shutdown(cstream); snd_soc_link_compr_shutdown(cstream);
soc_compr_components_free(cstream, NULL); snd_soc_component_compr_free(cstream, NULL);
snd_soc_dai_compr_shutdown(cpu_dai, cstream); snd_soc_dai_compr_shutdown(cpu_dai, cstream);
......
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