Unverified Commit 30876e2a authored by Bard Liao's avatar Bard Liao Committed by Mark Brown
Browse files

ASoC: SOF: Filter out unneeded core power up/downs



Exclude cores that are already powered on/off correctly. This allows to
simplify dsp_power_up/down() implementations and avoid unexpected error.

Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210128093850.1041387-5-kai.vehmanen@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 42077f08
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -78,7 +78,8 @@ static inline int snd_sof_dsp_core_power_up(struct snd_sof_dev *sdev,
{
	int ret = 0;

	if (sof_ops(sdev)->core_power_up) {
	core_mask &= ~sdev->enabled_cores_mask;
	if (sof_ops(sdev)->core_power_up && core_mask) {
		ret = sof_ops(sdev)->core_power_up(sdev, core_mask);
		if (!ret)
			sdev->enabled_cores_mask |= core_mask;
@@ -92,7 +93,8 @@ static inline int snd_sof_dsp_core_power_down(struct snd_sof_dev *sdev,
{
	int ret = 0;

	if (sof_ops(sdev)->core_power_down) {
	core_mask &= sdev->enabled_cores_mask;
	if (sof_ops(sdev)->core_power_down && core_mask) {
		ret = sof_ops(sdev)->core_power_down(sdev, core_mask);
		if (!ret)
			sdev->enabled_cores_mask &= ~core_mask;