ASoC: pcm: allow backend hardware to be freed in pause state

When front-end PCM session is in paused state, back-end PCM
session will be put in paused state as well if given front-end
PCM session is the only client of the given back-end. Then,
even though the application closes front-end PCM session, DPCM
framework will not allow back-end to enter into HW_FREE state,
and hence back-end will never get shutdown completely.

(cherry picked from commit 6479fa2d82c5fa8b756a4755bc84e2ce48dad850)
CRs-fixed: 411089
CRs-fixed: 409894
Signed-off-by: Banajit Goswami <bgoswa@codeaurora.org>

Change-Id: I4d4f856a0401ff96cef98d374c1d12b10e124528
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 121ac0b..73bb10a 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1498,10 +1498,6 @@
 	struct snd_soc_dpcm_params *dpcm_params;
 	int ret = 0;
 
-	if ((cmd == SNDRV_PCM_TRIGGER_PAUSE_RELEASE) ||
-				(cmd == SNDRV_PCM_TRIGGER_PAUSE_PUSH))
-		return ret;
-
 	list_for_each_entry(dpcm_params, &fe->dpcm[stream].be_clients, list_be) {
 
 		struct snd_soc_pcm_runtime *be = dpcm_params->be;
@@ -1769,6 +1765,7 @@
 		if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) &&
 		    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) &&
 			(be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) &&
+			(be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED) &&
 		    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP))
 			continue;