| OLD | NEW |
| 1 /* sound/soc/s3c24xx/s3c24xx_simtec_hermes.c | 1 /* sound/soc/samsung/s3c24xx_simtec_hermes.c |
| 2 * | 2 * |
| 3 * Copyright 2009 Simtec Electronics | 3 * Copyright 2009 Simtec Electronics |
| 4 * | 4 * |
| 5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 #include <linux/module.h> | 10 #include <sound/soc.h> |
| 11 #include <linux/clk.h> | |
| 12 #include <linux/platform_device.h> | |
| 13 | 11 |
| 14 #include <sound/core.h> | |
| 15 #include <sound/pcm.h> | |
| 16 #include <sound/soc.h> | |
| 17 #include <sound/soc-dapm.h> | |
| 18 | |
| 19 #include <plat/audio-simtec.h> | |
| 20 | |
| 21 #include "s3c-dma.h" | |
| 22 #include "s3c24xx-i2s.h" | |
| 23 #include "s3c24xx_simtec.h" | 12 #include "s3c24xx_simtec.h" |
| 24 | 13 |
| 25 #include "../codecs/tlv320aic3x.h" | |
| 26 | |
| 27 static const struct snd_soc_dapm_widget dapm_widgets[] = { | 14 static const struct snd_soc_dapm_widget dapm_widgets[] = { |
| 28 SND_SOC_DAPM_LINE("GSM Out", NULL), | 15 SND_SOC_DAPM_LINE("GSM Out", NULL), |
| 29 SND_SOC_DAPM_LINE("GSM In", NULL), | 16 SND_SOC_DAPM_LINE("GSM In", NULL), |
| 30 SND_SOC_DAPM_LINE("Line In", NULL), | 17 SND_SOC_DAPM_LINE("Line In", NULL), |
| 31 SND_SOC_DAPM_LINE("Line Out", NULL), | 18 SND_SOC_DAPM_LINE("Line Out", NULL), |
| 32 SND_SOC_DAPM_LINE("ZV", NULL), | 19 SND_SOC_DAPM_LINE("ZV", NULL), |
| 33 SND_SOC_DAPM_MIC("Mic Jack", NULL), | 20 SND_SOC_DAPM_MIC("Mic Jack", NULL), |
| 34 SND_SOC_DAPM_HP("Headphone Jack", NULL), | 21 SND_SOC_DAPM_HP("Headphone Jack", NULL), |
| 35 }; | 22 }; |
| 36 | 23 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 /** | 56 /** |
| 70 * simtec_hermes_init - initialise and add controls | 57 * simtec_hermes_init - initialise and add controls |
| 71 * @codec; The codec instance to attach to. | 58 * @codec; The codec instance to attach to. |
| 72 * | 59 * |
| 73 * Attach our controls and configure the necessary codec | 60 * Attach our controls and configure the necessary codec |
| 74 * mappings for our sound card instance. | 61 * mappings for our sound card instance. |
| 75 */ | 62 */ |
| 76 static int simtec_hermes_init(struct snd_soc_pcm_runtime *rtd) | 63 static int simtec_hermes_init(struct snd_soc_pcm_runtime *rtd) |
| 77 { | 64 { |
| 78 struct snd_soc_codec *codec = rtd->codec; | 65 struct snd_soc_codec *codec = rtd->codec; |
| 66 struct snd_soc_dapm_context *dapm = &codec->dapm; |
| 79 | 67 |
| 80 » snd_soc_dapm_new_controls(codec, dapm_widgets, | 68 » snd_soc_dapm_new_controls(dapm, dapm_widgets, |
| 81 ARRAY_SIZE(dapm_widgets)); | 69 ARRAY_SIZE(dapm_widgets)); |
| 82 | 70 |
| 83 » snd_soc_dapm_add_routes(codec, base_map, ARRAY_SIZE(base_map)); | 71 » snd_soc_dapm_add_routes(dapm, base_map, ARRAY_SIZE(base_map)); |
| 84 | 72 |
| 85 » snd_soc_dapm_enable_pin(codec, "Headphone Jack"); | 73 » snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); |
| 86 » snd_soc_dapm_enable_pin(codec, "Line In"); | 74 » snd_soc_dapm_enable_pin(dapm, "Line In"); |
| 87 » snd_soc_dapm_enable_pin(codec, "Line Out"); | 75 » snd_soc_dapm_enable_pin(dapm, "Line Out"); |
| 88 » snd_soc_dapm_enable_pin(codec, "Mic Jack"); | 76 » snd_soc_dapm_enable_pin(dapm, "Mic Jack"); |
| 89 | 77 |
| 90 simtec_audio_init(rtd); | 78 simtec_audio_init(rtd); |
| 91 » snd_soc_dapm_sync(codec); | 79 » snd_soc_dapm_sync(dapm); |
| 92 | 80 |
| 93 return 0; | 81 return 0; |
| 94 } | 82 } |
| 95 | 83 |
| 96 static struct snd_soc_dai_link simtec_dai_aic33 = { | 84 static struct snd_soc_dai_link simtec_dai_aic33 = { |
| 97 .name = "tlv320aic33", | 85 .name = "tlv320aic33", |
| 98 .stream_name = "TLV320AIC33", | 86 .stream_name = "TLV320AIC33", |
| 99 » .codec_name» = "tlv320aic3x-codec.0-0x1a", | 87 » .codec_name» = "tlv320aic3x-codec.0-001a", |
| 100 » .cpu_dai_name» = "s3c24xx-i2s", | 88 » .cpu_dai_name» = "s3c24xx-iis", |
| 101 .codec_dai_name = "tlv320aic3x-hifi", | 89 .codec_dai_name = "tlv320aic3x-hifi", |
| 102 » .platform_name» = "s3c24xx-pcm-audio", | 90 » .platform_name» = "samsung-audio", |
| 103 .init = simtec_hermes_init, | 91 .init = simtec_hermes_init, |
| 104 }; | 92 }; |
| 105 | 93 |
| 106 /* simtec audio machine driver */ | 94 /* simtec audio machine driver */ |
| 107 static struct snd_soc_card snd_soc_machine_simtec_aic33 = { | 95 static struct snd_soc_card snd_soc_machine_simtec_aic33 = { |
| 108 .name = "Simtec-Hermes", | 96 .name = "Simtec-Hermes", |
| 109 .dai_link = &simtec_dai_aic33, | 97 .dai_link = &simtec_dai_aic33, |
| 110 .num_links = 1, | 98 .num_links = 1, |
| 111 }; | 99 }; |
| 112 | 100 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 137 { | 125 { |
| 138 platform_driver_unregister(&simtec_audio_hermes_platdrv); | 126 platform_driver_unregister(&simtec_audio_hermes_platdrv); |
| 139 } | 127 } |
| 140 | 128 |
| 141 module_init(simtec_hermes_modinit); | 129 module_init(simtec_hermes_modinit); |
| 142 module_exit(simtec_hermes_modexit); | 130 module_exit(simtec_hermes_modexit); |
| 143 | 131 |
| 144 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); | 132 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); |
| 145 MODULE_DESCRIPTION("ALSA SoC Simtec Audio support"); | 133 MODULE_DESCRIPTION("ALSA SoC Simtec Audio support"); |
| 146 MODULE_LICENSE("GPL"); | 134 MODULE_LICENSE("GPL"); |
| OLD | NEW |