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
15
16
17
18
19
20
21
22
23
24
25
26static const struct snd_soc_dapm_widget dapm_widgets[] = {
27 SND_SOC_DAPM_HP("Headphone Jack", NULL),
28 SND_SOC_DAPM_LINE("Line In", NULL),
29 SND_SOC_DAPM_LINE("Line Out", NULL),
30 SND_SOC_DAPM_MIC("Mic Jack", NULL),
31};
32
33static const struct snd_soc_dapm_route base_map[] = {
34 { "Headphone Jack", NULL, "LHPOUT"},
35 { "Headphone Jack", NULL, "RHPOUT"},
36
37 { "Line Out", NULL, "LOUT" },
38 { "Line Out", NULL, "ROUT" },
39
40 { "LLINEIN", NULL, "Line In"},
41 { "RLINEIN", NULL, "Line In"},
42
43 { "MICIN", NULL, "Mic Jack"},
44};
45
46
47
48
49
50
51
52
53static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
54{
55 struct snd_soc_codec *codec = rtd->codec;
56 struct snd_soc_dapm_context *dapm = &codec->dapm;
57
58 snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
59 snd_soc_dapm_enable_pin(dapm, "Line In");
60 snd_soc_dapm_enable_pin(dapm, "Line Out");
61 snd_soc_dapm_enable_pin(dapm, "Mic Jack");
62
63 simtec_audio_init(rtd);
64
65 return 0;
66}
67
68static struct snd_soc_dai_link simtec_dai_aic23 = {
69 .name = "tlv320aic23",
70 .stream_name = "TLV320AIC23",
71 .codec_name = "tlv320aic3x-codec.0-001a",
72 .cpu_dai_name = "s3c24xx-iis",
73 .codec_dai_name = "tlv320aic3x-hifi",
74 .platform_name = "s3c24xx-iis",
75 .init = simtec_tlv320aic23_init,
76};
77
78
79static struct snd_soc_card snd_soc_machine_simtec_aic23 = {
80 .name = "Simtec",
81 .owner = THIS_MODULE,
82 .dai_link = &simtec_dai_aic23,
83 .num_links = 1,
84
85 .dapm_widgets = dapm_widgets,
86 .num_dapm_widgets = ARRAY_SIZE(dapm_widgets),
87 .dapm_routes = base_map,
88 .num_dapm_routes = ARRAY_SIZE(base_map),
89};
90
91static int simtec_audio_tlv320aic23_probe(struct platform_device *pd)
92{
93 return simtec_audio_core_probe(pd, &snd_soc_machine_simtec_aic23);
94}
95
96static struct platform_driver simtec_audio_tlv320aic23_driver = {
97 .driver = {
98 .owner = THIS_MODULE,
99 .name = "s3c24xx-simtec-tlv320aic23",
100 .pm = simtec_audio_pm,
101 },
102 .probe = simtec_audio_tlv320aic23_probe,
103 .remove = simtec_audio_remove,
104};
105
106module_platform_driver(simtec_audio_tlv320aic23_driver);
107
108MODULE_ALIAS("platform:s3c24xx-simtec-tlv320aic23");
109MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
110MODULE_DESCRIPTION("ALSA SoC Simtec Audio support");
111MODULE_LICENSE("GPL");
112