0001
0002
0003
0004
0005 #include <linux/module.h>
0006 #include <sound/soc.h>
0007
0008 #include "s3c24xx_simtec.h"
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 static const struct snd_soc_dapm_widget dapm_widgets[] = {
0022 SND_SOC_DAPM_HP("Headphone Jack", NULL),
0023 SND_SOC_DAPM_LINE("Line In", NULL),
0024 SND_SOC_DAPM_LINE("Line Out", NULL),
0025 SND_SOC_DAPM_MIC("Mic Jack", NULL),
0026 };
0027
0028 static const struct snd_soc_dapm_route base_map[] = {
0029 { "Headphone Jack", NULL, "LHPOUT"},
0030 { "Headphone Jack", NULL, "RHPOUT"},
0031
0032 { "Line Out", NULL, "LOUT" },
0033 { "Line Out", NULL, "ROUT" },
0034
0035 { "LLINEIN", NULL, "Line In"},
0036 { "RLINEIN", NULL, "Line In"},
0037
0038 { "MICIN", NULL, "Mic Jack"},
0039 };
0040
0041
0042
0043
0044
0045
0046
0047
0048 static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
0049 {
0050 simtec_audio_init(rtd);
0051
0052 return 0;
0053 }
0054
0055 SND_SOC_DAILINK_DEFS(tlv320aic23,
0056 DAILINK_COMP_ARRAY(COMP_CPU("s3c24xx-iis")),
0057 DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.0-001a",
0058 "tlv320aic3x-hifi")),
0059 DAILINK_COMP_ARRAY(COMP_PLATFORM("s3c24xx-iis")));
0060
0061 static struct snd_soc_dai_link simtec_dai_aic23 = {
0062 .name = "tlv320aic23",
0063 .stream_name = "TLV320AIC23",
0064 .init = simtec_tlv320aic23_init,
0065 SND_SOC_DAILINK_REG(tlv320aic23),
0066 };
0067
0068
0069 static struct snd_soc_card snd_soc_machine_simtec_aic23 = {
0070 .name = "Simtec",
0071 .owner = THIS_MODULE,
0072 .dai_link = &simtec_dai_aic23,
0073 .num_links = 1,
0074
0075 .dapm_widgets = dapm_widgets,
0076 .num_dapm_widgets = ARRAY_SIZE(dapm_widgets),
0077 .dapm_routes = base_map,
0078 .num_dapm_routes = ARRAY_SIZE(base_map),
0079 };
0080
0081 static int simtec_audio_tlv320aic23_probe(struct platform_device *pd)
0082 {
0083 return simtec_audio_core_probe(pd, &snd_soc_machine_simtec_aic23);
0084 }
0085
0086 static struct platform_driver simtec_audio_tlv320aic23_driver = {
0087 .driver = {
0088 .name = "s3c24xx-simtec-tlv320aic23",
0089 .pm = simtec_audio_pm,
0090 },
0091 .probe = simtec_audio_tlv320aic23_probe,
0092 .remove = simtec_audio_remove,
0093 };
0094
0095 module_platform_driver(simtec_audio_tlv320aic23_driver);
0096
0097 MODULE_ALIAS("platform:s3c24xx-simtec-tlv320aic23");
0098 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
0099 MODULE_DESCRIPTION("ALSA SoC Simtec Audio support");
0100 MODULE_LICENSE("GPL");