aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBard Liao <bardliao@realtek.com>2017-06-28 03:38:02 -0400
committerMark Brown <broonie@kernel.org>2017-06-28 14:42:03 -0400
commit6c28ce3c425e32d372c7c6ee98d3c3711f13ad69 (patch)
tree3d89d5bd2d6b4dfe983cc7d96a9e203439b5697f
parent90384fcc054f701e17e9cbbff5c14db5f877c614 (diff)
ASoC: rt5670: move set_sysclk to codec level
Move set_sysclk to codec level and people can use it at both codec and dai level. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/rt5670.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c
index 1146a968cb4d..7fa63ad366dd 100644
--- a/sound/soc/codecs/rt5670.c
+++ b/sound/soc/codecs/rt5670.c
@@ -2442,10 +2442,9 @@ static int rt5670_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
2442 return 0; 2442 return 0;
2443} 2443}
2444 2444
2445static int rt5670_set_dai_sysclk(struct snd_soc_dai *dai, 2445static int rt5670_set_codec_sysclk(struct snd_soc_dai *dai, int clk_id,
2446 int clk_id, unsigned int freq, int dir) 2446 int source, unsigned int freq, int dir)
2447{ 2447{
2448 struct snd_soc_codec *codec = dai->codec;
2449 struct rt5670_priv *rt5670 = snd_soc_codec_get_drvdata(codec); 2448 struct rt5670_priv *rt5670 = snd_soc_codec_get_drvdata(codec);
2450 unsigned int reg_val = 0; 2449 unsigned int reg_val = 0;
2451 2450
@@ -2469,7 +2468,7 @@ static int rt5670_set_dai_sysclk(struct snd_soc_dai *dai,
2469 if (clk_id != RT5670_SCLK_S_RCCLK) 2468 if (clk_id != RT5670_SCLK_S_RCCLK)
2470 rt5670->sysclk_src = clk_id; 2469 rt5670->sysclk_src = clk_id;
2471 2470
2472 dev_dbg(dai->dev, "Sysclk is %dHz and clock id is %d\n", freq, clk_id); 2471 dev_dbg(codec->dev, "Sysclk : %dHz clock id : %d\n", freq, clk_id);
2473 2472
2474 return 0; 2473 return 0;
2475} 2474}
@@ -2721,7 +2720,6 @@ static int rt5670_resume(struct snd_soc_codec *codec)
2721static const struct snd_soc_dai_ops rt5670_aif_dai_ops = { 2720static const struct snd_soc_dai_ops rt5670_aif_dai_ops = {
2722 .hw_params = rt5670_hw_params, 2721 .hw_params = rt5670_hw_params,
2723 .set_fmt = rt5670_set_dai_fmt, 2722 .set_fmt = rt5670_set_dai_fmt,
2724 .set_sysclk = rt5670_set_dai_sysclk,
2725 .set_tdm_slot = rt5670_set_tdm_slot, 2723 .set_tdm_slot = rt5670_set_tdm_slot,
2726 .set_pll = rt5670_set_dai_pll, 2724 .set_pll = rt5670_set_dai_pll,
2727}; 2725};
@@ -2774,6 +2772,7 @@ static struct snd_soc_codec_driver soc_codec_dev_rt5670 = {
2774 .resume = rt5670_resume, 2772 .resume = rt5670_resume,
2775 .set_bias_level = rt5670_set_bias_level, 2773 .set_bias_level = rt5670_set_bias_level,
2776 .idle_bias_off = true, 2774 .idle_bias_off = true,
2775 .set_sysclk = rt5670_set_codec_sysclk,
2777 .component_driver = { 2776 .component_driver = {
2778 .controls = rt5670_snd_controls, 2777 .controls = rt5670_snd_controls,
2779 .num_controls = ARRAY_SIZE(rt5670_snd_controls), 2778 .num_controls = ARRAY_SIZE(rt5670_snd_controls),