From 6f0a3e6cb81c4802a08c36d73883830051086991 Mon Sep 17 00:00:00 2001 From: Sudheer Papothi Date: Fri, 5 Jun 2020 10:15:18 +0530 Subject: [PATCH] ASoC: swr-dmic: Add ignore suspend for dapm widgets Add ignore suspend for dapm widgets to avoid waking up the system during power collapse. Change-Id: I4eec9785f2e722d1fbcbf26c2635af9825b30115 Signed-off-by: Sudheer Papothi --- asoc/codecs/swr-dmic.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/asoc/codecs/swr-dmic.c b/asoc/codecs/swr-dmic.c index 4f5b23c2f2..c9d69f293a 100644 --- a/asoc/codecs/swr-dmic.c +++ b/asoc/codecs/swr-dmic.c @@ -325,11 +325,38 @@ static int swr_dmic_codec_probe(struct snd_soc_component *component) { struct swr_dmic_priv *swr_dmic = snd_soc_component_get_drvdata(component); + struct snd_soc_dapm_context *dapm = + snd_soc_component_get_dapm(component); + char w_name[100]; if (!swr_dmic) return -EINVAL; swr_dmic->component = component; + snd_soc_dapm_ignore_suspend(dapm, + swr_dmic->dai_driver->capture.stream_name); + memset(w_name, 0, 100); + strlcpy(w_name, component->name_prefix, 100); + strlcat(w_name, " SWR_DMIC", 100); + snd_soc_dapm_ignore_suspend(dapm, w_name); + + memset(w_name, 0, 100); + strlcpy(w_name, component->name_prefix, 100); + strlcat(w_name, " SMIC_SUPPLY", 100); + snd_soc_dapm_ignore_suspend(dapm, w_name); + + memset(w_name, 0, 100); + strlcpy(w_name, component->name_prefix, 100); + strlcat(w_name, " SMIC_PORT_EN", 100); + snd_soc_dapm_ignore_suspend(dapm, w_name); + + memset(w_name, 0, 100); + strlcpy(w_name, component->name_prefix, 100); + strlcat(w_name, " SWR_DMIC_OUTPUT", 100); + snd_soc_dapm_ignore_suspend(dapm, w_name); + + snd_soc_dapm_sync(dapm); + return 0; } @@ -624,6 +651,8 @@ static int swr_dmic_down(struct swr_device *pdev) return -EINVAL; } + dev_dbg(&pdev->dev, "%s: is_en_supply: %d\n", + __func__, swr_dmic->is_en_supply); --swr_dmic->is_en_supply; if (swr_dmic->is_en_supply < 0) { dev_warn(&pdev->dev, "%s: mismatch in supply count %d\n",