summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhani Kumar Uppalapati <phaniu@codeaurora.org>2016-08-30 16:55:41 -0700
committerPhani Kumar Uppalapati <phaniu@codeaurora.org>2016-08-30 23:16:05 -0700
commit57db88635940aeac11a98f44ca529f668f33396b (patch)
tree37cc94afae6130e397a1f3977bc1e59d3ffb016e
parentab26d098793adbf90b77d414663e34ac0c7315f6 (diff)
ASoC: wcd934x: Update codec master clock configuration
Update wcd934x codec master clock configuration to 9.6MHz or 12.288MHz based on the device tree setting. This is done during early codec initialization to prevent artifacts when audio path is enabled. CRs-fixed: 1061430 Change-Id: Ic983a524b6fa5bb079c6e61b8fe729974de78eea Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
-rw-r--r--sound/soc/codecs/wcd934x/wcd934x.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sound/soc/codecs/wcd934x/wcd934x.c b/sound/soc/codecs/wcd934x/wcd934x.c
index 50a023013fa8..05899d204c3b 100644
--- a/sound/soc/codecs/wcd934x/wcd934x.c
+++ b/sound/soc/codecs/wcd934x/wcd934x.c
@@ -6816,14 +6816,6 @@ static int tavil_soc_codec_probe(struct snd_soc_codec *codec)
for (i = 0; i < COMPANDER_MAX; i++)
tavil->comp_enabled[i] = 0;
- dev_dbg(codec->dev, "%s: MCLK Rate = %x\n", __func__,
- control->mclk_rate);
- if (control->mclk_rate == WCD934X_MCLK_CLK_12P288MHZ)
- snd_soc_update_bits(codec, WCD934X_CODEC_RPM_CLK_MCLK_CFG,
- 0x03, 0x00);
- else if (control->mclk_rate == WCD934X_MCLK_CLK_9P6MHZ)
- snd_soc_update_bits(codec, WCD934X_CODEC_RPM_CLK_MCLK_CFG,
- 0x03, 0x01);
tavil_codec_init_reg(codec);
tavil_enable_sido_buck(codec);
@@ -7480,6 +7472,16 @@ static int tavil_probe(struct platform_device *pdev)
tavil->wcd_ext_clk = wcd_ext_clk;
set_bit(AUDIO_NOMINAL, &tavil->status_mask);
/* Update codec register default values */
+ dev_dbg(&pdev->dev, "%s: MCLK Rate = %x\n", __func__,
+ tavil->wcd9xxx->mclk_rate);
+ if (tavil->wcd9xxx->mclk_rate == WCD934X_MCLK_CLK_12P288MHZ)
+ regmap_update_bits(tavil->wcd9xxx->regmap,
+ WCD934X_CODEC_RPM_CLK_MCLK_CFG,
+ 0x03, 0x00);
+ else if (tavil->wcd9xxx->mclk_rate == WCD934X_MCLK_CLK_9P6MHZ)
+ regmap_update_bits(tavil->wcd9xxx->regmap,
+ WCD934X_CODEC_RPM_CLK_MCLK_CFG,
+ 0x03, 0x01);
tavil_update_reg_defaults(tavil);
__tavil_enable_efuse_sensing(tavil);