1
2
3
4
5
6
7
8
9
10#include <linux/module.h>
11#include <sound/soc.h>
12
13#include "s3c24xx_simtec.h"
14
15static const struct snd_soc_dapm_widget dapm_widgets[] = {
16 SND_SOC_DAPM_LINE("GSM Out", NULL),
17 SND_SOC_DAPM_LINE("GSM In", NULL),
18 SND_SOC_DAPM_LINE("Line In", NULL),
19 SND_SOC_DAPM_LINE("Line Out", NULL),
20 SND_SOC_DAPM_LINE("ZV", NULL),
21 SND_SOC_DAPM_MIC("Mic Jack", NULL),
22 SND_SOC_DAPM_HP("Headphone Jack", NULL),
23};
24
25static const struct snd_soc_dapm_route base_map[] = {
26
27
28 { "Headphone Jack", NULL, "HPLOUT" },
29 { "Headphone Jack", NULL, "HPLCOM" },
30 { "Headphone Jack", NULL, "HPROUT" },
31 { "Headphone Jack", NULL, "HPRCOM" },
32
33
34
35 { "LINE1L", NULL, "ZV" },
36 { "LINE1R", NULL, "ZV" },
37
38
39
40 { "LINE2L", NULL, "Line In" },
41 { "LINE2R", NULL, "Line In" },
42
43
44
45 { "MIC3L", NULL, "Mic Jack" },
46
47
48
49 { "GSM Out", NULL, "MONO_LOUT" },
50 { "MIC3L", NULL, "GSM In" },
51
52
53
54
55};
56
57
58
59
60
61
62
63
64static int simtec_hermes_init(struct snd_soc_pcm_runtime *rtd)
65{
66 struct snd_soc_codec *codec = rtd->codec;
67 struct snd_soc_dapm_context *dapm = &codec->dapm;
68
69 snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
70 snd_soc_dapm_enable_pin(dapm, "Line In");
71 snd_soc_dapm_enable_pin(dapm, "Line Out");
72 snd_soc_dapm_enable_pin(dapm, "Mic Jack");
73
74 simtec_audio_init(rtd);
75
76 return 0;
77}
78
79static struct snd_soc_dai_link simtec_dai_aic33 = {
80 .name = "tlv320aic33",
81 .stream_name = "TLV320AIC33",
82 .codec_name = "tlv320aic3x-codec.0-001a",
83 .cpu_dai_name = "s3c24xx-iis",
84 .codec_dai_name = "tlv320aic3x-hifi",
85 .platform_name = "s3c24xx-iis",
86 .init = simtec_hermes_init,
87};
88
89
90static struct snd_soc_card snd_soc_machine_simtec_aic33 = {
91 .name = "Simtec-Hermes",
92 .owner = THIS_MODULE,
93 .dai_link = &simtec_dai_aic33,
94 .num_links = 1,
95
96 .dapm_widgets = dapm_widgets,
97 .num_dapm_widgets = ARRAY_SIZE(dapm_widgets),
98 .dapm_routes = base_map,
99 .num_dapm_routes = ARRAY_SIZE(base_map),
100};
101
102static int simtec_audio_hermes_probe(struct platform_device *pd)
103{
104 dev_info(&pd->dev, "probing....\n");
105 return simtec_audio_core_probe(pd, &snd_soc_machine_simtec_aic33);
106}
107
108static struct platform_driver simtec_audio_hermes_platdrv = {
109 .driver = {
110 .owner = THIS_MODULE,
111 .name = "s3c24xx-simtec-hermes-snd",
112 .pm = simtec_audio_pm,
113 },
114 .probe = simtec_audio_hermes_probe,
115 .remove = simtec_audio_remove,
116};
117
118module_platform_driver(simtec_audio_hermes_platdrv);
119
120MODULE_ALIAS("platform:s3c24xx-simtec-hermes-snd");
121MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
122MODULE_DESCRIPTION("ALSA SoC Simtec Audio support");
123MODULE_LICENSE("GPL");
124