Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: sound/soc/imx/wm1133-ev1.c

Issue 6577007: CHROMIUM: ASoC: Import entire upstream ASoC tree (Closed)
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sound/soc/imx/phycore-ac97.c ('k') | sound/soc/jz4740/jz4740-i2s.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * wm1133-ev1.c - Audio for WM1133-EV1 on i.MX31ADS 2 * wm1133-ev1.c - Audio for WM1133-EV1 on i.MX31ADS
3 * 3 *
4 * Copyright (c) 2010 Wolfson Microelectronics plc 4 * Copyright (c) 2010 Wolfson Microelectronics plc
5 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 5 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
6 * 6 *
7 * Based on an earlier driver for the same hardware by Liam Girdwood. 7 * Based on an earlier driver for the same hardware by Liam Girdwood.
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify it 9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the 10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version. 12 * option) any later version.
13 */ 13 */
14 14
15 #include <linux/platform_device.h> 15 #include <linux/platform_device.h>
16 #include <linux/clk.h> 16 #include <linux/clk.h>
17 #include <sound/core.h> 17 #include <sound/core.h>
18 #include <sound/jack.h> 18 #include <sound/jack.h>
19 #include <sound/pcm.h> 19 #include <sound/pcm.h>
20 #include <sound/pcm_params.h> 20 #include <sound/pcm_params.h>
21 #include <sound/soc.h> 21 #include <sound/soc.h>
22 #include <sound/soc-dapm.h>
23 22
24 #include <mach/audmux.h> 23 #include <mach/audmux.h>
25 24
26 #include "imx-ssi.h" 25 #include "imx-ssi.h"
27 #include "../codecs/wm8350.h" 26 #include "../codecs/wm8350.h"
28 27
29 /* There is a silicon mic on the board optionally connected via a solder pad 28 /* There is a silicon mic on the board optionally connected via a solder pad
30 * SP1. Define this to enable it. 29 * SP1. Define this to enable it.
31 */ 30 */
32 #undef USE_SIMIC 31 #undef USE_SIMIC
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 static struct snd_soc_jack mic_jack; 205 static struct snd_soc_jack mic_jack;
207 206
208 static struct snd_soc_jack_pin mic_jack_pins[] = { 207 static struct snd_soc_jack_pin mic_jack_pins[] = {
209 { .pin = "Mic1 Jack", .mask = SND_JACK_MICROPHONE }, 208 { .pin = "Mic1 Jack", .mask = SND_JACK_MICROPHONE },
210 { .pin = "Mic2 Jack", .mask = SND_JACK_MICROPHONE }, 209 { .pin = "Mic2 Jack", .mask = SND_JACK_MICROPHONE },
211 }; 210 };
212 211
213 static int wm1133_ev1_init(struct snd_soc_pcm_runtime *rtd) 212 static int wm1133_ev1_init(struct snd_soc_pcm_runtime *rtd)
214 { 213 {
215 struct snd_soc_codec *codec = rtd->codec; 214 struct snd_soc_codec *codec = rtd->codec;
215 struct snd_soc_dapm_context *dapm = &codec->dapm;
216 216
217 » snd_soc_dapm_new_controls(codec, wm1133_ev1_widgets, 217 » snd_soc_dapm_new_controls(dapm, wm1133_ev1_widgets,
218 ARRAY_SIZE(wm1133_ev1_widgets)); 218 ARRAY_SIZE(wm1133_ev1_widgets));
219 219
220 » snd_soc_dapm_add_routes(codec, wm1133_ev1_map, 220 » snd_soc_dapm_add_routes(dapm, wm1133_ev1_map,
221 ARRAY_SIZE(wm1133_ev1_map)); 221 ARRAY_SIZE(wm1133_ev1_map));
222 222
223 /* Headphone jack detection */ 223 /* Headphone jack detection */
224 snd_soc_jack_new(codec, "Headphone", SND_JACK_HEADPHONE, &hp_jack); 224 snd_soc_jack_new(codec, "Headphone", SND_JACK_HEADPHONE, &hp_jack);
225 snd_soc_jack_add_pins(&hp_jack, ARRAY_SIZE(hp_jack_pins), 225 snd_soc_jack_add_pins(&hp_jack, ARRAY_SIZE(hp_jack_pins),
226 hp_jack_pins); 226 hp_jack_pins);
227 wm8350_hp_jack_detect(codec, WM8350_JDR, &hp_jack, SND_JACK_HEADPHONE); 227 wm8350_hp_jack_detect(codec, WM8350_JDR, &hp_jack, SND_JACK_HEADPHONE);
228 228
229 /* Microphone jack detection */ 229 /* Microphone jack detection */
230 snd_soc_jack_new(codec, "Microphone", 230 snd_soc_jack_new(codec, "Microphone",
231 SND_JACK_MICROPHONE | SND_JACK_BTN_0, &mic_jack); 231 SND_JACK_MICROPHONE | SND_JACK_BTN_0, &mic_jack);
232 snd_soc_jack_add_pins(&mic_jack, ARRAY_SIZE(mic_jack_pins), 232 snd_soc_jack_add_pins(&mic_jack, ARRAY_SIZE(mic_jack_pins),
233 mic_jack_pins); 233 mic_jack_pins);
234 wm8350_mic_jack_detect(codec, &mic_jack, SND_JACK_MICROPHONE, 234 wm8350_mic_jack_detect(codec, &mic_jack, SND_JACK_MICROPHONE,
235 SND_JACK_BTN_0); 235 SND_JACK_BTN_0);
236 236
237 » snd_soc_dapm_force_enable_pin(codec, "Mic Bias"); 237 » snd_soc_dapm_force_enable_pin(dapm, "Mic Bias");
238 238
239 return 0; 239 return 0;
240 } 240 }
241 241
242 242
243 static struct snd_soc_dai_link wm1133_ev1_dai = { 243 static struct snd_soc_dai_link wm1133_ev1_dai = {
244 .name = "WM1133-EV1", 244 .name = "WM1133-EV1",
245 .stream_name = "Audio", 245 .stream_name = "Audio",
246 .cpu_dai_name = "imx-ssi.0", 246 .cpu_dai_name = "imx-ssi.0",
247 .codec_dai_name = "wm8350-hifi", 247 .codec_dai_name = "wm8350-hifi",
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 294
295 static void __exit wm1133_ev1_audio_exit(void) 295 static void __exit wm1133_ev1_audio_exit(void)
296 { 296 {
297 platform_device_unregister(wm1133_ev1_snd_device); 297 platform_device_unregister(wm1133_ev1_snd_device);
298 } 298 }
299 module_exit(wm1133_ev1_audio_exit); 299 module_exit(wm1133_ev1_audio_exit);
300 300
301 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); 301 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
302 MODULE_DESCRIPTION("Audio for WM1133-EV1 on i.MX31ADS"); 302 MODULE_DESCRIPTION("Audio for WM1133-EV1 on i.MX31ADS");
303 MODULE_LICENSE("GPL"); 303 MODULE_LICENSE("GPL");
OLDNEW
« no previous file with comments | « sound/soc/imx/phycore-ac97.c ('k') | sound/soc/jz4740/jz4740-i2s.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698