summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhani Kumar Uppalapati <phaniu@codeaurora.org>2016-10-20 11:23:53 -0700
committerPhani Kumar Uppalapati <phaniu@codeaurora.org>2016-10-20 11:24:33 -0700
commitece0ce10f6417fe53a7438ac98eec1d41771255b (patch)
tree0399e3f92022a9ec5d2fb20d7bbabe718508499b
parent1ff56658f3493b9e56cb30d1ddcd7e6646d14c85 (diff)
ASoC: wcd934X: Update TX gain correctly after decimator enable
Gain for TX decimator block needs to be set after the corresponding decimator is enabled. Otherwise, gain will not take affect. Apply the gain by reading from regmap cache to the codec decimator hardware after decimator is enabled. CRs-Fixed: 1079227 Change-Id: If56c84007f4dae2ff8f424b576756ee5906c24d4 Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
-rw-r--r--sound/soc/codecs/wcd934x/wcd934x.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/codecs/wcd934x/wcd934x.c b/sound/soc/codecs/wcd934x/wcd934x.c
index 30c23df444d6..4da24a8bfb80 100644
--- a/sound/soc/codecs/wcd934x/wcd934x.c
+++ b/sound/soc/codecs/wcd934x/wcd934x.c
@@ -3658,6 +3658,7 @@ static int tavil_codec_enable_dec(struct snd_soc_dapm_widget *w,
char *wname;
int ret = 0, amic_n;
u16 tx_vol_ctl_reg, pwr_level_reg = 0, dec_cfg_reg, hpf_gate_reg;
+ u16 tx_gain_ctl_reg;
char *dec;
u8 hpf_cut_off_freq;
@@ -3699,6 +3700,7 @@ static int tavil_codec_enable_dec(struct snd_soc_dapm_widget *w,
tx_vol_ctl_reg = WCD934X_CDC_TX0_TX_PATH_CTL + 16 * decimator;
hpf_gate_reg = WCD934X_CDC_TX0_TX_PATH_SEC2 + 16 * decimator;
dec_cfg_reg = WCD934X_CDC_TX0_TX_PATH_CFG0 + 16 * decimator;
+ tx_gain_ctl_reg = WCD934X_CDC_TX0_TX_VOL_CTL + 16 * decimator;
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
@@ -3752,7 +3754,9 @@ static int tavil_codec_enable_dec(struct snd_soc_dapm_widget *w,
schedule_delayed_work(
&tavil->tx_hpf_work[decimator].dwork,
msecs_to_jiffies(300));
-
+ /* apply gain after decimator is enabled */
+ snd_soc_write(codec, tx_gain_ctl_reg,
+ snd_soc_read(codec, tx_gain_ctl_reg));
break;
case SND_SOC_DAPM_PRE_PMD:
hpf_cut_off_freq =