summaryrefslogtreecommitdiff
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMohan Kumar <mkumard@nvidia.com>2013-11-28 13:18:59 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2013-12-23 10:45:46 -0800
commit44e7ca00933348084d2aecc8e40decfc72f703ad (patch)
treecf4abf289139479cad26f761931530786ee38552 /sound/soc/soc-dapm.c
parent2df6487fd8996695ce0a22644961bdc89e9e2c9d (diff)
sound: soc: fix codec refcount issue
warn_on message is shown for rt5639 dev when usage count for it goes negative, so if any case the refcount count goes negative we will see the warn_on message on particular dev, this change will increment the usage count when the dev changes from SND_SOC_BIAS_OFF to SND_SOC_BIAS_STANDBY or during LP0 were the resume will set the bias to SND_SOC_BIAS_STANDBY, so need to increment refcount based on it. Bug 1410313 Change-Id: Ie2326cffe406d1a3d61905ecba1437445cd350ad Signed-off-by: Mohan Kumar <mkumard@nvidia.com> Reviewed-on: http://git-master/r/336540 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index d0fa14c5ae2d..6af8fa3daa0e 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1491,12 +1491,17 @@ static void dapm_pre_sequence_async(void *data, async_cookie_t cookie)
struct snd_soc_dapm_context *d = data;
int ret;
- /* If we're off and we're not supposed to be go into STANDBY */
- if (d->bias_level == SND_SOC_BIAS_OFF &&
- d->target_bias_level != SND_SOC_BIAS_OFF) {
+ if ((d->bias_level == SND_SOC_BIAS_OFF &&
+ d->target_bias_level != SND_SOC_BIAS_OFF) ||
+ (d->bias_level == SND_SOC_BIAS_STANDBY &&
+ d->target_bias_level == SND_SOC_BIAS_OFF)) {
if (d->dev)
pm_runtime_get_sync(d->dev);
+ }
+ /* If we're off and we're not supposed to be go into STANDBY */
+ if (d->bias_level == SND_SOC_BIAS_OFF &&
+ d->target_bias_level != SND_SOC_BIAS_OFF) {
ret = snd_soc_dapm_set_bias_level(d, SND_SOC_BIAS_STANDBY);
if (ret != 0)
dev_err(d->dev,