]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
ASoC: blackfin: Switch bf5xx-ad193x from bf5xx-tdm to bf5xx-i2s
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 28 May 2013 17:22:15 +0000 (19:22 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 30 May 2013 11:33:40 +0000 (12:33 +0100)
The bf5xx-i2s driver now has support for TDM mode and the bf5xx-tdm driver is
going to be removed soon, so switch the driver over to bf5xx-i2s.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/blackfin/Kconfig
sound/soc/blackfin/bf5xx-ad193x.c

index 16b88f5c26e26a974fb611da0ee27babfd5703eb..906c349a00ea3dd46088bd5c79d384fb9a85288d 100644 (file)
@@ -56,6 +56,15 @@ config SND_SOC_BFIN_EVAL_ADAV80X
          Note: This driver assumes that the ADAV80X digital record and playback
          interfaces are connected to the first SPORT port on the BF5XX board.
 
+config SND_BF5XX_SOC_AD193X
+       tristate "SoC AD193X Audio support for Blackfin"
+       depends on SND_BF5XX_I2S
+       select SND_BF5XX_SOC_I2S
+       select SND_SOC_AD193X
+       help
+         Say Y if you want to add support for AD193X codec on Blackfin.
+         This driver supports AD1936, AD1937, AD1938 and AD1939.
+
 config SND_BF5XX_SOC_AD73311
        tristate "SoC AD73311 Audio support for Blackfin"
        depends on SND_BF5XX_I2S
@@ -90,15 +99,6 @@ config SND_BF5XX_SOC_AD1836
        help
          Say Y if you want to add support for SoC audio on BF5xx STAMP/EZKIT.
 
-config SND_BF5XX_SOC_AD193X
-       tristate "SoC AD193X Audio support for Blackfin"
-       depends on SND_BF5XX_TDM
-       select SND_BF5XX_SOC_TDM
-       select SND_SOC_AD193X
-       help
-         Say Y if you want to add support for AD193X codec on Blackfin.
-         This driver supports AD1936, AD1937, AD1938 and AD1939.
-
 config SND_BF5XX_AC97
        tristate "SoC AC97 Audio for the ADI BF5xx chip"
        depends on BLACKFIN
index ce773b31916fc0f9152049e75c3b9322250d918e..603ad1f2b9b9bb75f00194b971befe720c9e3992 100644 (file)
 
 #include "../codecs/ad193x.h"
 
-#include "bf5xx-tdm.h"
-
 static struct snd_soc_card bf5xx_ad193x;
 
-static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+static int bf5xx_ad193x_link_init(struct snd_soc_pcm_runtime *rtd)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
        struct snd_soc_dai *codec_dai = rtd->codec_dai;
-       unsigned int clk = 0;
-       unsigned int channel_map[] = {0, 1, 2, 3, 4, 5, 6, 7};
-       int ret = 0;
-
-       switch (params_rate(params)) {
-       case 48000:
-               clk = 24576000;
-               break;
-       }
+       int ret;
 
        /* set the codec system clock for DAC and ADC */
-       ret = snd_soc_dai_set_sysclk(codec_dai, 0, clk,
-               SND_SOC_CLOCK_IN);
+       ret = snd_soc_dai_set_sysclk(codec_dai, 0, 24576000, SND_SOC_CLOCK_IN);
        if (ret < 0)
                return ret;
 
@@ -70,9 +57,7 @@ static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream,
        if (ret < 0)
                return ret;
 
-       /* set cpu DAI channel mapping */
-       ret = snd_soc_dai_set_channel_map(cpu_dai, ARRAY_SIZE(channel_map),
-               channel_map, ARRAY_SIZE(channel_map), channel_map);
+       ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0xFF, 0xFF, 8, 32);
        if (ret < 0)
                return ret;
 
@@ -82,30 +67,26 @@ static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream,
 #define BF5XX_AD193X_DAIFMT (SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_IB_IF | \
                                SND_SOC_DAIFMT_CBM_CFM)
 
-static struct snd_soc_ops bf5xx_ad193x_ops = {
-       .hw_params = bf5xx_ad193x_hw_params,
-};
-
 static struct snd_soc_dai_link bf5xx_ad193x_dai[] = {
        {
                .name = "ad193x",
                .stream_name = "AD193X",
-               .cpu_dai_name = "bfin-tdm.0",
+               .cpu_dai_name = "bfin-i2s.0",
                .codec_dai_name ="ad193x-hifi",
-               .platform_name = "bfin-tdm-pcm-audio",
+               .platform_name = "bfin-i2s-pcm-audio",
                .codec_name = "spi0.5",
-               .ops = &bf5xx_ad193x_ops,
                .dai_fmt = BF5XX_AD193X_DAIFMT,
+               .init = bf5xx_ad193x_link_init,
        },
        {
                .name = "ad193x",
                .stream_name = "AD193X",
-               .cpu_dai_name = "bfin-tdm.1",
+               .cpu_dai_name = "bfin-i2s.1",
                .codec_dai_name ="ad193x-hifi",
-               .platform_name = "bfin-tdm-pcm-audio",
+               .platform_name = "bfin-i2s-pcm-audio",
                .codec_name = "spi0.5",
-               .ops = &bf5xx_ad193x_ops,
                .dai_fmt = BF5XX_AD193X_DAIFMT,
+               .init = bf5xx_ad193x_link_init,
        },
 };