summaryrefslogtreecommitdiff
path: root/sound/soc/samsung
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-01-01 19:16:23 +0300
committerMark Brown <broonie@kernel.org>2015-01-06 20:34:30 +0300
commit5f0acedddf533c086edf29eefdc743dc1e756b5d (patch)
tree46a74a5a1c5899b04675f892cb69c34ef4c49f3f /sound/soc/samsung
parente16514d931635640906ab2810c98f6a9047cb87a (diff)
downloadlinux-5f0acedddf533c086edf29eefdc743dc1e756b5d.tar.xz
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>
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r--sound/soc/samsung/rx1950_uda1380.c15
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[] = {
.init = rx1950_uda1380_init,
.platform_name = "s3c24xx-iis",
.codec_name = "uda1380-codec.0-001a",
+ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+ SND_SOC_DAIFMT_CBS_CFS,
.ops = &rx1950_ops,
},
};
@@ -154,7 +156,6 @@ static int rx1950_hw_params(struct snd_pcm_substream *substream,
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
int div;
int ret;
unsigned int rate = params_rate(params);
@@ -181,18 +182,6 @@ static int rx1950_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
- /* set codec DAI configuration */
- ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
- if (ret < 0)
- return ret;
-
- /* set cpu DAI configuration */
- ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
- if (ret < 0)
- return ret;
-
/* select clock source */
ret = snd_soc_dai_set_sysclk(cpu_dai, clk_source, rate,
SND_SOC_CLOCK_OUT);