diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-01-01 11:16:22 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-01-06 12:34:30 -0500 |
commit | e16514d931635640906ab2810c98f6a9047cb87a (patch) | |
tree | bc6c8e1ce188a31d570137aea0cc4ee84287bae5 | |
parent | 72303cafcb5cc9fd1227d0edd458f62bef1a397e (diff) |
ASoC: neo1973_wm8753: 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/neo1973_wm8753.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/sound/soc/samsung/neo1973_wm8753.c b/sound/soc/samsung/neo1973_wm8753.c index 9b4a09f14b6c..65602b935377 100644 --- a/sound/soc/samsung/neo1973_wm8753.c +++ b/sound/soc/samsung/neo1973_wm8753.c | |||
@@ -70,20 +70,6 @@ static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream, | |||
70 | break; | 70 | break; |
71 | } | 71 | } |
72 | 72 | ||
73 | /* set codec DAI configuration */ | ||
74 | ret = snd_soc_dai_set_fmt(codec_dai, | ||
75 | SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | ||
76 | SND_SOC_DAIFMT_CBM_CFM); | ||
77 | if (ret < 0) | ||
78 | return ret; | ||
79 | |||
80 | /* set cpu DAI configuration */ | ||
81 | ret = snd_soc_dai_set_fmt(cpu_dai, | ||
82 | SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | ||
83 | SND_SOC_DAIFMT_CBM_CFM); | ||
84 | if (ret < 0) | ||
85 | return ret; | ||
86 | |||
87 | /* set the codec system clock for DAC and ADC */ | 73 | /* set the codec system clock for DAC and ADC */ |
88 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8753_MCLK, pll_out, | 74 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8753_MCLK, pll_out, |
89 | SND_SOC_CLOCK_IN); | 75 | SND_SOC_CLOCK_IN); |
@@ -151,13 +137,6 @@ static int neo1973_voice_hw_params(struct snd_pcm_substream *substream, | |||
151 | 137 | ||
152 | pcmdiv = WM8753_PCM_DIV_6; /* 2.048 MHz */ | 138 | pcmdiv = WM8753_PCM_DIV_6; /* 2.048 MHz */ |
153 | 139 | ||
154 | /* todo: gg check mode (DSP_B) against CSR datasheet */ | ||
155 | /* set codec DAI configuration */ | ||
156 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_B | | ||
157 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | ||
158 | if (ret < 0) | ||
159 | return ret; | ||
160 | |||
161 | /* set the codec system clock for DAC and ADC */ | 140 | /* set the codec system clock for DAC and ADC */ |
162 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8753_PCMCLK, 12288000, | 141 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8753_PCMCLK, 12288000, |
163 | SND_SOC_CLOCK_IN); | 142 | SND_SOC_CLOCK_IN); |
@@ -300,6 +279,8 @@ static struct snd_soc_dai_link neo1973_dai[] = { | |||
300 | .cpu_dai_name = "s3c24xx-iis", | 279 | .cpu_dai_name = "s3c24xx-iis", |
301 | .codec_dai_name = "wm8753-hifi", | 280 | .codec_dai_name = "wm8753-hifi", |
302 | .codec_name = "wm8753.0-001a", | 281 | .codec_name = "wm8753.0-001a", |
282 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | ||
283 | SND_SOC_DAIFMT_CBM_CFM, | ||
303 | .init = neo1973_wm8753_init, | 284 | .init = neo1973_wm8753_init, |
304 | .ops = &neo1973_hifi_ops, | 285 | .ops = &neo1973_hifi_ops, |
305 | }, | 286 | }, |
@@ -309,6 +290,8 @@ static struct snd_soc_dai_link neo1973_dai[] = { | |||
309 | .cpu_dai_name = "bt-sco-pcm", | 290 | .cpu_dai_name = "bt-sco-pcm", |
310 | .codec_dai_name = "wm8753-voice", | 291 | .codec_dai_name = "wm8753-voice", |
311 | .codec_name = "wm8753.0-001a", | 292 | .codec_name = "wm8753.0-001a", |
293 | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF | | ||
294 | SND_SOC_DAIFMT_CBS_CFS, | ||
312 | .ops = &neo1973_voice_ops, | 295 | .ops = &neo1973_voice_ops, |
313 | }, | 296 | }, |
314 | }; | 297 | }; |