diff options
| author | Sudheer Papothi <spapothi@codeaurora.org> | 2015-11-25 06:55:30 +0530 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:12:55 -0700 |
| commit | 38afeba1a676b4f8cddd4a4ae0d3cb85ec489cf2 (patch) | |
| tree | e70f2ba8a71e85b189b6e20656b948bbb6249477 | |
| parent | 7f81f92c5a8a82f04f1ee1b9dd31d671f8836465 (diff) | |
ASoC: wcd9335: Increase slimbus clock gear during device path bringup
Increase slimbus clock gear during device path bringup for faster
execution of register read and writes. This will improve the
latency during device path bringup.
Change-Id: I3118eecde7dd8e90fff05a6e0c6efa4052013a44
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
| -rwxr-xr-x | sound/soc/codecs/wcd9335.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c index 7c417daa3416..e35b27e11683 100755 --- a/sound/soc/codecs/wcd9335.c +++ b/sound/soc/codecs/wcd9335.c @@ -338,6 +338,7 @@ enum { AUDIO_NOMINAL, CPE_NOMINAL, HPH_PA_DELAY, + SB_CLK_GEAR, }; enum { @@ -771,6 +772,9 @@ struct tasha_priv { int hph_r_gain; }; +static int tasha_codec_vote_max_bw(struct snd_soc_codec *codec, + bool vote); + static const struct tasha_reg_mask_val tasha_spkr_default[] = { {WCD9335_CDC_COMPANDER7_CTL3, 0x80, 0x80}, {WCD9335_CDC_COMPANDER8_CTL3, 0x80, 0x80}, @@ -4775,6 +4779,10 @@ static int tasha_codec_enable_interpolator(struct snd_soc_dapm_widget *w, switch (event) { case SND_SOC_DAPM_PRE_PMU: + if (!test_bit(SB_CLK_GEAR, &tasha->status_mask)) { + tasha_codec_vote_max_bw(codec, true); + set_bit(SB_CLK_GEAR, &tasha->status_mask); + } /* Reset if needed */ tasha_codec_enable_prim_interpolator(codec, reg, event); break; @@ -10332,6 +10340,21 @@ prim_rate: return ret; } +static int tasha_prepare(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct tasha_priv *tasha = snd_soc_codec_get_drvdata(dai->codec); + + pr_debug("%s(): substream = %s stream = %d\n" , __func__, + substream->name, substream->stream); + if ((substream->stream == SNDRV_PCM_STREAM_PLAYBACK) && + test_bit(SB_CLK_GEAR, &tasha->status_mask)) { + tasha_codec_vote_max_bw(dai->codec, false); + clear_bit(SB_CLK_GEAR, &tasha->status_mask); + } + return 0; +} + static int tasha_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) @@ -10543,6 +10566,7 @@ static struct snd_soc_dai_ops tasha_dai_ops = { .startup = tasha_startup, .shutdown = tasha_shutdown, .hw_params = tasha_hw_params, + .prepare = tasha_prepare, .set_sysclk = tasha_set_dai_sysclk, .set_fmt = tasha_set_dai_fmt, .set_channel_map = tasha_set_channel_map, @@ -10792,6 +10816,7 @@ static int tasha_dig_core_remove_power_collapse(struct snd_soc_codec *codec) { struct tasha_priv *tasha = snd_soc_codec_get_drvdata(codec); + tasha_codec_vote_max_bw(codec, true); snd_soc_write(codec, WCD9335_CODEC_RPM_PWR_CDC_DIG_HM_CTL, 0x5); snd_soc_write(codec, WCD9335_CODEC_RPM_PWR_CDC_DIG_HM_CTL, 0x7); snd_soc_write(codec, WCD9335_CODEC_RPM_PWR_CDC_DIG_HM_CTL, 0x3); @@ -10804,6 +10829,7 @@ static int tasha_dig_core_remove_power_collapse(struct snd_soc_codec *codec) regcache_mark_dirty(codec->component.regmap); regcache_sync_region(codec->component.regmap, TASHA_DIG_CORE_REG_MIN, TASHA_DIG_CORE_REG_MAX); + tasha_codec_vote_max_bw(codec, false); return 0; } |
