summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt5645.c
diff options
context:
space:
mode:
authorOder Chiou <oder_chiou@realtek.com>2014-05-20 15:01:55 +0800
committerMark Brown <broonie@linaro.org>2014-06-01 20:04:30 +0100
commitd92950e755328a0293af66e18096e0cae29996f1 (patch)
treef4f5a06ad7856bb3d34cb80663c2f3183a87359e /sound/soc/codecs/rt5645.c
parent71c7a2d675c8fe9b6ab284dcf586f30a7109c96c (diff)
downloadblackbird-op-linux-d92950e755328a0293af66e18096e0cae29996f1.tar.gz
blackbird-op-linux-d92950e755328a0293af66e18096e0cae29996f1.zip
ASoC: rt5640: Add the function "get_clk_info" to RL6231 shared support
The patch adds the function "get_clk_info" to RL6231 shared support. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/rt5645.c')
-rw-r--r--sound/soc/codecs/rt5645.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index ee6db7c7c5e8..02147be2b302 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -1786,21 +1786,6 @@ static const struct snd_soc_dapm_route rt5645_dapm_routes[] = {
{ "SPOR", NULL, "SPK amp" },
};
-static int get_clk_info(int sclk, int rate)
-{
- int i, pd[] = {1, 2, 3, 4, 6, 8, 12, 16};
-
- if (sclk <= 0 || rate <= 0)
- return -EINVAL;
-
- rate = rate << 8;
- for (i = 0; i < ARRAY_SIZE(pd); i++)
- if (sclk == rate * pd[i])
- return i;
-
- return -EINVAL;
-}
-
static int rt5645_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
{
@@ -1810,7 +1795,7 @@ static int rt5645_hw_params(struct snd_pcm_substream *substream,
int pre_div, bclk_ms, frame_size;
rt5645->lrck[dai->id] = params_rate(params);
- pre_div = get_clk_info(rt5645->sysclk, rt5645->lrck[dai->id]);
+ pre_div = rl6231_get_clk_info(rt5645->sysclk, rt5645->lrck[dai->id]);
if (pre_div < 0) {
dev_err(codec->dev, "Unsupported clock setting\n");
return -EINVAL;
OpenPOWER on IntegriCloud