diff options
Diffstat (limited to 'sound/soc/davinci/davinci-sffsdr.c')
-rw-r--r-- | sound/soc/davinci/davinci-sffsdr.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index 40eccfe9e358..997c54f3693c 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <asm/plat-sffsdr/sffsdr-fpga.h> | 29 | #include <asm/plat-sffsdr/sffsdr-fpga.h> |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #include <mach/mcbsp.h> | ||
33 | #include <mach/edma.h> | 32 | #include <mach/edma.h> |
34 | 33 | ||
35 | #include "../codecs/pcm3008.h" | 34 | #include "../codecs/pcm3008.h" |
@@ -48,7 +47,7 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream, | |||
48 | struct snd_pcm_hw_params *params) | 47 | struct snd_pcm_hw_params *params) |
49 | { | 48 | { |
50 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 49 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
51 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | 50 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
52 | int fs; | 51 | int fs; |
53 | int ret = 0; | 52 | int ret = 0; |
54 | 53 | ||
@@ -85,15 +84,16 @@ static struct snd_soc_ops sffsdr_ops = { | |||
85 | static struct snd_soc_dai_link sffsdr_dai = { | 84 | static struct snd_soc_dai_link sffsdr_dai = { |
86 | .name = "PCM3008", /* Codec name */ | 85 | .name = "PCM3008", /* Codec name */ |
87 | .stream_name = "PCM3008 HiFi", | 86 | .stream_name = "PCM3008 HiFi", |
88 | .cpu_dai = &davinci_i2s_dai, | 87 | .cpu_dai_name = "davinci-asp.0", |
89 | .codec_dai = &pcm3008_dai, | 88 | .codec_dai_name = "pcm3008-hifi", |
89 | .codec_name = "pcm3008-codec", | ||
90 | .platform_name = "davinci-pcm-audio", | ||
90 | .ops = &sffsdr_ops, | 91 | .ops = &sffsdr_ops, |
91 | }; | 92 | }; |
92 | 93 | ||
93 | /* davinci-sffsdr audio machine driver */ | 94 | /* davinci-sffsdr audio machine driver */ |
94 | static struct snd_soc_card snd_soc_sffsdr = { | 95 | static struct snd_soc_card snd_soc_sffsdr = { |
95 | .name = "DaVinci SFFSDR", | 96 | .name = "DaVinci SFFSDR", |
96 | .platform = &davinci_soc_platform, | ||
97 | .dai_link = &sffsdr_dai, | 97 | .dai_link = &sffsdr_dai, |
98 | .num_links = 1, | 98 | .num_links = 1, |
99 | }; | 99 | }; |
@@ -106,11 +106,12 @@ static struct pcm3008_setup_data sffsdr_pcm3008_setup = { | |||
106 | .pdda_pin = GPIO(38), | 106 | .pdda_pin = GPIO(38), |
107 | }; | 107 | }; |
108 | 108 | ||
109 | /* sffsdr audio subsystem */ | 109 | struct platform_device pcm3008_codec = { |
110 | static struct snd_soc_device sffsdr_snd_devdata = { | 110 | .name = "pcm3008-codec", |
111 | .card = &snd_soc_sffsdr, | 111 | .id = 0, |
112 | .codec_dev = &soc_codec_dev_pcm3008, | 112 | .dev = { |
113 | .codec_data = &sffsdr_pcm3008_setup, | 113 | .platform_data = &sffsdr_pcm3008_setup, |
114 | }, | ||
114 | }; | 115 | }; |
115 | 116 | ||
116 | static struct resource sffsdr_snd_resources[] = { | 117 | static struct resource sffsdr_snd_resources[] = { |
@@ -135,14 +136,15 @@ static int __init sffsdr_init(void) | |||
135 | if (!machine_is_sffsdr()) | 136 | if (!machine_is_sffsdr()) |
136 | return -EINVAL; | 137 | return -EINVAL; |
137 | 138 | ||
139 | platform_device_register(&pcm3008_codec); | ||
140 | |||
138 | sffsdr_snd_device = platform_device_alloc("soc-audio", 0); | 141 | sffsdr_snd_device = platform_device_alloc("soc-audio", 0); |
139 | if (!sffsdr_snd_device) { | 142 | if (!sffsdr_snd_device) { |
140 | printk(KERN_ERR "platform device allocation failed\n"); | 143 | printk(KERN_ERR "platform device allocation failed\n"); |
141 | return -ENOMEM; | 144 | return -ENOMEM; |
142 | } | 145 | } |
143 | 146 | ||
144 | platform_set_drvdata(sffsdr_snd_device, &sffsdr_snd_devdata); | 147 | platform_set_drvdata(sffsdr_snd_device, &snd_soc_sffsdr); |
145 | sffsdr_snd_devdata.dev = &sffsdr_snd_device->dev; | ||
146 | platform_device_add_data(sffsdr_snd_device, &sffsdr_snd_data, | 148 | platform_device_add_data(sffsdr_snd_device, &sffsdr_snd_data, |
147 | sizeof(sffsdr_snd_data)); | 149 | sizeof(sffsdr_snd_data)); |
148 | 150 | ||
@@ -168,6 +170,7 @@ error: | |||
168 | static void __exit sffsdr_exit(void) | 170 | static void __exit sffsdr_exit(void) |
169 | { | 171 | { |
170 | platform_device_unregister(sffsdr_snd_device); | 172 | platform_device_unregister(sffsdr_snd_device); |
173 | platform_device_unregister(&pcm3008_codec); | ||
171 | } | 174 | } |
172 | 175 | ||
173 | module_init(sffsdr_init); | 176 | module_init(sffsdr_init); |