aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/au1x
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-01-01 11:16:11 -0500
committerMark Brown <broonie@kernel.org>2015-01-06 12:34:26 -0500
commitb4508d0f95fa4aaed889549e31391641d675d4bb (patch)
treeca80ebe57035a5b78b50b7fcd28ae5d512849685 /sound/soc/au1x
parent059d3dc6e5e8d4a62803eb3ad01b34fa3f714675 (diff)
ASoC: db1200: Use static DAI format setup
Set the dai_fmt field in the dai_link struct instead of manually calling snd_soc_dai_fmt(). This makes the code cleaner and shorter. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/au1x')
-rw-r--r--sound/soc/au1x/db1200.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/sound/soc/au1x/db1200.c b/sound/soc/au1x/db1200.c
index a747ac0b399f..c75995f2779c 100644
--- a/sound/soc/au1x/db1200.c
+++ b/sound/soc/au1x/db1200.c
@@ -91,27 +91,12 @@ static int db1200_i2s_startup(struct snd_pcm_substream *substream)
91{ 91{
92 struct snd_soc_pcm_runtime *rtd = substream->private_data; 92 struct snd_soc_pcm_runtime *rtd = substream->private_data;
93 struct snd_soc_dai *codec_dai = rtd->codec_dai; 93 struct snd_soc_dai *codec_dai = rtd->codec_dai;
94 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
95 int ret;
96 94
97 /* WM8731 has its own 12MHz crystal */ 95 /* WM8731 has its own 12MHz crystal */
98 snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_XTAL, 96 snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_XTAL,
99 12000000, SND_SOC_CLOCK_IN); 97 12000000, SND_SOC_CLOCK_IN);
100 98
101 /* codec is bitclock and lrclk master */ 99 return 0;
102 ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_LEFT_J |
103 SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
104 if (ret < 0)
105 goto out;
106
107 ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_LEFT_J |
108 SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
109 if (ret < 0)
110 goto out;
111
112 ret = 0;
113out:
114 return ret;
115} 100}
116 101
117static struct snd_soc_ops db1200_i2s_wm8731_ops = { 102static struct snd_soc_ops db1200_i2s_wm8731_ops = {
@@ -125,6 +110,8 @@ static struct snd_soc_dai_link db1200_i2s_dai = {
125 .cpu_dai_name = "au1xpsc_i2s.1", 110 .cpu_dai_name = "au1xpsc_i2s.1",
126 .platform_name = "au1xpsc-pcm.1", 111 .platform_name = "au1xpsc-pcm.1",
127 .codec_name = "wm8731.0-001b", 112 .codec_name = "wm8731.0-001b",
113 .dai_fmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_NB_NF |
114 SND_SOC_DAIFMT_CBM_CFM,
128 .ops = &db1200_i2s_wm8731_ops, 115 .ops = &db1200_i2s_wm8731_ops,
129}; 116};
130 117