ASoC: soc-component: add snd_soc_pcm_component_hw_free()
We have 2 type of component functions snd_soc_component_xxx() is focusing to component itself, snd_soc_pcm_component_xxx() is focusing to rtd related component. Now we can update snd_soc_component_hw_free() to snd_soc_pcm_component_hw_free(). This patch do it. 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/87lfl3w8xv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:

committed by
Mark Brown

parent
e1bafa828e
commit
0475111986
@@ -275,17 +275,6 @@ int snd_soc_component_close(struct snd_soc_component *component,
|
||||
return soc_component_ret(component, ret);
|
||||
}
|
||||
|
||||
int snd_soc_component_hw_free(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (component->driver->hw_free)
|
||||
ret = component->driver->hw_free(component, substream);
|
||||
|
||||
return soc_component_ret(component, ret);
|
||||
}
|
||||
|
||||
int snd_soc_component_trigger(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream,
|
||||
int cmd)
|
||||
@@ -585,3 +574,22 @@ int snd_soc_pcm_component_hw_params(struct snd_pcm_substream *substream,
|
||||
*last = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void snd_soc_pcm_component_hw_free(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_component *last)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_component *component;
|
||||
int i, ret;
|
||||
|
||||
for_each_rtd_components(rtd, i, component) {
|
||||
if (component == last)
|
||||
break;
|
||||
|
||||
if (component->driver->hw_free) {
|
||||
ret = component->driver->hw_free(component, substream);
|
||||
if (ret < 0)
|
||||
soc_component_ret(component, ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user