summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBhalchandra Gajare <gajare@codeaurora.org>2016-12-06 17:30:36 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-12-06 19:04:24 -0800
commit224cef96887dbadb06347502c82e35cbd55a24d1 (patch)
treeee51679472b4d90731879d5f2d10fd4c02ad76ed
parent5f30ee1cc59c837f11081e71a4bd2a3910a86d13 (diff)
ASoC: wcd934x-dsp-cntl: fix the reset sequence
Currently, whenever the codec DSP is reset, the CPAR hardware block is not reset. This causes failure to boot DSP in good state. Update CPAR reset sequence to ensure CPAR is put to reset when not in use. CRs-fixed: 1091032 Change-Id: I77fea396fda6ee0eaaf0c68b11cf90f268ac1481 Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
-rw-r--r--sound/soc/codecs/wcd934x/wcd934x-dsp-cntl.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/codecs/wcd934x/wcd934x-dsp-cntl.c b/sound/soc/codecs/wcd934x/wcd934x-dsp-cntl.c
index 9898c1fc7471..aa180fa3159f 100644
--- a/sound/soc/codecs/wcd934x/wcd934x-dsp-cntl.c
+++ b/sound/soc/codecs/wcd934x/wcd934x-dsp-cntl.c
@@ -401,6 +401,8 @@ static int wcd_cntl_clocks_enable(struct wcd_dsp_cntl *cntl)
__func__, ret);
goto done;
}
+ /* Pull CPAR out of reset */
+ snd_soc_update_bits(codec, WCD934X_CPE_SS_CPAR_CTL, 0x04, 0x00);
/* Configure and Enable CPE FLL clock */
ret = wcd_cntl_cpe_fll_ctrl(cntl, true);
@@ -422,6 +424,7 @@ err_cpe_clk:
if (cntl->cdc_cb && cntl->cdc_cb->cdc_clk_en)
cntl->cdc_cb->cdc_clk_en(codec, false);
+ snd_soc_update_bits(codec, WCD934X_CPE_SS_CPAR_CTL, 0x04, 0x04);
WCD_CNTL_MUTEX_UNLOCK(codec, cntl->clk_mutex);
return ret;
}
@@ -458,6 +461,9 @@ static int wcd_cntl_clocks_disable(struct wcd_dsp_cntl *cntl)
ret = -EINVAL;
cntl->is_clk_enabled = false;
+
+ /* Put CPAR in reset */
+ snd_soc_update_bits(codec, WCD934X_CPE_SS_CPAR_CTL, 0x04, 0x04);
done:
WCD_CNTL_MUTEX_UNLOCK(codec, cntl->clk_mutex);
return ret;
@@ -469,9 +475,9 @@ static void wcd_cntl_cpar_ctrl(struct wcd_dsp_cntl *cntl,
struct snd_soc_codec *codec = cntl->codec;
if (enable)
- snd_soc_write(codec, WCD934X_CPE_SS_CPAR_CTL, 0x03);
+ snd_soc_update_bits(codec, WCD934X_CPE_SS_CPAR_CTL, 0x03, 0x03);
else
- snd_soc_write(codec, WCD934X_CPE_SS_CPAR_CTL, 0x00);
+ snd_soc_update_bits(codec, WCD934X_CPE_SS_CPAR_CTL, 0x03, 0x00);
}
static int wcd_cntl_enable_memory(struct wcd_dsp_cntl *cntl,