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

Unverified Commit 9c0ac70a authored by Kai Chieh Chuang's avatar Kai Chieh Chuang Committed by Mark Brown
Browse files

ASoC: dpcm: fix BE dai not hw_free and shutdown



In case, one BE is used by two FE1/FE2
FE1--->BE-->
       |
FE2----]
when FE1/FE2 call dpcm_be_dai_hw_free() together
the BE users will be 2 (> 1), hence cannot be hw_free
the be state will leave at, ex. SND_SOC_DPCM_STATE_STOP

later FE1/FE2 call dpcm_be_dai_shutdown(),
will be skip due to wrong state.
leaving the BE not being hw_free and shutdown.

The BE dai will be hw_free later when calling
dpcm_be_dai_shutdown() if still in invalid state.

Signed-off-by: default avatarKaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6b116dfb
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -1866,8 +1866,10 @@ int dpcm_be_dai_shutdown(struct snd_soc_pcm_runtime *fe, int stream)
			continue;
			continue;


		if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) &&
		if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) &&
		    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN))
		    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN)) {
			continue;
			soc_pcm_hw_free(be_substream);
			be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE;
		}


		dev_dbg(be->dev, "ASoC: close BE %s\n",
		dev_dbg(be->dev, "ASoC: close BE %s\n",
			be->dai_link->name);
			be->dai_link->name);