From eacb6f819459ef5adc83b09d354d150531a22204 Mon Sep 17 00:00:00 2001 From: Hyunwoong Kim Date: Tue, 18 Sep 2018 12:43:48 +0900 Subject: [PATCH] [9610] asoc: samsung: set ignore_suspend flag of UAIF/SIFS/amp dai Audio widgets on the path of CP Voice call were powered down when system was being suspended to RAM. Because the ignore_suspend flag of UAIF/SIFS/amp backend DAIs weren't set. Then ASoC layer tried to control the power state of those DAI widgets depending on PM state. This patch set ignore_suspend flag of the DAIs to prevent the widgets from being controlled by ASoC layer while system is being suspended. Change-Id: If7b3befd1d681af20a1ac225df74299d2f9324b8 Signed-off-by: Hyunwoong Kim --- sound/soc/samsung/exynos9610_madera.c | 45 ++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/sound/soc/samsung/exynos9610_madera.c b/sound/soc/samsung/exynos9610_madera.c index 820a7af8f05a..6dbb8a77bf98 100644 --- a/sound/soc/samsung/exynos9610_madera.c +++ b/sound/soc/samsung/exynos9610_madera.c @@ -42,6 +42,14 @@ #define MADERA_CODEC_MAX 10 #define MADERA_AUX_MAX 2 +#define RDMA_COUNT 8 +#define WDMA_COUNT 5 + +#define UAIF_START (RDMA_COUNT + WDMA_COUNT) +#define UAIF_COUNT 4 +#define SIFS_START (RDMA_COUNT + WDMA_COUNT + UAIF_COUNT + 2) +#define SIFS_COUNT 3 + static unsigned int baserate = MADERA_BASECLK_48K; enum FLL_ID { FLL1, FLL2, FLL3, FLLAO }; @@ -133,6 +141,9 @@ static struct snd_soc_pcm_runtime *madera_get_rtd(struct snd_soc_card *card, } } + if (!rtd) + rtd = snd_soc_get_pcm_runtime(card, card->dai_link[id].name); + return rtd; } @@ -619,7 +630,10 @@ static int exynos9610_late_probe(struct snd_soc_card *card) struct snd_soc_dai *aif_dai; struct snd_soc_codec *codec; struct snd_soc_component *cpu; - int ret; + struct snd_soc_dapm_context *dapm; + char name[SZ_32]; + const char *prefix; + int ret, i; aif_dai = madera_get_rtd(card, 0)->cpu_dai; cpu = aif_dai->component; @@ -664,6 +678,8 @@ static int exynos9610_late_probe(struct snd_soc_card *card) snd_soc_dapm_ignore_suspend(&card->dapm, "VOUTPUT"); snd_soc_dapm_ignore_suspend(&card->dapm, "VINPUT1"); snd_soc_dapm_ignore_suspend(&card->dapm, "VINPUT2"); + snd_soc_dapm_ignore_suspend(&card->dapm, "VOUTPUTCALL"); + snd_soc_dapm_ignore_suspend(&card->dapm, "VINPUTCALL"); snd_soc_dapm_ignore_suspend(&card->dapm, "HEADSETMIC"); snd_soc_dapm_ignore_suspend(&card->dapm, "RECEIVER"); snd_soc_dapm_ignore_suspend(&card->dapm, "HEADPHONE"); @@ -676,6 +692,7 @@ static int exynos9610_late_probe(struct snd_soc_card *card) snd_soc_dapm_ignore_suspend(snd_soc_codec_get_dapm(codec), "AIF1 Playback"); snd_soc_dapm_ignore_suspend(snd_soc_codec_get_dapm(codec), "AIF1 Capture"); + snd_soc_dapm_ignore_suspend(snd_soc_codec_get_dapm(codec), "AIF3 Capture"); snd_soc_dapm_sync(snd_soc_codec_get_dapm(codec)); snd_soc_dapm_ignore_suspend(snd_soc_component_get_dapm(cpu), "ABOX RDMA0 Playback"); @@ -693,6 +710,30 @@ static int exynos9610_late_probe(struct snd_soc_card *card) snd_soc_dapm_ignore_suspend(snd_soc_component_get_dapm(cpu), "ABOX WDMA4 Capture"); snd_soc_dapm_sync(snd_soc_component_get_dapm(cpu)); + for (i = 0; i < UAIF_COUNT; i++) { + aif_dai = madera_get_rtd(card, UAIF_START + i)->cpu_dai; + cpu = aif_dai->component; + dapm = snd_soc_component_get_dapm(cpu); + prefix = dapm->component->name_prefix; + snprintf(name, sizeof(name), "%s UAIF%d Capture", prefix, i); + snd_soc_dapm_ignore_suspend(dapm, name); + snprintf(name, sizeof(name), "%s UAIF%d Playback", prefix, i); + snd_soc_dapm_ignore_suspend(dapm, name); + snd_soc_dapm_sync(dapm); + } + + for (i = 0; i < SIFS_COUNT; i++) { + aif_dai = madera_get_rtd(card, SIFS_START + i)->cpu_dai; + cpu = aif_dai->component; + dapm = snd_soc_component_get_dapm(cpu); + prefix = dapm->component->name_prefix; + snprintf(name, sizeof(name), "%s SIFS%d Capture", prefix, i); + snd_soc_dapm_ignore_suspend(dapm, name); + snprintf(name, sizeof(name), "%s SIFS%d Playback", prefix, i); + snd_soc_dapm_ignore_suspend(dapm, name); + snd_soc_dapm_sync(dapm); + } + madera_init_debugfs(card); #if IS_ENABLED(CONFIG_SND_SOC_MADERA) @@ -1004,6 +1045,8 @@ static struct snd_soc_dai_link exynos9610_dai[] = { }, { .name = "codec-left-amp", + .ignore_suspend = 1, + .ignore_pmdown_time = 1, .params = madera_amp_params, }, -- 2.20.1