From: Chuansheng Liu <chuansheng.liu@intel.com>
To: broonie@opensource.wolfsonmicro.com
Cc: lrg@ti.com, perex@perex.cz, tiwai@suse.de,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
chuansheng.liu@intel.com
Subject: [PATCH] ASoC: core: giving WARN when device starting from non-off bias with idle_bias_off
Date: Fri, 21 Dec 2012 18:17:12 +0800 [thread overview]
Message-ID: <1356085032.1839.14.camel@cliu38-desktop-build> (raw)
In-Reply-To: <1355913397.17896.10.camel@cliu38-desktop-build>
Just found some cases that some codec drivers set the bias to _STANDBY and
set idle_bias_off to 1 during probing.
It will cause unpaired runtime_get_sync/put() issue. Also as Mark suggested,
there is no reason to start from _STANDBY bias with idle_bias_off == 1.
So here giving one warning when detected (dapm.idle_bias_off == 1) and
(dapm.bias_level != SND_SOC_BIAS_OFF) just after driver->probe().
Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
---
sound/soc/soc-core.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 9c768bc..d7ec007 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1107,6 +1107,10 @@ static int soc_probe_codec(struct snd_soc_card *card,
"ASoC: failed to probe CODEC %d\n", ret);
goto err_probe;
}
+ WARN(codec->dapm.idle_bias_off &&
+ codec->dapm.bias_level != SND_SOC_BIAS_OFF,
+ "codec %s can not start from non-off bias"
+ " with idle_bias_off==1\n", codec->name);
}
/* If the driver didn't set I/O up try regmap */
--
1.7.0.4
next prev parent reply other threads:[~2012-12-21 10:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-19 10:36 [PATCH] ASoC: dapm: Fix the unpaired runtime_get/put cases Chuansheng Liu
2012-12-19 9:11 ` Mark Brown
2012-12-20 6:37 ` Liu, Chuansheng
2012-12-20 13:51 ` Mark Brown
2012-12-21 1:34 ` Liu, Chuansheng
2012-12-21 10:17 ` Chuansheng Liu [this message]
2012-12-24 15:35 ` [PATCH] ASoC: core: giving WARN when device starting from non-off bias with idle_bias_off Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1356085032.1839.14.camel@cliu38-desktop-build \
--to=chuansheng.liu@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).