diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-02-01 13:24:21 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-01 13:29:19 -0500 |
commit | 980b0bc69270a9650ffb94f08dc87740ee1fb9b4 (patch) | |
tree | 0447c25b4df67cb0681ec5bfaca82a380dd57628 /sound/soc/blackfin/bf5xx-ad1836.c | |
parent | 471280b715769be8d368f9d6bbd28558d7661f5f (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-ad1836.c')
-rw-r--r-- | sound/soc/blackfin/bf5xx-ad1836.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sound/soc/blackfin/bf5xx-ad1836.c b/sound/soc/blackfin/bf5xx-ad1836.c index 60962ce6cd4d..d542d4063771 100644 --- a/sound/soc/blackfin/bf5xx-ad1836.c +++ b/sound/soc/blackfin/bf5xx-ad1836.c | |||
@@ -40,20 +40,8 @@ static int bf5xx_ad1836_hw_params(struct snd_pcm_substream *substream, | |||
40 | { | 40 | { |
41 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 41 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
42 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | 42 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
43 | struct snd_soc_dai *codec_dai = rtd->codec_dai; | ||
44 | unsigned int channel_map[] = {0, 4, 1, 5, 2, 6, 3, 7}; | 43 | unsigned int channel_map[] = {0, 4, 1, 5, 2, 6, 3, 7}; |
45 | int ret = 0; | 44 | int ret = 0; |
46 | /* set cpu DAI configuration */ | ||
47 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A | | ||
48 | SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBM_CFM); | ||
49 | if (ret < 0) | ||
50 | return ret; | ||
51 | |||
52 | /* set codec DAI configuration */ | ||
53 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_A | | ||
54 | SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBM_CFM); | ||
55 | if (ret < 0) | ||
56 | return ret; | ||
57 | 45 | ||
58 | /* set cpu DAI channel mapping */ | 46 | /* set cpu DAI channel mapping */ |
59 | ret = snd_soc_dai_set_channel_map(cpu_dai, ARRAY_SIZE(channel_map), | 47 | ret = snd_soc_dai_set_channel_map(cpu_dai, ARRAY_SIZE(channel_map), |
@@ -68,6 +56,9 @@ static struct snd_soc_ops bf5xx_ad1836_ops = { | |||
68 | .hw_params = bf5xx_ad1836_hw_params, | 56 | .hw_params = bf5xx_ad1836_hw_params, |
69 | }; | 57 | }; |
70 | 58 | ||
59 | #define BF5XX_AD1836_DAIFMT (SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_IB_IF | \ | ||
60 | SND_SOC_DAIFMT_CBM_CFM) | ||
61 | |||
71 | static struct snd_soc_dai_link bf5xx_ad1836_dai[] = { | 62 | static struct snd_soc_dai_link bf5xx_ad1836_dai[] = { |
72 | { | 63 | { |
73 | .name = "ad1836", | 64 | .name = "ad1836", |
@@ -77,6 +68,7 @@ static struct snd_soc_dai_link bf5xx_ad1836_dai[] = { | |||
77 | .platform_name = "bfin-tdm-pcm-audio", | 68 | .platform_name = "bfin-tdm-pcm-audio", |
78 | .codec_name = "spi0.4", | 69 | .codec_name = "spi0.4", |
79 | .ops = &bf5xx_ad1836_ops, | 70 | .ops = &bf5xx_ad1836_ops, |
71 | .dai_fmt = BF5XX_AD1836_DAIFMT, | ||
80 | }, | 72 | }, |
81 | { | 73 | { |
82 | .name = "ad1836", | 74 | .name = "ad1836", |
@@ -86,6 +78,7 @@ static struct snd_soc_dai_link bf5xx_ad1836_dai[] = { | |||
86 | .platform_name = "bfin-tdm-pcm-audio", | 78 | .platform_name = "bfin-tdm-pcm-audio", |
87 | .codec_name = "spi0.4", | 79 | .codec_name = "spi0.4", |
88 | .ops = &bf5xx_ad1836_ops, | 80 | .ops = &bf5xx_ad1836_ops, |
81 | .dai_fmt = BF5XX_AD1836_DAIFMT, | ||
89 | }, | 82 | }, |
90 | }; | 83 | }; |
91 | 84 | ||