OSDN Git Service

ASoC: rt1015: remove bclk_ratio
authorTzung-Bi Shih <tzungbi@google.com>
Thu, 24 Dec 2020 10:18:54 +0000 (18:18 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 5 Jan 2021 14:34:18 +0000 (14:34 +0000)
bclk_ratio is unused.  Removes bclk_ratio and .set_bclk_ratio callback.

Removes snd_soc_dai_set_bclk_ratio() in a few machine drivers which are
obviously using rt1015.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201224101854.3024823-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/amd/acp3x-rt5682-max9836.c
sound/soc/codecs/rt1015.c
sound/soc/codecs/rt1015.h
sound/soc/intel/boards/sof_rt5682.c
sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c

index 1a4e8ca..cea320a 100644 (file)
@@ -140,9 +140,7 @@ static int acp3x_1015_hw_params(struct snd_pcm_substream *substream,
        for_each_rtd_codec_dais(rtd, i, codec_dai) {
                if (strcmp(codec_dai->name, "rt1015-aif"))
                        continue;
-               ret = snd_soc_dai_set_bclk_ratio(codec_dai, 64);
-               if (ret < 0)
-                       return ret;
+
                ret = snd_soc_dai_set_pll(codec_dai, 0, RT1015_PLL_S_BCLK,
                                                64 * srate, 256 * srate);
                if (ret < 0)
index 145724a..37b5795 100644 (file)
@@ -864,14 +864,6 @@ static int rt1015_set_component_pll(struct snd_soc_component *component,
                freq_out == rt1015->pll_out)
                return 0;
 
-       if (source == RT1015_PLL_S_BCLK) {
-               if (rt1015->bclk_ratio == 0) {
-                       dev_err(component->dev,
-                               "Can not support bclk ratio as 0.\n");
-                       return -EINVAL;
-               }
-       }
-
        switch (source) {
        case RT1015_PLL_S_MCLK:
                snd_soc_component_update_bits(component, RT1015_CLK2,
@@ -911,23 +903,6 @@ static int rt1015_set_component_pll(struct snd_soc_component *component,
        return 0;
 }
 
-static int rt1015_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio)
-{
-       struct snd_soc_component *component = dai->component;
-       struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
-
-       dev_dbg(component->dev, "%s ratio=%d\n", __func__, ratio);
-
-       rt1015->bclk_ratio = ratio;
-
-       if (ratio == 50) {
-               dev_dbg(component->dev, "Unsupport bclk ratio\n");
-               return -EINVAL;
-       }
-
-       return 0;
-}
-
 static int rt1015_set_tdm_slot(struct snd_soc_dai *dai,
        unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width)
 {
@@ -1034,8 +1009,6 @@ static int rt1015_probe(struct snd_soc_component *component)
                snd_soc_component_get_drvdata(component);
 
        rt1015->component = component;
-       rt1015->bclk_ratio = 0;
-
        INIT_DELAYED_WORK(&rt1015->flush_work, rt1015_flush_work);
 
        return 0;
@@ -1056,7 +1029,6 @@ static void rt1015_remove(struct snd_soc_component *component)
 static struct snd_soc_dai_ops rt1015_aif_dai_ops = {
        .hw_params = rt1015_hw_params,
        .set_fmt = rt1015_set_dai_fmt,
-       .set_bclk_ratio = rt1015_set_bclk_ratio,
        .set_tdm_slot = rt1015_set_tdm_slot,
 };
 
index e9b498a..2aeaf65 100644 (file)
@@ -427,7 +427,6 @@ struct rt1015_priv {
        struct regmap *regmap;
        int sysclk;
        int sysclk_src;
-       int bclk_ratio;
        int pll_src;
        int pll_in;
        int pll_out;
index 8b1ca2d..55505e2 100644 (file)
@@ -323,13 +323,6 @@ static int sof_rt1015_hw_params(struct snd_pcm_substream *substream,
                fs = 64;
 
        for_each_rtd_codec_dais(rtd, i, codec_dai) {
-               /* Set tdm/i2s1 master bclk ratio */
-               ret = snd_soc_dai_set_bclk_ratio(codec_dai, fs);
-               if (ret < 0) {
-                       dev_err(card->dev, "failed to set bclk ratio\n");
-                       return ret;
-               }
-
                ret = snd_soc_dai_set_pll(codec_dai, 0, RT1015_PLL_S_BCLK,
                                          params_rate(params) * fs,
                                          params_rate(params) * 256);
index 078e58f..870cdfd 100644 (file)
@@ -125,12 +125,6 @@ mt8183_da7219_rt1015_i2s_hw_params(struct snd_pcm_substream *substream,
        for_each_rtd_codec_dais(rtd, i, codec_dai) {
                if (!strcmp(codec_dai->component->name, RT1015_DEV0_NAME) ||
                    !strcmp(codec_dai->component->name, RT1015_DEV1_NAME)) {
-                       ret = snd_soc_dai_set_bclk_ratio(codec_dai, 64);
-                       if (ret) {
-                               dev_err(rtd->dev, "failed to set bclk ratio\n");
-                               return ret;
-                       }
-
                        ret = snd_soc_dai_set_pll(codec_dai, 0,
                                                  RT1015_PLL_S_BCLK,
                                                  rate * 64, rate * 256);
index 8c83408..0e48922 100644 (file)
@@ -68,12 +68,6 @@ mt8183_mt6358_rt1015_i2s_hw_params(struct snd_pcm_substream *substream,
        int ret, i;
 
        for_each_rtd_codec_dais(rtd, i, codec_dai) {
-               ret = snd_soc_dai_set_bclk_ratio(codec_dai, 64);
-               if (ret < 0) {
-                       dev_err(card->dev, "failed to set bclk ratio\n");
-                       return ret;
-               }
-
                ret = snd_soc_dai_set_pll(codec_dai, 0, RT1015_PLL_S_BCLK,
                                rate * 64, rate * 256);
                if (ret < 0) {
index 716fbb4..a988ce1 100644 (file)
@@ -46,12 +46,6 @@ static int mt8192_rt1015_i2s_hw_params(struct snd_pcm_substream *substream,
        int ret, i;
 
        for_each_rtd_codec_dais(rtd, i, codec_dai) {
-               ret = snd_soc_dai_set_bclk_ratio(codec_dai, 64);
-               if (ret) {
-                       dev_err(card->dev, "failed to set bclk ratio\n");
-                       return ret;
-               }
-
                ret = snd_soc_dai_set_pll(codec_dai, 0,
                                          RT1015_PLL_S_BCLK,
                                          params_rate(params) * 64,