aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoro Chen <koro.chen@mediatek.com>2015-11-10 02:26:12 -0500
committerMark Brown <broonie@kernel.org>2015-11-17 13:54:29 -0500
commitb45e68df065a9babc43b4b7cd223c412d34b6658 (patch)
tree69da7d5581fdfb98d92e395da63bc24e6d49cd6a
parent8005c49d9aea74d382f474ce11afbbc7d7130bec (diff)
ASoC: mediatek: Move 22M/24M clock control into I2S ops
22M/24M clocks are only required for I2S, so move the control to I2S DAI ops. Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/mediatek/mtk-afe-pcm.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sound/soc/mediatek/mtk-afe-pcm.c b/sound/soc/mediatek/mtk-afe-pcm.c
index f5baf3c38863..7f7134397f73 100644
--- a/sound/soc/mediatek/mtk-afe-pcm.c
+++ b/sound/soc/mediatek/mtk-afe-pcm.c
@@ -299,8 +299,6 @@ static int mtk_afe_dais_enable_clks(struct mtk_afe *afe,
299 dev_err(afe->dev, "Failed to enable m_ck\n"); 299 dev_err(afe->dev, "Failed to enable m_ck\n");
300 return ret; 300 return ret;
301 } 301 }
302 regmap_update_bits(afe->regmap, AUDIO_TOP_CON0,
303 AUD_TCON0_PDN_22M | AUD_TCON0_PDN_24M, 0);
304 } 302 }
305 303
306 if (b_ck) { 304 if (b_ck) {
@@ -340,12 +338,8 @@ static int mtk_afe_dais_set_clks(struct mtk_afe *afe,
340static void mtk_afe_dais_disable_clks(struct mtk_afe *afe, 338static void mtk_afe_dais_disable_clks(struct mtk_afe *afe,
341 struct clk *m_ck, struct clk *b_ck) 339 struct clk *m_ck, struct clk *b_ck)
342{ 340{
343 if (m_ck) { 341 if (m_ck)
344 regmap_update_bits(afe->regmap, AUDIO_TOP_CON0,
345 AUD_TCON0_PDN_22M | AUD_TCON0_PDN_24M,
346 AUD_TCON0_PDN_22M | AUD_TCON0_PDN_24M);
347 clk_disable_unprepare(m_ck); 342 clk_disable_unprepare(m_ck);
348 }
349 if (b_ck) 343 if (b_ck)
350 clk_disable_unprepare(b_ck); 344 clk_disable_unprepare(b_ck);
351} 345}
@@ -360,6 +354,8 @@ static int mtk_afe_i2s_startup(struct snd_pcm_substream *substream,
360 return 0; 354 return 0;
361 355
362 mtk_afe_dais_enable_clks(afe, afe->clocks[MTK_CLK_I2S1_M], NULL); 356 mtk_afe_dais_enable_clks(afe, afe->clocks[MTK_CLK_I2S1_M], NULL);
357 regmap_update_bits(afe->regmap, AUDIO_TOP_CON0,
358 AUD_TCON0_PDN_22M | AUD_TCON0_PDN_24M, 0);
363 return 0; 359 return 0;
364} 360}
365 361
@@ -373,6 +369,9 @@ static void mtk_afe_i2s_shutdown(struct snd_pcm_substream *substream,
373 return; 369 return;
374 370
375 mtk_afe_set_i2s_enable(afe, false); 371 mtk_afe_set_i2s_enable(afe, false);
372 regmap_update_bits(afe->regmap, AUDIO_TOP_CON0,
373 AUD_TCON0_PDN_22M | AUD_TCON0_PDN_24M,
374 AUD_TCON0_PDN_22M | AUD_TCON0_PDN_24M);
376 mtk_afe_dais_disable_clks(afe, afe->clocks[MTK_CLK_I2S1_M], NULL); 375 mtk_afe_dais_disable_clks(afe, afe->clocks[MTK_CLK_I2S1_M], NULL);
377 376
378 /* disable AFE */ 377 /* disable AFE */