Commit 9a840cba authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-component: add snd_soc_component_resume()

Current ALSA SoC is directly using component->driver->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_resume() and use it.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875znp5rm2.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 66c51573
...@@ -354,5 +354,6 @@ int snd_soc_component_trigger(struct snd_soc_component *component, ...@@ -354,5 +354,6 @@ int snd_soc_component_trigger(struct snd_soc_component *component,
struct snd_pcm_substream *substream, struct snd_pcm_substream *substream,
int cmd); int cmd);
void snd_soc_component_suspend(struct snd_soc_component *component); void snd_soc_component_suspend(struct snd_soc_component *component);
void snd_soc_component_resume(struct snd_soc_component *component);
#endif /* __SOC_COMPONENT_H */ #endif /* __SOC_COMPONENT_H */
...@@ -354,3 +354,10 @@ void snd_soc_component_suspend(struct snd_soc_component *component) ...@@ -354,3 +354,10 @@ void snd_soc_component_suspend(struct snd_soc_component *component)
component->driver->suspend(component); component->driver->suspend(component);
component->suspended = 1; component->suspended = 1;
} }
void snd_soc_component_resume(struct snd_soc_component *component)
{
if (component->driver->resume)
component->driver->resume(component);
component->suspended = 0;
}
...@@ -593,9 +593,7 @@ static void soc_resume_deferred(struct work_struct *work) ...@@ -593,9 +593,7 @@ static void soc_resume_deferred(struct work_struct *work)
for_each_card_components(card, component) { for_each_card_components(card, component) {
if (component->suspended) { if (component->suspended) {
if (component->driver->resume) snd_soc_component_resume(component);
component->driver->resume(component);
component->suspended = 0;
} }
} }
......
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