mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-22 20:43:56 +08:00
ASoC: soc-component: add snd_soc_component_is_suspended()
Current ALSA SoC is directly using component->xxx, But, it is not good for encapsulation. This patch adds new snd_soc_component_is_suspended() and use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/874l395rlx.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
9a840cbac7
commit
e40fadbcef
@ -355,5 +355,6 @@ int snd_soc_component_trigger(struct snd_soc_component *component,
|
|||||||
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);
|
void snd_soc_component_resume(struct snd_soc_component *component);
|
||||||
|
int snd_soc_component_is_suspended(struct snd_soc_component *component);
|
||||||
|
|
||||||
#endif /* __SOC_COMPONENT_H */
|
#endif /* __SOC_COMPONENT_H */
|
||||||
|
@ -361,3 +361,8 @@ void snd_soc_component_resume(struct snd_soc_component *component)
|
|||||||
component->driver->resume(component);
|
component->driver->resume(component);
|
||||||
component->suspended = 0;
|
component->suspended = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int snd_soc_component_is_suspended(struct snd_soc_component *component)
|
||||||
|
{
|
||||||
|
return component->suspended;
|
||||||
|
}
|
||||||
|
@ -503,7 +503,7 @@ int snd_soc_suspend(struct device *dev)
|
|||||||
* If there are paths active then the COMPONENT will be held
|
* If there are paths active then the COMPONENT will be held
|
||||||
* with bias _ON and should not be suspended.
|
* with bias _ON and should not be suspended.
|
||||||
*/
|
*/
|
||||||
if (!component->suspended) {
|
if (!snd_soc_component_is_suspended(component)) {
|
||||||
switch (snd_soc_dapm_get_bias_level(dapm)) {
|
switch (snd_soc_dapm_get_bias_level(dapm)) {
|
||||||
case SND_SOC_BIAS_STANDBY:
|
case SND_SOC_BIAS_STANDBY:
|
||||||
/*
|
/*
|
||||||
@ -592,9 +592,8 @@ 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 (snd_soc_component_is_suspended(component))
|
||||||
snd_soc_component_resume(component);
|
snd_soc_component_resume(component);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for_each_card_rtds(card, rtd) {
|
for_each_card_rtds(card, rtd) {
|
||||||
|
Loading…
Reference in New Issue
Block a user