ASoC: rt5640: Add the function "get_clk_info" to RL6231 shared support
[deliverable/linux.git] / sound / soc / codecs / rt5651.c
index a627a1f9dfcbaf82ee863b28d6a6648e85543608..ea4b1c652a26cecdd29ec95920840008544510c8 100644 (file)
@@ -1338,21 +1338,6 @@ static const struct snd_soc_dapm_route rt5651_dapm_routes[] = {
        {"PDMR", NULL, "PDM R Mux"},
 };
 
-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 rt5651_hw_params(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
 {
@@ -1362,7 +1347,7 @@ static int rt5651_hw_params(struct snd_pcm_substream *substream,
        int pre_div, bclk_ms, frame_size;
 
        rt5651->lrck[dai->id] = params_rate(params);
-       pre_div = get_clk_info(rt5651->sysclk, rt5651->lrck[dai->id]);
+       pre_div = rl6231_get_clk_info(rt5651->sysclk, rt5651->lrck[dai->id]);
 
        if (pre_div < 0) {
                dev_err(codec->dev, "Unsupported clock setting\n");
This page took 0.030026 seconds and 5 git commands to generate.