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