| OLD | NEW |
| 1 /* | 1 /* |
| 2 * e800-wm9712.c -- SoC audio for e800 | 2 * e800-wm9712.c -- SoC audio for e800 |
| 3 * | 3 * |
| 4 * Copyright 2007 (c) Ian Molton <spyro@f2s.com> | 4 * Copyright 2007 (c) Ian Molton <spyro@f2s.com> |
| 5 * | 5 * |
| 6 * This program is free software; you can redistribute it and/or modify it | 6 * This program is free software; you can redistribute it and/or modify it |
| 7 * under the terms of the GNU General Public License as published by the | 7 * under the terms of the GNU General Public License as published by the |
| 8 * Free Software Foundation; version 2 ONLY. | 8 * Free Software Foundation; version 2 ONLY. |
| 9 * | 9 * |
| 10 */ | 10 */ |
| 11 | 11 |
| 12 #include <linux/module.h> | 12 #include <linux/module.h> |
| 13 #include <linux/moduleparam.h> | 13 #include <linux/moduleparam.h> |
| 14 #include <linux/gpio.h> | 14 #include <linux/gpio.h> |
| 15 | 15 |
| 16 #include <sound/core.h> | 16 #include <sound/core.h> |
| 17 #include <sound/pcm.h> | 17 #include <sound/pcm.h> |
| 18 #include <sound/soc.h> | 18 #include <sound/soc.h> |
| 19 #include <sound/soc-dapm.h> | |
| 20 | 19 |
| 21 #include <asm/mach-types.h> | 20 #include <asm/mach-types.h> |
| 22 #include <mach/audio.h> | 21 #include <mach/audio.h> |
| 23 #include <mach/eseries-gpio.h> | 22 #include <mach/eseries-gpio.h> |
| 24 | 23 |
| 25 #include "../codecs/wm9712.h" | 24 #include "../codecs/wm9712.h" |
| 26 #include "pxa2xx-ac97.h" | 25 #include "pxa2xx-ac97.h" |
| 27 | 26 |
| 28 static int e800_spk_amp_event(struct snd_soc_dapm_widget *w, | 27 static int e800_spk_amp_event(struct snd_soc_dapm_widget *w, |
| 29 struct snd_kcontrol *kcontrol, int event) | 28 struct snd_kcontrol *kcontrol, int event) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 {"Speaker Amp", NULL, "MONOOUT"}, | 67 {"Speaker Amp", NULL, "MONOOUT"}, |
| 69 {"Speaker", NULL, "Speaker Amp"}, | 68 {"Speaker", NULL, "Speaker Amp"}, |
| 70 | 69 |
| 71 {"MIC1", NULL, "Mic (Internal1)"}, | 70 {"MIC1", NULL, "Mic (Internal1)"}, |
| 72 {"MIC2", NULL, "Mic (Internal2)"}, | 71 {"MIC2", NULL, "Mic (Internal2)"}, |
| 73 }; | 72 }; |
| 74 | 73 |
| 75 static int e800_ac97_init(struct snd_soc_pcm_runtime *rtd) | 74 static int e800_ac97_init(struct snd_soc_pcm_runtime *rtd) |
| 76 { | 75 { |
| 77 struct snd_soc_codec *codec = rtd->codec; | 76 struct snd_soc_codec *codec = rtd->codec; |
| 77 struct snd_soc_dapm_context *dapm = &codec->dapm; |
| 78 | 78 |
| 79 » snd_soc_dapm_new_controls(codec, e800_dapm_widgets, | 79 » snd_soc_dapm_new_controls(dapm, e800_dapm_widgets, |
| 80 ARRAY_SIZE(e800_dapm_widgets)); | 80 ARRAY_SIZE(e800_dapm_widgets)); |
| 81 | 81 |
| 82 » snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 82 » snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
| 83 » snd_soc_dapm_sync(codec); | 83 » snd_soc_dapm_sync(dapm); |
| 84 | 84 |
| 85 return 0; | 85 return 0; |
| 86 } | 86 } |
| 87 | 87 |
| 88 static struct snd_soc_dai_link e800_dai[] = { | 88 static struct snd_soc_dai_link e800_dai[] = { |
| 89 { | 89 { |
| 90 .name = "AC97", | 90 .name = "AC97", |
| 91 .stream_name = "AC97 HiFi", | 91 .stream_name = "AC97 HiFi", |
| 92 .cpu_dai_name = "pxa-ac97.0", | 92 .cpu_dai_name = "pxa-ac97.0", |
| 93 .codec_dai_name = "wm9712-hifi", | 93 .codec_dai_name = "wm9712-hifi", |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 gpio_free(GPIO_E800_HP_AMP_OFF); | 163 gpio_free(GPIO_E800_HP_AMP_OFF); |
| 164 } | 164 } |
| 165 | 165 |
| 166 module_init(e800_init); | 166 module_init(e800_init); |
| 167 module_exit(e800_exit); | 167 module_exit(e800_exit); |
| 168 | 168 |
| 169 /* Module information */ | 169 /* Module information */ |
| 170 MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); | 170 MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); |
| 171 MODULE_DESCRIPTION("ALSA SoC driver for e800"); | 171 MODULE_DESCRIPTION("ALSA SoC driver for e800"); |
| 172 MODULE_LICENSE("GPL v2"); | 172 MODULE_LICENSE("GPL v2"); |
| OLD | NEW |