diff options
author | Mark Brown <broonie@linaro.org> | 2013-07-26 07:01:53 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-29 13:34:28 -0400 |
commit | f6ecf50b5e33119620b446dd0bce8b0a01a39669 (patch) | |
tree | e0da8460583fd42aec035f1fb20f5ea887286954 /sound/soc/samsung | |
parent | 0d47acc4ffaa9b63d96183d69d38bdb388314d7d (diff) |
ASoC: smdk_wm8994: Configure DAI format at init time
Initialise the DAI format from the data link, saving code and repeated
work.
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r-- | sound/soc/samsung/smdk_wm8994.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c index 05c479cf5b40..a56117536c94 100644 --- a/sound/soc/samsung/smdk_wm8994.c +++ b/sound/soc/samsung/smdk_wm8994.c | |||
@@ -41,7 +41,6 @@ static int smdk_hw_params(struct snd_pcm_substream *substream, | |||
41 | struct snd_pcm_hw_params *params) | 41 | struct snd_pcm_hw_params *params) |
42 | { | 42 | { |
43 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 43 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
44 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | ||
45 | struct snd_soc_dai *codec_dai = rtd->codec_dai; | 44 | struct snd_soc_dai *codec_dai = rtd->codec_dai; |
46 | unsigned int pll_out; | 45 | unsigned int pll_out; |
47 | int ret; | 46 | int ret; |
@@ -54,18 +53,6 @@ static int smdk_hw_params(struct snd_pcm_substream *substream, | |||
54 | else | 53 | else |
55 | pll_out = params_rate(params) * 256; | 54 | pll_out = params_rate(params) * 256; |
56 | 55 | ||
57 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | ||
58 | | SND_SOC_DAIFMT_NB_NF | ||
59 | | SND_SOC_DAIFMT_CBM_CFM); | ||
60 | if (ret < 0) | ||
61 | return ret; | ||
62 | |||
63 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | ||
64 | | SND_SOC_DAIFMT_NB_NF | ||
65 | | SND_SOC_DAIFMT_CBM_CFM); | ||
66 | if (ret < 0) | ||
67 | return ret; | ||
68 | |||
69 | ret = snd_soc_dai_set_pll(codec_dai, WM8994_FLL1, WM8994_FLL_SRC_MCLK1, | 56 | ret = snd_soc_dai_set_pll(codec_dai, WM8994_FLL1, WM8994_FLL_SRC_MCLK1, |
70 | SMDK_WM8994_FREQ, pll_out); | 57 | SMDK_WM8994_FREQ, pll_out); |
71 | if (ret < 0) | 58 | if (ret < 0) |
@@ -131,6 +118,8 @@ static struct snd_soc_dai_link smdk_dai[] = { | |||
131 | .platform_name = "samsung-i2s.0", | 118 | .platform_name = "samsung-i2s.0", |
132 | .codec_name = "wm8994-codec", | 119 | .codec_name = "wm8994-codec", |
133 | .init = smdk_wm8994_init_paiftx, | 120 | .init = smdk_wm8994_init_paiftx, |
121 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | ||
122 | SND_SOC_DAIFMT_CBM_CFM, | ||
134 | .ops = &smdk_ops, | 123 | .ops = &smdk_ops, |
135 | }, { /* Sec_Fifo Playback i/f */ | 124 | }, { /* Sec_Fifo Playback i/f */ |
136 | .name = "Sec_FIFO TX", | 125 | .name = "Sec_FIFO TX", |
@@ -139,6 +128,8 @@ static struct snd_soc_dai_link smdk_dai[] = { | |||
139 | .codec_dai_name = "wm8994-aif1", | 128 | .codec_dai_name = "wm8994-aif1", |
140 | .platform_name = "samsung-i2s-sec", | 129 | .platform_name = "samsung-i2s-sec", |
141 | .codec_name = "wm8994-codec", | 130 | .codec_name = "wm8994-codec", |
131 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | ||
132 | SND_SOC_DAIFMT_CBM_CFM, | ||
142 | .ops = &smdk_ops, | 133 | .ops = &smdk_ops, |
143 | }, | 134 | }, |
144 | }; | 135 | }; |