aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBard Liao <bardliao@realtek.com>2017-10-16 07:15:16 -0400
committerMark Brown <broonie@kernel.org>2017-10-18 06:41:05 -0400
commitc8a04b5de4bbdd0c7553aaa315c72722b10f0207 (patch)
tree4fff0e4099a39a00fe43058eeb7d3d082e089203
parentfe01e5e8fae91b235ecf928f6bf0a90c17d74e36 (diff)
ASoC: rt5659: move set_pll to codec level
Move set_pll function 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/rt5659.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c
index 09cfddb5e53d..07e7757417bc 100644
--- a/sound/soc/codecs/rt5659.c
+++ b/sound/soc/codecs/rt5659.c
@@ -3419,15 +3419,15 @@ static int rt5659_set_codec_sysclk(struct snd_soc_codec *codec, int clk_id,
3419 return 0; 3419 return 0;
3420} 3420}
3421 3421
3422static int rt5659_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int Source, 3422static int rt5659_set_codec_pll(struct snd_soc_codec *codec, int pll_id,
3423 unsigned int freq_in, unsigned int freq_out) 3423 int source, unsigned int freq_in,
3424 unsigned int freq_out)
3424{ 3425{
3425 struct snd_soc_codec *codec = dai->codec;
3426 struct rt5659_priv *rt5659 = snd_soc_codec_get_drvdata(codec); 3426 struct rt5659_priv *rt5659 = snd_soc_codec_get_drvdata(codec);
3427 struct rl6231_pll_code pll_code; 3427 struct rl6231_pll_code pll_code;
3428 int ret; 3428 int ret;
3429 3429
3430 if (Source == rt5659->pll_src && freq_in == rt5659->pll_in && 3430 if (source == rt5659->pll_src && freq_in == rt5659->pll_in &&
3431 freq_out == rt5659->pll_out) 3431 freq_out == rt5659->pll_out)
3432 return 0; 3432 return 0;
3433 3433
@@ -3441,7 +3441,7 @@ static int rt5659_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int Source,
3441 return 0; 3441 return 0;
3442 } 3442 }
3443 3443
3444 switch (Source) { 3444 switch (source) {
3445 case RT5659_PLL1_S_MCLK: 3445 case RT5659_PLL1_S_MCLK:
3446 snd_soc_update_bits(codec, RT5659_GLB_CLK, 3446 snd_soc_update_bits(codec, RT5659_GLB_CLK,
3447 RT5659_PLL1_SRC_MASK, RT5659_PLL1_SRC_MCLK); 3447 RT5659_PLL1_SRC_MASK, RT5659_PLL1_SRC_MCLK);
@@ -3459,7 +3459,7 @@ static int rt5659_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int Source,
3459 RT5659_PLL1_SRC_MASK, RT5659_PLL1_SRC_BCLK3); 3459 RT5659_PLL1_SRC_MASK, RT5659_PLL1_SRC_BCLK3);
3460 break; 3460 break;
3461 default: 3461 default:
3462 dev_err(codec->dev, "Unknown PLL Source %d\n", Source); 3462 dev_err(codec->dev, "Unknown PLL source %d\n", source);
3463 return -EINVAL; 3463 return -EINVAL;
3464 } 3464 }
3465 3465
@@ -3481,7 +3481,7 @@ static int rt5659_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int Source,
3481 3481
3482 rt5659->pll_in = freq_in; 3482 rt5659->pll_in = freq_in;
3483 rt5659->pll_out = freq_out; 3483 rt5659->pll_out = freq_out;
3484 rt5659->pll_src = Source; 3484 rt5659->pll_src = source;
3485 3485
3486 return 0; 3486 return 0;
3487} 3487}
@@ -3667,7 +3667,6 @@ static const struct snd_soc_dai_ops rt5659_aif_dai_ops = {
3667 .hw_params = rt5659_hw_params, 3667 .hw_params = rt5659_hw_params,
3668 .set_fmt = rt5659_set_dai_fmt, 3668 .set_fmt = rt5659_set_dai_fmt,
3669 .set_tdm_slot = rt5659_set_tdm_slot, 3669 .set_tdm_slot = rt5659_set_tdm_slot,
3670 .set_pll = rt5659_set_dai_pll,
3671 .set_bclk_ratio = rt5659_set_bclk_ratio, 3670 .set_bclk_ratio = rt5659_set_bclk_ratio,
3672}; 3671};
3673 3672
@@ -3747,6 +3746,7 @@ static const struct snd_soc_codec_driver soc_codec_dev_rt5659 = {
3747 .num_dapm_routes = ARRAY_SIZE(rt5659_dapm_routes), 3746 .num_dapm_routes = ARRAY_SIZE(rt5659_dapm_routes),
3748 }, 3747 },
3749 .set_sysclk = rt5659_set_codec_sysclk, 3748 .set_sysclk = rt5659_set_codec_sysclk,
3749 .set_pll = rt5659_set_codec_pll,
3750}; 3750};
3751 3751
3752 3752