diff options
Diffstat (limited to 'sound/soc/pxa/spitz.c')
-rw-r--r-- | sound/soc/pxa/spitz.c | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c index c2d6ff9b158..90c5245c474 100644 --- a/sound/soc/pxa/spitz.c +++ b/sound/soc/pxa/spitz.c | |||
@@ -143,18 +143,6 @@ static int spitz_hw_params(struct snd_pcm_substream *substream, | |||
143 | break; | 143 | break; |
144 | } | 144 | } |
145 | 145 | ||
146 | /* set codec DAI configuration */ | ||
147 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | ||
148 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | ||
149 | if (ret < 0) | ||
150 | return ret; | ||
151 | |||
152 | /* set cpu DAI configuration */ | ||
153 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | ||
154 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | ||
155 | if (ret < 0) | ||
156 | return ret; | ||
157 | |||
158 | /* set the codec system clock for DAC and ADC */ | 146 | /* set the codec system clock for DAC and ADC */ |
159 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk, | 147 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk, |
160 | SND_SOC_CLOCK_IN); | 148 | SND_SOC_CLOCK_IN); |
@@ -234,7 +222,7 @@ static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = { | |||
234 | }; | 222 | }; |
235 | 223 | ||
236 | /* Spitz machine audio_map */ | 224 | /* Spitz machine audio_map */ |
237 | static const struct snd_soc_dapm_route audio_map[] = { | 225 | static const struct snd_soc_dapm_route spitz_audio_map[] = { |
238 | 226 | ||
239 | /* headphone connected to LOUT1, ROUT1 */ | 227 | /* headphone connected to LOUT1, ROUT1 */ |
240 | {"Headphone Jack", NULL, "LOUT1"}, | 228 | {"Headphone Jack", NULL, "LOUT1"}, |
@@ -277,7 +265,6 @@ static int spitz_wm8750_init(struct snd_soc_pcm_runtime *rtd) | |||
277 | { | 265 | { |
278 | struct snd_soc_codec *codec = rtd->codec; | 266 | struct snd_soc_codec *codec = rtd->codec; |
279 | struct snd_soc_dapm_context *dapm = &codec->dapm; | 267 | struct snd_soc_dapm_context *dapm = &codec->dapm; |
280 | int err; | ||
281 | 268 | ||
282 | /* NC codec pins */ | 269 | /* NC codec pins */ |
283 | snd_soc_dapm_nc_pin(dapm, "RINPUT1"); | 270 | snd_soc_dapm_nc_pin(dapm, "RINPUT1"); |
@@ -288,19 +275,6 @@ static int spitz_wm8750_init(struct snd_soc_pcm_runtime *rtd) | |||
288 | snd_soc_dapm_nc_pin(dapm, "OUT3"); | 275 | snd_soc_dapm_nc_pin(dapm, "OUT3"); |
289 | snd_soc_dapm_nc_pin(dapm, "MONO1"); | 276 | snd_soc_dapm_nc_pin(dapm, "MONO1"); |
290 | 277 | ||
291 | /* Add spitz specific controls */ | ||
292 | err = snd_soc_add_controls(codec, wm8750_spitz_controls, | ||
293 | ARRAY_SIZE(wm8750_spitz_controls)); | ||
294 | if (err < 0) | ||
295 | return err; | ||
296 | |||
297 | /* Add spitz specific widgets */ | ||
298 | snd_soc_dapm_new_controls(dapm, wm8750_dapm_widgets, | ||
299 | ARRAY_SIZE(wm8750_dapm_widgets)); | ||
300 | |||
301 | /* Set up spitz specific audio paths */ | ||
302 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
303 | |||
304 | return 0; | 278 | return 0; |
305 | } | 279 | } |
306 | 280 | ||
@@ -313,14 +287,24 @@ static struct snd_soc_dai_link spitz_dai = { | |||
313 | .platform_name = "pxa-pcm-audio", | 287 | .platform_name = "pxa-pcm-audio", |
314 | .codec_name = "wm8750.0-001b", | 288 | .codec_name = "wm8750.0-001b", |
315 | .init = spitz_wm8750_init, | 289 | .init = spitz_wm8750_init, |
290 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | ||
291 | SND_SOC_DAIFMT_CBS_CFS, | ||
316 | .ops = &spitz_ops, | 292 | .ops = &spitz_ops, |
317 | }; | 293 | }; |
318 | 294 | ||
319 | /* spitz audio machine driver */ | 295 | /* spitz audio machine driver */ |
320 | static struct snd_soc_card snd_soc_spitz = { | 296 | static struct snd_soc_card snd_soc_spitz = { |
321 | .name = "Spitz", | 297 | .name = "Spitz", |
298 | .owner = THIS_MODULE, | ||
322 | .dai_link = &spitz_dai, | 299 | .dai_link = &spitz_dai, |
323 | .num_links = 1, | 300 | .num_links = 1, |
301 | |||
302 | .controls = wm8750_spitz_controls, | ||
303 | .num_controls = ARRAY_SIZE(wm8750_spitz_controls), | ||
304 | .dapm_widgets = wm8750_dapm_widgets, | ||
305 | .num_dapm_widgets = ARRAY_SIZE(wm8750_dapm_widgets), | ||
306 | .dapm_routes = spitz_audio_map, | ||
307 | .num_dapm_routes = ARRAY_SIZE(spitz_audio_map), | ||
324 | }; | 308 | }; |
325 | 309 | ||
326 | static struct platform_device *spitz_snd_device; | 310 | static struct platform_device *spitz_snd_device; |