diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-01-01 11:16:23 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-01-06 12:34:30 -0500 |
commit | 5f0acedddf533c086edf29eefdc743dc1e756b5d (patch) | |
tree | 46a74a5a1c5899b04675f892cb69c34ef4c49f3f | |
parent | e16514d931635640906ab2810c98f6a9047cb87a (diff) |
ASoC: rx1950_uda1380: 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>
-rw-r--r-- | sound/soc/samsung/rx1950_uda1380.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/sound/soc/samsung/rx1950_uda1380.c b/sound/soc/samsung/rx1950_uda1380.c index 37688ebbb2b4..873f2cb4bebe 100644 --- a/sound/soc/samsung/rx1950_uda1380.c +++ b/sound/soc/samsung/rx1950_uda1380.c | |||
@@ -89,6 +89,8 @@ static struct snd_soc_dai_link rx1950_uda1380_dai[] = { | |||
89 | .init = rx1950_uda1380_init, | 89 | .init = rx1950_uda1380_init, |
90 | .platform_name = "s3c24xx-iis", | 90 | .platform_name = "s3c24xx-iis", |
91 | .codec_name = "uda1380-codec.0-001a", | 91 | .codec_name = "uda1380-codec.0-001a", |
92 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | ||
93 | SND_SOC_DAIFMT_CBS_CFS, | ||
92 | .ops = &rx1950_ops, | 94 | .ops = &rx1950_ops, |
93 | }, | 95 | }, |
94 | }; | 96 | }; |
@@ -154,7 +156,6 @@ static int rx1950_hw_params(struct snd_pcm_substream *substream, | |||
154 | { | 156 | { |
155 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 157 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
156 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | 158 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
157 | struct snd_soc_dai *codec_dai = rtd->codec_dai; | ||
158 | int div; | 159 | int div; |
159 | int ret; | 160 | int ret; |
160 | unsigned int rate = params_rate(params); | 161 | unsigned int rate = params_rate(params); |
@@ -181,18 +182,6 @@ static int rx1950_hw_params(struct snd_pcm_substream *substream, | |||
181 | return -EINVAL; | 182 | return -EINVAL; |
182 | } | 183 | } |
183 | 184 | ||
184 | /* set codec DAI configuration */ | ||
185 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | ||
186 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | ||
187 | if (ret < 0) | ||
188 | return ret; | ||
189 | |||
190 | /* set cpu DAI configuration */ | ||
191 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | ||
192 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | ||
193 | if (ret < 0) | ||
194 | return ret; | ||
195 | |||
196 | /* select clock source */ | 185 | /* select clock source */ |
197 | ret = snd_soc_dai_set_sysclk(cpu_dai, clk_source, rate, | 186 | ret = snd_soc_dai_set_sysclk(cpu_dai, clk_source, rate, |
198 | SND_SOC_CLOCK_OUT); | 187 | SND_SOC_CLOCK_OUT); |