| OLD | NEW |
| 1 /* | 1 /* |
| 2 * e740-wm9705.c -- SoC audio for e740 | 2 * e740-wm9705.c -- SoC audio for e740 |
| 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 <mach/audio.h> | 20 #include <mach/audio.h> |
| 22 #include <mach/eseries-gpio.h> | 21 #include <mach/eseries-gpio.h> |
| 23 | 22 |
| 24 #include <asm/mach-types.h> | 23 #include <asm/mach-types.h> |
| 25 | 24 |
| 26 #include "../codecs/wm9705.h" | 25 #include "../codecs/wm9705.h" |
| 27 #include "pxa2xx-ac97.h" | 26 #include "pxa2xx-ac97.h" |
| 28 | 27 |
| 29 | 28 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 {"Speaker", NULL, "Output Amp"}, | 84 {"Speaker", NULL, "Output Amp"}, |
| 86 {"Headphone Jack", NULL, "Output Amp"}, | 85 {"Headphone Jack", NULL, "Output Amp"}, |
| 87 | 86 |
| 88 {"MIC1", NULL, "Mic Amp"}, | 87 {"MIC1", NULL, "Mic Amp"}, |
| 89 {"Mic Amp", NULL, "Mic (Internal)"}, | 88 {"Mic Amp", NULL, "Mic (Internal)"}, |
| 90 }; | 89 }; |
| 91 | 90 |
| 92 static int e740_ac97_init(struct snd_soc_pcm_runtime *rtd) | 91 static int e740_ac97_init(struct snd_soc_pcm_runtime *rtd) |
| 93 { | 92 { |
| 94 struct snd_soc_codec *codec = rtd->codec; | 93 struct snd_soc_codec *codec = rtd->codec; |
| 94 struct snd_soc_dapm_context *dapm = &codec->dapm; |
| 95 | 95 |
| 96 » snd_soc_dapm_nc_pin(codec, "HPOUTL"); | 96 » snd_soc_dapm_nc_pin(dapm, "HPOUTL"); |
| 97 » snd_soc_dapm_nc_pin(codec, "HPOUTR"); | 97 » snd_soc_dapm_nc_pin(dapm, "HPOUTR"); |
| 98 » snd_soc_dapm_nc_pin(codec, "PHONE"); | 98 » snd_soc_dapm_nc_pin(dapm, "PHONE"); |
| 99 » snd_soc_dapm_nc_pin(codec, "LINEINL"); | 99 » snd_soc_dapm_nc_pin(dapm, "LINEINL"); |
| 100 » snd_soc_dapm_nc_pin(codec, "LINEINR"); | 100 » snd_soc_dapm_nc_pin(dapm, "LINEINR"); |
| 101 » snd_soc_dapm_nc_pin(codec, "CDINL"); | 101 » snd_soc_dapm_nc_pin(dapm, "CDINL"); |
| 102 » snd_soc_dapm_nc_pin(codec, "CDINR"); | 102 » snd_soc_dapm_nc_pin(dapm, "CDINR"); |
| 103 » snd_soc_dapm_nc_pin(codec, "PCBEEP"); | 103 » snd_soc_dapm_nc_pin(dapm, "PCBEEP"); |
| 104 » snd_soc_dapm_nc_pin(codec, "MIC2"); | 104 » snd_soc_dapm_nc_pin(dapm, "MIC2"); |
| 105 | 105 |
| 106 » snd_soc_dapm_new_controls(codec, e740_dapm_widgets, | 106 » snd_soc_dapm_new_controls(dapm, e740_dapm_widgets, |
| 107 ARRAY_SIZE(e740_dapm_widgets)); | 107 ARRAY_SIZE(e740_dapm_widgets)); |
| 108 | 108 |
| 109 » snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 109 » snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
| 110 | 110 |
| 111 » snd_soc_dapm_sync(codec); | 111 » snd_soc_dapm_sync(dapm); |
| 112 | 112 |
| 113 return 0; | 113 return 0; |
| 114 } | 114 } |
| 115 | 115 |
| 116 static struct snd_soc_dai_link e740_dai[] = { | 116 static struct snd_soc_dai_link e740_dai[] = { |
| 117 { | 117 { |
| 118 .name = "AC97", | 118 .name = "AC97", |
| 119 .stream_name = "AC97 HiFi", | 119 .stream_name = "AC97 HiFi", |
| 120 .cpu_dai_name = "pxa-ac97.0", | 120 .cpu_dai_name = "pxa-ac97.0", |
| 121 .codec_dai_name = "wm9705-hifi", | 121 .codec_dai_name = "wm9705-hifi", |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 gpio_free(GPIO_E740_MIC_ON); | 203 gpio_free(GPIO_E740_MIC_ON); |
| 204 } | 204 } |
| 205 | 205 |
| 206 module_init(e740_init); | 206 module_init(e740_init); |
| 207 module_exit(e740_exit); | 207 module_exit(e740_exit); |
| 208 | 208 |
| 209 /* Module information */ | 209 /* Module information */ |
| 210 MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); | 210 MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); |
| 211 MODULE_DESCRIPTION("ALSA SoC driver for e740"); | 211 MODULE_DESCRIPTION("ALSA SoC driver for e740"); |
| 212 MODULE_LICENSE("GPL v2"); | 212 MODULE_LICENSE("GPL v2"); |
| OLD | NEW |