aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/blackfin/bf5xx-ad73311.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-ad73311.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-ad73311.c')
-rw-r--r--sound/soc/blackfin/bf5xx-ad73311.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/sound/soc/blackfin/bf5xx-ad73311.c b/sound/soc/blackfin/bf5xx-ad73311.c
index 8e49508596da..61cc91d4a028 100644
--- a/sound/soc/blackfin/bf5xx-ad73311.c
+++ b/sound/soc/blackfin/bf5xx-ad73311.c
@@ -145,29 +145,8 @@ static int bf5xx_probe(struct snd_soc_card *card)
145 return 0; 145 return 0;
146} 146}
147 147
148static int bf5xx_ad73311_hw_params(struct snd_pcm_substream *substream, 148#define BF5XX_AD7311_DAI_FMT (SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF | \
149 struct snd_pcm_hw_params *params) 149 SND_SOC_DAIFMT_CBM_CFM)
150{
151 struct snd_soc_pcm_runtime *rtd = substream->private_data;
152 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
153 int ret = 0;
154
155 pr_debug("%s rate %d format %x\n", __func__, params_rate(params),
156 params_format(params));
157
158 /* set cpu DAI configuration */
159 ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A |
160 SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
161 if (ret < 0)
162 return ret;
163
164 return 0;
165}
166
167
168static struct snd_soc_ops bf5xx_ad73311_ops = {
169 .hw_params = bf5xx_ad73311_hw_params,
170};
171 150
172static struct snd_soc_dai_link bf5xx_ad73311_dai[] = { 151static struct snd_soc_dai_link bf5xx_ad73311_dai[] = {
173 { 152 {
@@ -177,7 +156,7 @@ static struct snd_soc_dai_link bf5xx_ad73311_dai[] = {
177 .codec_dai_name = "ad73311-hifi", 156 .codec_dai_name = "ad73311-hifi",
178 .platform_name = "bfin-i2s-pcm-audio", 157 .platform_name = "bfin-i2s-pcm-audio",
179 .codec_name = "ad73311", 158 .codec_name = "ad73311",
180 .ops = &bf5xx_ad73311_ops, 159 .dai_fmt = BF5XX_AD7311_DAI_FMT,
181 }, 160 },
182 { 161 {
183 .name = "ad73311", 162 .name = "ad73311",
@@ -186,7 +165,7 @@ static struct snd_soc_dai_link bf5xx_ad73311_dai[] = {
186 .codec_dai_name = "ad73311-hifi", 165 .codec_dai_name = "ad73311-hifi",
187 .platform_name = "bfin-i2s-pcm-audio", 166 .platform_name = "bfin-i2s-pcm-audio",
188 .codec_name = "ad73311", 167 .codec_name = "ad73311",
189 .ops = &bf5xx_ad73311_ops, 168 .dai_fmt = BF5XX_AD7311_DAI_FMT,
190 }, 169 },
191}; 170};
192 171