Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 66c51573 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: soc-component: add snd_soc_component_suspend()



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_suspend() and use it.

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877e855rn0.wl-kuninori.morimoto.gx@renesas.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5693d50c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -353,5 +353,6 @@ int snd_soc_component_hw_free(struct snd_soc_component *component,
int snd_soc_component_trigger(struct snd_soc_component *component,
			      struct snd_pcm_substream *substream,
			      int cmd);
void snd_soc_component_suspend(struct snd_soc_component *component);

#endif /* __SOC_COMPONENT_H */
+7 −0
Original line number Diff line number Diff line
@@ -347,3 +347,10 @@ int snd_soc_component_trigger(struct snd_soc_component *component,

	return 0;
}

void snd_soc_component_suspend(struct snd_soc_component *component)
{
	if (component->driver->suspend)
		component->driver->suspend(component);
	component->suspended = 1;
}
+1 −3
Original line number Diff line number Diff line
@@ -520,9 +520,7 @@ int snd_soc_suspend(struct device *dev)
				/* fall through */

			case SND_SOC_BIAS_OFF:
				if (component->driver->suspend)
					component->driver->suspend(component);
				component->suspended = 1;
				snd_soc_component_suspend(component);
				if (component->regmap)
					regcache_mark_dirty(component->regmap);
				/* deactivate pins to sleep state */