[alsa-devel] [PATCH] ASoC: core: Set dapm->idle_bias_off for DAIs not mapped with a codec

Peter Ujfalusi peter.ujfalusi at ti.com
Tue Aug 7 09:24:13 CEST 2012


The idle_bias_off flag is not configured for DAIs not mapped with a codec.
This causes the pm counter to be increased at probe time for the CPU dai
which unbalances the pm counter handling.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
---

Hello Mark,

I'm not sure if this is the correct way to fix the problem but this patch works
for me.

The issue in short:
Since commit: '18d7564 ASoC: when removing a CPU DAI, clean up its DAPM context'
After booting up the kernel on BeagleBoard for example I see that the clocks are
enabled for the McBSP CPU dai. This alone causing the first stream start to fail
due to unbalanced pm_runtime counter. Later it stabilizes, but I see failures
with full duplex operation (arecord | aplay).
The root cause of this is not commit 18d7564, but the fact that we did not
configured the dapm->idle_bias_off for the CPU dai to be 1 (we do this for the
platform driver). The pm_runtime_get_sync is called from
dapm_pre_sequence_async() - since we add the cpu_dai dapm context to the list.

With this patch we set the dapm->idle_bias_off for DAIs not linked with a codec
which means cpu_dais.
If this is not acceptable we need to set this flag in the cpu_dai driver itself.

Regards,
Peter

 sound/soc/soc-core.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f81c597..f10f00b 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3715,6 +3715,9 @@ int snd_soc_register_dai(struct device *dev,
 		}
 	}
 
+	if (!dai->codec)
+		dai->dapm.idle_bias_off = 1;
+
 	list_add(&dai->list, &dai_list);
 
 	mutex_unlock(&client_mutex);
@@ -3803,6 +3806,9 @@ int snd_soc_register_dais(struct device *dev,
 			}
 		}
 
+		if (!dai->codec)
+			dai->dapm.idle_bias_off = 1;
+
 		list_add(&dai->list, &dai_list);
 
 		mutex_unlock(&client_mutex);
-- 
1.7.8.6



More information about the Alsa-devel mailing list