blob: 2f8161c1d5f0f438c4e7f1415a4545bba4145a5b [file] [log] [blame]
Vladimir Barinov310355c2008-02-18 11:40:22 +01001/*
2 * ASoC driver for TI DAVINCI EVM platform
3 *
Vladimir Barinovd6b52032008-09-29 23:14:11 +04004 * Author: Vladimir Barinov, <vbarinov@embeddedalley.com>
Vladimir Barinov310355c2008-02-18 11:40:22 +01005 * Copyright: (C) 2007 MontaVista Software, Inc., <source@mvista.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/module.h>
13#include <linux/moduleparam.h>
14#include <linux/timer.h>
15#include <linux/interrupt.h>
16#include <linux/platform_device.h>
Matt Porter3ad7a422013-03-06 11:15:31 -050017#include <linux/platform_data/edma.h>
Ben Dooksaa6b9042009-08-20 22:50:42 +010018#include <linux/i2c.h>
Vladimir Barinov310355c2008-02-18 11:40:22 +010019#include <sound/core.h>
20#include <sound/pcm.h>
21#include <sound/soc.h>
Vladimir Barinov310355c2008-02-18 11:40:22 +010022
Vladimir Barinov310355c2008-02-18 11:40:22 +010023#include <asm/dma.h>
David Brownellf492ec92009-05-14 13:01:59 -070024#include <asm/mach-types.h>
25
Vladimir Barinov310355c2008-02-18 11:40:22 +010026#include "davinci-pcm.h"
27#include "davinci-i2s.h"
Chaithrika U S04f80f52009-06-05 06:28:49 -040028#include "davinci-mcasp.h"
Vladimir Barinov310355c2008-02-18 11:40:22 +010029
Jyri Sarhabcf25562013-09-17 12:26:00 +030030struct snd_soc_card_drvdata_davinci {
31 unsigned sysclk;
32};
33
Troy Kiskyd6f83392008-12-19 13:05:25 -070034#define AUDIO_FORMAT (SND_SOC_DAIFMT_DSP_B | \
35 SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF)
Vladimir Barinov310355c2008-02-18 11:40:22 +010036static int evm_hw_params(struct snd_pcm_substream *substream,
37 struct snd_pcm_hw_params *params)
38{
39 struct snd_soc_pcm_runtime *rtd = substream->private_data;
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +000040 struct snd_soc_dai *codec_dai = rtd->codec_dai;
41 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
Jyri Sarhabcf25562013-09-17 12:26:00 +030042 struct snd_soc_codec *codec = rtd->codec;
43 struct snd_soc_card *soc_card = codec->card;
Vladimir Barinov310355c2008-02-18 11:40:22 +010044 int ret = 0;
Jyri Sarhabcf25562013-09-17 12:26:00 +030045 unsigned sysclk = ((struct snd_soc_card_drvdata_davinci *)
46 snd_soc_card_get_drvdata(soc_card))->sysclk;
Vladimir Barinov310355c2008-02-18 11:40:22 +010047
48 /* set codec DAI configuration */
Troy Kisky9e031622008-12-19 13:05:23 -070049 ret = snd_soc_dai_set_fmt(codec_dai, AUDIO_FORMAT);
Vladimir Barinov310355c2008-02-18 11:40:22 +010050 if (ret < 0)
51 return ret;
52
53 /* set cpu DAI configuration */
Troy Kisky9e031622008-12-19 13:05:23 -070054 ret = snd_soc_dai_set_fmt(cpu_dai, AUDIO_FORMAT);
Vladimir Barinov310355c2008-02-18 11:40:22 +010055 if (ret < 0)
56 return ret;
57
58 /* set the codec system clock */
David Brownell05d5e992009-01-04 02:50:10 -080059 ret = snd_soc_dai_set_sysclk(codec_dai, 0, sysclk, SND_SOC_CLOCK_OUT);
Vladimir Barinov310355c2008-02-18 11:40:22 +010060 if (ret < 0)
61 return ret;
62
Daniel Mack5b66aa22012-10-04 15:08:41 +020063 /* set the CPU system clock */
64 ret = snd_soc_dai_set_sysclk(cpu_dai, 0, sysclk, SND_SOC_CLOCK_OUT);
65 if (ret < 0)
66 return ret;
67
Vladimir Barinov310355c2008-02-18 11:40:22 +010068 return 0;
69}
70
Chaithrika U S8d43d1b2010-03-10 14:48:33 +053071static int evm_spdif_hw_params(struct snd_pcm_substream *substream,
72 struct snd_pcm_hw_params *params)
73{
74 struct snd_soc_pcm_runtime *rtd = substream->private_data;
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +000075 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
Chaithrika U S8d43d1b2010-03-10 14:48:33 +053076
77 /* set cpu DAI configuration */
78 return snd_soc_dai_set_fmt(cpu_dai, AUDIO_FORMAT);
79}
80
Vladimir Barinov310355c2008-02-18 11:40:22 +010081static struct snd_soc_ops evm_ops = {
82 .hw_params = evm_hw_params,
83};
84
Chaithrika U S8d43d1b2010-03-10 14:48:33 +053085static struct snd_soc_ops evm_spdif_ops = {
86 .hw_params = evm_spdif_hw_params,
87};
88
Vladimir Barinov310355c2008-02-18 11:40:22 +010089/* davinci-evm machine dapm widgets */
90static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = {
91 SND_SOC_DAPM_HP("Headphone Jack", NULL),
92 SND_SOC_DAPM_LINE("Line Out", NULL),
93 SND_SOC_DAPM_MIC("Mic Jack", NULL),
94 SND_SOC_DAPM_LINE("Line In", NULL),
95};
96
97/* davinci-evm machine audio_mapnections to the codec pins */
Mark Brownacf497f2008-05-13 14:58:30 +020098static const struct snd_soc_dapm_route audio_map[] = {
Vladimir Barinov310355c2008-02-18 11:40:22 +010099 /* Headphone connected to HPLOUT, HPROUT */
100 {"Headphone Jack", NULL, "HPLOUT"},
101 {"Headphone Jack", NULL, "HPROUT"},
102
103 /* Line Out connected to LLOUT, RLOUT */
104 {"Line Out", NULL, "LLOUT"},
105 {"Line Out", NULL, "RLOUT"},
106
107 /* Mic connected to (MIC3L | MIC3R) */
Hebbar Gururajae2e8bfd2013-01-31 18:23:04 +0530108 {"MIC3L", NULL, "Mic Bias"},
109 {"MIC3R", NULL, "Mic Bias"},
110 {"Mic Bias", NULL, "Mic Jack"},
Vladimir Barinov310355c2008-02-18 11:40:22 +0100111
112 /* Line In connected to (LINE1L | LINE2L), (LINE1R | LINE2R) */
113 {"LINE1L", NULL, "Line In"},
114 {"LINE2L", NULL, "Line In"},
115 {"LINE1R", NULL, "Line In"},
116 {"LINE2R", NULL, "Line In"},
Vladimir Barinov310355c2008-02-18 11:40:22 +0100117};
118
119/* Logic for a aic3x as connected on a davinci-evm */
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000120static int evm_aic3x_init(struct snd_soc_pcm_runtime *rtd)
Vladimir Barinov310355c2008-02-18 11:40:22 +0100121{
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000122 struct snd_soc_codec *codec = rtd->codec;
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200123 struct snd_soc_dapm_context *dapm = &codec->dapm;
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000124
Vladimir Barinov310355c2008-02-18 11:40:22 +0100125 /* Add davinci-evm specific widgets */
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200126 snd_soc_dapm_new_controls(dapm, aic3x_dapm_widgets,
Mark Brownacf497f2008-05-13 14:58:30 +0200127 ARRAY_SIZE(aic3x_dapm_widgets));
Vladimir Barinov310355c2008-02-18 11:40:22 +0100128
129 /* Set up davinci-evm specific audio path audio_map */
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200130 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
Vladimir Barinov310355c2008-02-18 11:40:22 +0100131
132 /* not connected */
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200133 snd_soc_dapm_disable_pin(dapm, "MONO_LOUT");
134 snd_soc_dapm_disable_pin(dapm, "HPLCOM");
135 snd_soc_dapm_disable_pin(dapm, "HPRCOM");
Vladimir Barinov310355c2008-02-18 11:40:22 +0100136
137 /* always connected */
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200138 snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
139 snd_soc_dapm_enable_pin(dapm, "Line Out");
140 snd_soc_dapm_enable_pin(dapm, "Mic Jack");
141 snd_soc_dapm_enable_pin(dapm, "Line In");
Vladimir Barinov310355c2008-02-18 11:40:22 +0100142
Vladimir Barinov310355c2008-02-18 11:40:22 +0100143 return 0;
144}
145
146/* davinci-evm digital audio interface glue - connects codec <--> CPU */
Chris Paulson-Ellisbedad0c2010-11-16 12:27:09 +0000147static struct snd_soc_dai_link dm6446_evm_dai = {
Vladimir Barinov310355c2008-02-18 11:40:22 +0100148 .name = "TLV320AIC3X",
149 .stream_name = "AIC3X",
Chris Paulson-Ellisbedad0c2010-11-16 12:27:09 +0000150 .cpu_dai_name = "davinci-mcbsp",
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000151 .codec_dai_name = "tlv320aic3x-hifi",
Chris Paulson-Ellisbedad0c2010-11-16 12:27:09 +0000152 .codec_name = "tlv320aic3x-codec.1-001b",
Hebbar, Gururajaf08095a2012-08-27 18:56:39 +0530153 .platform_name = "davinci-mcbsp",
Chris Paulson-Ellisbedad0c2010-11-16 12:27:09 +0000154 .init = evm_aic3x_init,
155 .ops = &evm_ops,
156};
157
158static struct snd_soc_dai_link dm355_evm_dai = {
159 .name = "TLV320AIC3X",
160 .stream_name = "AIC3X",
161 .cpu_dai_name = "davinci-mcbsp.1",
162 .codec_dai_name = "tlv320aic3x-hifi",
163 .codec_name = "tlv320aic3x-codec.1-001b",
Hebbar, Gururajaf08095a2012-08-27 18:56:39 +0530164 .platform_name = "davinci-mcbsp.1",
Vladimir Barinov310355c2008-02-18 11:40:22 +0100165 .init = evm_aic3x_init,
166 .ops = &evm_ops,
167};
168
Miguel Aguilaraa9b88e2010-03-11 09:33:40 -0600169static struct snd_soc_dai_link dm365_evm_dai = {
170#ifdef CONFIG_SND_DM365_AIC3X_CODEC
171 .name = "TLV320AIC3X",
172 .stream_name = "AIC3X",
Chris Paulson-Ellisbedad0c2010-11-16 12:27:09 +0000173 .cpu_dai_name = "davinci-mcbsp",
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000174 .codec_dai_name = "tlv320aic3x-hifi",
Miguel Aguilaraa9b88e2010-03-11 09:33:40 -0600175 .init = evm_aic3x_init,
Chris Paulson-Ellisbedad0c2010-11-16 12:27:09 +0000176 .codec_name = "tlv320aic3x-codec.1-0018",
Miguel Aguilaraa9b88e2010-03-11 09:33:40 -0600177 .ops = &evm_ops,
Hebbar, Gururajaf08095a2012-08-27 18:56:39 +0530178 .platform_name = "davinci-mcbsp",
Miguel Aguilaraa9b88e2010-03-11 09:33:40 -0600179#elif defined(CONFIG_SND_DM365_VOICE_CODEC)
180 .name = "Voice Codec - CQ93VC",
181 .stream_name = "CQ93",
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000182 .cpu_dai_name = "davinci-vcif",
183 .codec_dai_name = "cq93vc-hifi",
184 .codec_name = "cq93vc-codec",
Hebbar, Gururajaffb690d2012-08-31 18:20:59 +0530185 .platform_name = "davinci-vcif",
Miguel Aguilaraa9b88e2010-03-11 09:33:40 -0600186#endif
187};
188
Chaithrika U S04f80f52009-06-05 06:28:49 -0400189static struct snd_soc_dai_link dm6467_evm_dai[] = {
190 {
191 .name = "TLV320AIC3X",
192 .stream_name = "AIC3X",
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000193 .cpu_dai_name= "davinci-mcasp.0",
194 .codec_dai_name = "tlv320aic3x-hifi",
Hebbar, Gururajaf08095a2012-08-27 18:56:39 +0530195 .platform_name = "davinci-mcasp.0",
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000196 .codec_name = "tlv320aic3x-codec.0-001a",
Chaithrika U S04f80f52009-06-05 06:28:49 -0400197 .init = evm_aic3x_init,
198 .ops = &evm_ops,
199 },
200 {
201 .name = "McASP",
202 .stream_name = "spdif",
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000203 .cpu_dai_name= "davinci-mcasp.1",
204 .codec_dai_name = "dit-hifi",
205 .codec_name = "spdif_dit",
Hebbar, Gururajaf08095a2012-08-27 18:56:39 +0530206 .platform_name = "davinci-mcasp.1",
Chaithrika U S8d43d1b2010-03-10 14:48:33 +0530207 .ops = &evm_spdif_ops,
Chaithrika U S04f80f52009-06-05 06:28:49 -0400208 },
209};
Vaibhav Bediaf9eb9dd2011-02-03 16:42:25 +0530210
211static struct snd_soc_dai_link da830_evm_dai = {
212 .name = "TLV320AIC3X",
213 .stream_name = "AIC3X",
214 .cpu_dai_name = "davinci-mcasp.1",
215 .codec_dai_name = "tlv320aic3x-hifi",
216 .codec_name = "tlv320aic3x-codec.1-0018",
Hebbar, Gururajaf08095a2012-08-27 18:56:39 +0530217 .platform_name = "davinci-mcasp.1",
Vaibhav Bediaf9eb9dd2011-02-03 16:42:25 +0530218 .init = evm_aic3x_init,
219 .ops = &evm_ops,
220};
221
222static struct snd_soc_dai_link da850_evm_dai = {
Chaithrika U S7ae59452009-08-07 10:07:51 -0400223 .name = "TLV320AIC3X",
224 .stream_name = "AIC3X",
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000225 .cpu_dai_name= "davinci-mcasp.0",
226 .codec_dai_name = "tlv320aic3x-hifi",
Rajashekhara, Sudhakardc5a4602011-01-21 20:10:01 +0530227 .codec_name = "tlv320aic3x-codec.1-0018",
Hebbar, Gururajaf08095a2012-08-27 18:56:39 +0530228 .platform_name = "davinci-mcasp.0",
Chaithrika U S7ae59452009-08-07 10:07:51 -0400229 .init = evm_aic3x_init,
230 .ops = &evm_ops,
231};
Chaithrika U S04f80f52009-06-05 06:28:49 -0400232
Chris Paulson-Ellisbedad0c2010-11-16 12:27:09 +0000233/* davinci dm6446 evm audio machine driver */
Jyri Sarhabcf25562013-09-17 12:26:00 +0300234/*
235 * ASP0 in DM6446 EVM is clocked by U55, as configured by
236 * board-dm644x-evm.c using GPIOs from U18. There are six
237 * options; here we "know" we use a 48 KHz sample rate.
238 */
239static struct snd_soc_card_drvdata_davinci dm6446_snd_soc_card_drvdata = {
240 .sysclk = 12288000,
241};
242
Chris Paulson-Ellisbedad0c2010-11-16 12:27:09 +0000243static struct snd_soc_card dm6446_snd_soc_card_evm = {
244 .name = "DaVinci DM6446 EVM",
Axel Lin36a16d12011-12-22 21:19:42 +0800245 .owner = THIS_MODULE,
Chris Paulson-Ellisbedad0c2010-11-16 12:27:09 +0000246 .dai_link = &dm6446_evm_dai,
247 .num_links = 1,
Jyri Sarhabcf25562013-09-17 12:26:00 +0300248 .drvdata = &dm6446_snd_soc_card_drvdata,
Chris Paulson-Ellisbedad0c2010-11-16 12:27:09 +0000249};
250
251/* davinci dm355 evm audio machine driver */
Jyri Sarhabcf25562013-09-17 12:26:00 +0300252/* ASP1 on DM355 EVM is clocked by an external oscillator */
253static struct snd_soc_card_drvdata_davinci dm355_snd_soc_card_drvdata = {
254 .sysclk = 27000000,
255};
256
Chris Paulson-Ellisbedad0c2010-11-16 12:27:09 +0000257static struct snd_soc_card dm355_snd_soc_card_evm = {
258 .name = "DaVinci DM355 EVM",
Axel Lin36a16d12011-12-22 21:19:42 +0800259 .owner = THIS_MODULE,
Chris Paulson-Ellisbedad0c2010-11-16 12:27:09 +0000260 .dai_link = &dm355_evm_dai,
Vladimir Barinov310355c2008-02-18 11:40:22 +0100261 .num_links = 1,
Jyri Sarhabcf25562013-09-17 12:26:00 +0300262 .drvdata = &dm355_snd_soc_card_drvdata,
Vladimir Barinov310355c2008-02-18 11:40:22 +0100263};
264
Miguel Aguilaraa9b88e2010-03-11 09:33:40 -0600265/* davinci dm365 evm audio machine driver */
Jyri Sarhabcf25562013-09-17 12:26:00 +0300266static struct snd_soc_card_drvdata_davinci dm365_snd_soc_card_drvdata = {
267 .sysclk = 27000000,
268};
269
Miguel Aguilaraa9b88e2010-03-11 09:33:40 -0600270static struct snd_soc_card dm365_snd_soc_card_evm = {
271 .name = "DaVinci DM365 EVM",
Axel Lin36a16d12011-12-22 21:19:42 +0800272 .owner = THIS_MODULE,
Miguel Aguilaraa9b88e2010-03-11 09:33:40 -0600273 .dai_link = &dm365_evm_dai,
274 .num_links = 1,
Jyri Sarhabcf25562013-09-17 12:26:00 +0300275 .drvdata = &dm365_snd_soc_card_drvdata,
Miguel Aguilaraa9b88e2010-03-11 09:33:40 -0600276};
277
Chaithrika U S04f80f52009-06-05 06:28:49 -0400278/* davinci dm6467 evm audio machine driver */
Jyri Sarhabcf25562013-09-17 12:26:00 +0300279static struct snd_soc_card_drvdata_davinci dm6467_snd_soc_card_drvdata = {
280 .sysclk = 27000000,
281};
282
Chaithrika U S04f80f52009-06-05 06:28:49 -0400283static struct snd_soc_card dm6467_snd_soc_card_evm = {
284 .name = "DaVinci DM6467 EVM",
Axel Lin36a16d12011-12-22 21:19:42 +0800285 .owner = THIS_MODULE,
Chaithrika U S04f80f52009-06-05 06:28:49 -0400286 .dai_link = dm6467_evm_dai,
287 .num_links = ARRAY_SIZE(dm6467_evm_dai),
Jyri Sarhabcf25562013-09-17 12:26:00 +0300288 .drvdata = &dm6467_snd_soc_card_drvdata,
289};
290
291static struct snd_soc_card_drvdata_davinci da830_snd_soc_card_drvdata = {
292 .sysclk = 24576000,
Chaithrika U S04f80f52009-06-05 06:28:49 -0400293};
294
Chaithrika U S7ae59452009-08-07 10:07:51 -0400295static struct snd_soc_card da830_snd_soc_card = {
Chaithrika U S30230f42009-08-11 16:59:21 -0400296 .name = "DA830/OMAP-L137 EVM",
Axel Lin36a16d12011-12-22 21:19:42 +0800297 .owner = THIS_MODULE,
Vaibhav Bediaf9eb9dd2011-02-03 16:42:25 +0530298 .dai_link = &da830_evm_dai,
Chaithrika U S30230f42009-08-11 16:59:21 -0400299 .num_links = 1,
Jyri Sarhabcf25562013-09-17 12:26:00 +0300300 .drvdata = &da830_snd_soc_card_drvdata,
301};
302
303static struct snd_soc_card_drvdata_davinci da850_snd_soc_card_drvdata = {
304 .sysclk = 24576000,
Chaithrika U S30230f42009-08-11 16:59:21 -0400305};
306
307static struct snd_soc_card da850_snd_soc_card = {
308 .name = "DA850/OMAP-L138 EVM",
Axel Lin36a16d12011-12-22 21:19:42 +0800309 .owner = THIS_MODULE,
Vaibhav Bediaf9eb9dd2011-02-03 16:42:25 +0530310 .dai_link = &da850_evm_dai,
Chaithrika U S7ae59452009-08-07 10:07:51 -0400311 .num_links = 1,
Jyri Sarhabcf25562013-09-17 12:26:00 +0300312 .drvdata = &da850_snd_soc_card_drvdata,
Chaithrika U S7ae59452009-08-07 10:07:51 -0400313};
314
Vladimir Barinov310355c2008-02-18 11:40:22 +0100315static struct platform_device *evm_snd_device;
316
317static int __init evm_init(void)
318{
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000319 struct snd_soc_card *evm_snd_dev_data;
David Brownellf492ec92009-05-14 13:01:59 -0700320 int index;
Vladimir Barinov310355c2008-02-18 11:40:22 +0100321 int ret;
322
Miguel Aguilaraa9b88e2010-03-11 09:33:40 -0600323 if (machine_is_davinci_evm()) {
Chris Paulson-Ellisbedad0c2010-11-16 12:27:09 +0000324 evm_snd_dev_data = &dm6446_snd_soc_card_evm;
David Brownellf492ec92009-05-14 13:01:59 -0700325 index = 0;
326 } else if (machine_is_davinci_dm355_evm()) {
Chris Paulson-Ellisbedad0c2010-11-16 12:27:09 +0000327 evm_snd_dev_data = &dm355_snd_soc_card_evm;
David Brownellf492ec92009-05-14 13:01:59 -0700328 index = 1;
Miguel Aguilaraa9b88e2010-03-11 09:33:40 -0600329 } else if (machine_is_davinci_dm365_evm()) {
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000330 evm_snd_dev_data = &dm365_snd_soc_card_evm;
Miguel Aguilaraa9b88e2010-03-11 09:33:40 -0600331 index = 0;
Chaithrika U S04f80f52009-06-05 06:28:49 -0400332 } else if (machine_is_davinci_dm6467_evm()) {
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000333 evm_snd_dev_data = &dm6467_snd_soc_card_evm;
Chaithrika U S04f80f52009-06-05 06:28:49 -0400334 index = 0;
Chaithrika U S7ae59452009-08-07 10:07:51 -0400335 } else if (machine_is_davinci_da830_evm()) {
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000336 evm_snd_dev_data = &da830_snd_soc_card;
Chaithrika U S7ae59452009-08-07 10:07:51 -0400337 index = 1;
Chaithrika U S30230f42009-08-11 16:59:21 -0400338 } else if (machine_is_davinci_da850_evm()) {
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000339 evm_snd_dev_data = &da850_snd_soc_card;
Chaithrika U S30230f42009-08-11 16:59:21 -0400340 index = 0;
David Brownellf492ec92009-05-14 13:01:59 -0700341 } else
342 return -EINVAL;
343
344 evm_snd_device = platform_device_alloc("soc-audio", index);
Vladimir Barinov310355c2008-02-18 11:40:22 +0100345 if (!evm_snd_device)
346 return -ENOMEM;
347
Chaithrika U S04f80f52009-06-05 06:28:49 -0400348 platform_set_drvdata(evm_snd_device, evm_snd_dev_data);
Vladimir Barinov310355c2008-02-18 11:40:22 +0100349 ret = platform_device_add(evm_snd_device);
350 if (ret)
351 platform_device_put(evm_snd_device);
352
353 return ret;
354}
355
356static void __exit evm_exit(void)
357{
358 platform_device_unregister(evm_snd_device);
359}
360
361module_init(evm_init);
362module_exit(evm_exit);
363
364MODULE_AUTHOR("Vladimir Barinov");
365MODULE_DESCRIPTION("TI DAVINCI EVM ASoC driver");
366MODULE_LICENSE("GPL");