aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/blackfin/bf5xx-ad193x.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-02-01 13:24:21 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-01 13:29:19 -0500
commit980b0bc69270a9650ffb94f08dc87740ee1fb9b4 (patch)
tree0447c25b4df67cb0681ec5bfaca82a380dd57628 /sound/soc/blackfin/bf5xx-ad193x.c
parent471280b715769be8d368f9d6bbd28558d7661f5f (diff)
ASoC: blackfin: Use dai_fmt
Use the dai_link's dai_fmt attribute to setup the DAI format instead of doing this manually. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/blackfin/bf5xx-ad193x.c')
-rw-r--r--sound/soc/blackfin/bf5xx-ad193x.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/sound/soc/blackfin/bf5xx-ad193x.c b/sound/soc/blackfin/bf5xx-ad193x.c
index 2d8d82dbc159..0e55e9f2a514 100644
--- a/sound/soc/blackfin/bf5xx-ad193x.c
+++ b/sound/soc/blackfin/bf5xx-ad193x.c
@@ -60,18 +60,6 @@ static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream,
60 break; 60 break;
61 } 61 }
62 62
63 /* set cpu DAI configuration */
64 ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A |
65 SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBM_CFM);
66 if (ret < 0)
67 return ret;
68
69 /* set codec DAI configuration */
70 ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_A |
71 SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBM_CFM);
72 if (ret < 0)
73 return ret;
74
75 /* set the codec system clock for DAC and ADC */ 63 /* set the codec system clock for DAC and ADC */
76 ret = snd_soc_dai_set_sysclk(codec_dai, 0, clk, 64 ret = snd_soc_dai_set_sysclk(codec_dai, 0, clk,
77 SND_SOC_CLOCK_IN); 65 SND_SOC_CLOCK_IN);
@@ -92,6 +80,9 @@ static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream,
92 return 0; 80 return 0;
93} 81}
94 82
83#define BF5XX_AD193X_DAIFMT (SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_IB_IF | \
84 SND_SOC_DAIFMT_CBM_CFM)
85
95static struct snd_soc_ops bf5xx_ad193x_ops = { 86static struct snd_soc_ops bf5xx_ad193x_ops = {
96 .hw_params = bf5xx_ad193x_hw_params, 87 .hw_params = bf5xx_ad193x_hw_params,
97}; 88};
@@ -105,6 +96,7 @@ static struct snd_soc_dai_link bf5xx_ad193x_dai[] = {
105 .platform_name = "bfin-tdm-pcm-audio", 96 .platform_name = "bfin-tdm-pcm-audio",
106 .codec_name = "spi0.5", 97 .codec_name = "spi0.5",
107 .ops = &bf5xx_ad193x_ops, 98 .ops = &bf5xx_ad193x_ops,
99 .dai_fmt = BF5XX_AD193X_DAIFMT,
108 }, 100 },
109 { 101 {
110 .name = "ad193x", 102 .name = "ad193x",
@@ -114,6 +106,7 @@ static struct snd_soc_dai_link bf5xx_ad193x_dai[] = {
114 .platform_name = "bfin-tdm-pcm-audio", 106 .platform_name = "bfin-tdm-pcm-audio",
115 .codec_name = "spi0.5", 107 .codec_name = "spi0.5",
116 .ops = &bf5xx_ad193x_ops, 108 .ops = &bf5xx_ad193x_ops,
109 .dai_fmt = BF5XX_AD193X_DAIFMT,
117 }, 110 },
118}; 111};
119 112