diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-01-01 11:16:10 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-01-06 12:33:58 -0500 |
commit | 059d3dc6e5e8d4a62803eb3ad01b34fa3f714675 (patch) | |
tree | 441d1974c8d0efdbb7ab3d436eddfbce152c0346 /sound/soc/atmel | |
parent | 97bf6af1f928216fd6c5a66e8a57bfa95a659672 (diff) |
ASoC: sam9g20_wm8731: 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>
Acked-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/atmel')
-rw-r--r-- | sound/soc/atmel/sam9g20_wm8731.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c index 66b66d0e7514..98ca6341147b 100644 --- a/sound/soc/atmel/sam9g20_wm8731.c +++ b/sound/soc/atmel/sam9g20_wm8731.c | |||
@@ -64,33 +64,6 @@ | |||
64 | 64 | ||
65 | static struct clk *mclk; | 65 | static struct clk *mclk; |
66 | 66 | ||
67 | static int at91sam9g20ek_hw_params(struct snd_pcm_substream *substream, | ||
68 | struct snd_pcm_hw_params *params) | ||
69 | { | ||
70 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
71 | struct snd_soc_dai *codec_dai = rtd->codec_dai; | ||
72 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | ||
73 | int ret; | ||
74 | |||
75 | /* set codec DAI configuration */ | ||
76 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | ||
77 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); | ||
78 | if (ret < 0) | ||
79 | return ret; | ||
80 | |||
81 | /* set cpu DAI configuration */ | ||
82 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | ||
83 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); | ||
84 | if (ret < 0) | ||
85 | return ret; | ||
86 | |||
87 | return 0; | ||
88 | } | ||
89 | |||
90 | static struct snd_soc_ops at91sam9g20ek_ops = { | ||
91 | .hw_params = at91sam9g20ek_hw_params, | ||
92 | }; | ||
93 | |||
94 | static int at91sam9g20ek_set_bias_level(struct snd_soc_card *card, | 67 | static int at91sam9g20ek_set_bias_level(struct snd_soc_card *card, |
95 | struct snd_soc_dapm_context *dapm, | 68 | struct snd_soc_dapm_context *dapm, |
96 | enum snd_soc_bias_level level) | 69 | enum snd_soc_bias_level level) |
@@ -173,7 +146,8 @@ static struct snd_soc_dai_link at91sam9g20ek_dai = { | |||
173 | .init = at91sam9g20ek_wm8731_init, | 146 | .init = at91sam9g20ek_wm8731_init, |
174 | .platform_name = "at91rm9200_ssc.0", | 147 | .platform_name = "at91rm9200_ssc.0", |
175 | .codec_name = "wm8731.0-001b", | 148 | .codec_name = "wm8731.0-001b", |
176 | .ops = &at91sam9g20ek_ops, | 149 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
150 | SND_SOC_DAIFMT_CBM_CFM, | ||
177 | }; | 151 | }; |
178 | 152 | ||
179 | static struct snd_soc_card snd_soc_at91sam9g20ek = { | 153 | static struct snd_soc_card snd_soc_at91sam9g20ek = { |