aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/am3517evm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/omap/am3517evm.c')
-rw-r--r--sound/soc/omap/am3517evm.c50
1 files changed, 7 insertions, 43 deletions
diff --git a/sound/soc/omap/am3517evm.c b/sound/soc/omap/am3517evm.c
index 73dde4a1adc3..8da55e916451 100644
--- a/sound/soc/omap/am3517evm.c
+++ b/sound/soc/omap/am3517evm.c
@@ -43,26 +43,6 @@ static int am3517evm_hw_params(struct snd_pcm_substream *substream,
43 struct snd_soc_dai *cpu_dai = rtd->cpu_dai; 43 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
44 int ret; 44 int ret;
45 45
46 /* Set codec DAI configuration */
47 ret = snd_soc_dai_set_fmt(codec_dai,
48 SND_SOC_DAIFMT_DSP_B |
49 SND_SOC_DAIFMT_NB_NF |
50 SND_SOC_DAIFMT_CBM_CFM);
51 if (ret < 0) {
52 printk(KERN_ERR "can't set codec DAI configuration\n");
53 return ret;
54 }
55
56 /* Set cpu DAI configuration */
57 ret = snd_soc_dai_set_fmt(cpu_dai,
58 SND_SOC_DAIFMT_DSP_B |
59 SND_SOC_DAIFMT_NB_NF |
60 SND_SOC_DAIFMT_CBM_CFM);
61 if (ret < 0) {
62 printk(KERN_ERR "can't set cpu DAI configuration\n");
63 return ret;
64 }
65
66 /* Set the codec system clock for DAC and ADC */ 46 /* Set the codec system clock for DAC and ADC */
67 ret = snd_soc_dai_set_sysclk(codec_dai, 0, 47 ret = snd_soc_dai_set_sysclk(codec_dai, 0,
68 CODEC_CLOCK, SND_SOC_CLOCK_IN); 48 CODEC_CLOCK, SND_SOC_CLOCK_IN);
@@ -110,28 +90,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
110 {"MICIN", NULL, "Mic In"}, 90 {"MICIN", NULL, "Mic In"},
111}; 91};
112 92
113static int am3517evm_aic23_init(struct snd_soc_pcm_runtime *rtd)
114{
115 struct snd_soc_codec *codec = rtd->codec;
116 struct snd_soc_dapm_context *dapm = &codec->dapm;
117
118 /* Add am3517-evm specific widgets */
119 snd_soc_dapm_new_controls(dapm, tlv320aic23_dapm_widgets,
120 ARRAY_SIZE(tlv320aic23_dapm_widgets));
121
122 /* Set up davinci-evm specific audio path audio_map */
123 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
124
125 /* always connected */
126 snd_soc_dapm_enable_pin(dapm, "Line Out");
127 snd_soc_dapm_enable_pin(dapm, "Line In");
128 snd_soc_dapm_enable_pin(dapm, "Mic In");
129
130 snd_soc_dapm_sync(dapm);
131
132 return 0;
133}
134
135/* Digital audio interface glue - connects codec <--> CPU */ 93/* Digital audio interface glue - connects codec <--> CPU */
136static struct snd_soc_dai_link am3517evm_dai = { 94static struct snd_soc_dai_link am3517evm_dai = {
137 .name = "TLV320AIC23", 95 .name = "TLV320AIC23",
@@ -140,7 +98,8 @@ static struct snd_soc_dai_link am3517evm_dai = {
140 .codec_dai_name = "tlv320aic23-hifi", 98 .codec_dai_name = "tlv320aic23-hifi",
141 .platform_name = "omap-pcm-audio", 99 .platform_name = "omap-pcm-audio",
142 .codec_name = "tlv320aic23-codec.2-001a", 100 .codec_name = "tlv320aic23-codec.2-001a",
143 .init = am3517evm_aic23_init, 101 .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF |
102 SND_SOC_DAIFMT_CBM_CFM,
144 .ops = &am3517evm_ops, 103 .ops = &am3517evm_ops,
145}; 104};
146 105
@@ -149,6 +108,11 @@ static struct snd_soc_card snd_soc_am3517evm = {
149 .name = "am3517evm", 108 .name = "am3517evm",
150 .dai_link = &am3517evm_dai, 109 .dai_link = &am3517evm_dai,
151 .num_links = 1, 110 .num_links = 1,
111
112 .dapm_widgets = tlv320aic23_dapm_widgets,
113 .num_dapm_widgets = ARRAY_SIZE(tlv320aic23_dapm_widgets),
114 .dapm_routes = audio_map,
115 .num_dapm_routes = ARRAY_SIZE(audio_map),
152}; 116};
153 117
154static struct platform_device *am3517evm_snd_device; 118static struct platform_device *am3517evm_snd_device;