From 066f5e4cf411186acfbf37097b8dd60decc6f9ba Mon Sep 17 00:00:00 2001 From: Sudheer Papothi Date: Wed, 29 May 2019 04:24:56 +0530 Subject: [PATCH] ANDROID: GKI: ASoC: dapm: Avoid static route b/w cpu and codec dai Currently ASoC core creates a static route b/w playback/capture widgets of cpu and codec dai if they are part of the same dai-link. However this will cause codec path to get powered up followed by the backend dai start during device switch use-case where the front-end is not closed, leading to audio playback failure if either bit-width or sample rate is different. Test: build Bug: 151372815 Change-Id: Icd17677a73fdc4bd30e0918fcaa7e7f394245685 Signed-off-by: Sudheer Papothi (cherry picked from commit 85a57fb9237c4021150e3a3ba9a274a7b78b79a5) Signed-off-by: Hridya Valsaraju --- include/sound/soc.h | 3 +++ sound/soc/soc-dapm.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index b62ca5e46cff..b6a504e07309 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -981,6 +981,9 @@ struct snd_soc_dai_link { /* This DAI link can route to other DAI links at runtime (Frontend)*/ unsigned int dynamic:1; + /* This DAI link can be reconfigured at runtime (Backend) */ + unsigned int dynamic_be:1; + /* * This DAI can support no host IO (no pcm data is * copied to from host) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index db5b005f4b1e..39f75a802374 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -4227,7 +4227,8 @@ void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card) * dynamic FE links have no fixed DAI mapping. * CODEC<->CODEC links have no direct connection. */ - if (rtd->dai_link->dynamic || rtd->dai_link->params) + if (rtd->dai_link->dynamic || rtd->dai_link->params || + rtd->dai_link->dynamic_be) continue; dapm_connect_dai_link_widgets(card, rtd);