aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/imx/phycore-ac97.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/imx/phycore-ac97.c')
-rw-r--r--sound/soc/imx/phycore-ac97.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/sound/soc/imx/phycore-ac97.c b/sound/soc/imx/phycore-ac97.c
index 6a65dd705519..9eabc28667e6 100644
--- a/sound/soc/imx/phycore-ac97.c
+++ b/sound/soc/imx/phycore-ac97.c
@@ -20,9 +20,6 @@
20#include <sound/soc-dapm.h> 20#include <sound/soc-dapm.h>
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22 22
23#include "../codecs/wm9712.h"
24#include "imx-ssi.h"
25
26static struct snd_soc_card imx_phycore; 23static struct snd_soc_card imx_phycore;
27 24
28static struct snd_soc_ops imx_phycore_hifi_ops = { 25static struct snd_soc_ops imx_phycore_hifi_ops = {
@@ -41,11 +38,12 @@ static struct snd_soc_dai_link imx_phycore_dai_ac97[] = {
41}; 38};
42 39
43static struct snd_soc_card imx_phycore = { 40static struct snd_soc_card imx_phycore = {
44 .name = "PhyCORE-audio", 41 .name = "PhyCORE-ac97-audio",
45 .dai_link = imx_phycore_dai_ac97, 42 .dai_link = imx_phycore_dai_ac97,
46 .num_links = ARRAY_SIZE(imx_phycore_dai_ac97), 43 .num_links = ARRAY_SIZE(imx_phycore_dai_ac97),
47}; 44};
48 45
46static struct platform_device *imx_phycore_snd_ac97_device;
49static struct platform_device *imx_phycore_snd_device; 47static struct platform_device *imx_phycore_snd_device;
50 48
51static int __init imx_phycore_init(void) 49static int __init imx_phycore_init(void)
@@ -56,29 +54,42 @@ static int __init imx_phycore_init(void)
56 /* return happy. We might run on a totally different machine */ 54 /* return happy. We might run on a totally different machine */
57 return 0; 55 return 0;
58 56
59 imx_phycore_snd_device = platform_device_alloc("soc-audio", -1); 57 imx_phycore_snd_ac97_device = platform_device_alloc("soc-audio", -1);
60 if (!imx_phycore_snd_device) 58 if (!imx_phycore_snd_ac97_device)
61 return -ENOMEM; 59 return -ENOMEM;
62 60
63 platform_set_drvdata(imx_phycore_snd_device, &imx_phycore); 61 platform_set_drvdata(imx_phycore_snd_ac97_device, &imx_phycore);
64 ret = platform_device_add(imx_phycore_snd_device); 62 ret = platform_device_add(imx_phycore_snd_ac97_device);
63 if (ret)
64 goto fail1;
65 65
66 imx_phycore_snd_device = platform_device_alloc("wm9712-codec", -1); 66 imx_phycore_snd_device = platform_device_alloc("wm9712-codec", -1);
67 if (!imx_phycore_snd_device) 67 if (!imx_phycore_snd_device) {
68 return -ENOMEM; 68 ret = -ENOMEM;
69 goto fail2;
70 }
69 ret = platform_device_add(imx_phycore_snd_device); 71 ret = platform_device_add(imx_phycore_snd_device);
70 72
71 if (ret) { 73 if (ret) {
72 printk(KERN_ERR "ASoC: Platform device allocation failed\n"); 74 printk(KERN_ERR "ASoC: Platform device allocation failed\n");
73 platform_device_put(imx_phycore_snd_device); 75 goto fail3;
74 } 76 }
75 77
78 return 0;
79
80fail3:
81 platform_device_put(imx_phycore_snd_device);
82fail2:
83 platform_device_del(imx_phycore_snd_ac97_device);
84fail1:
85 platform_device_put(imx_phycore_snd_ac97_device);
76 return ret; 86 return ret;
77} 87}
78 88
79static void __exit imx_phycore_exit(void) 89static void __exit imx_phycore_exit(void)
80{ 90{
81 platform_device_unregister(imx_phycore_snd_device); 91 platform_device_unregister(imx_phycore_snd_device);
92 platform_device_unregister(imx_phycore_snd_ac97_device);
82} 93}
83 94
84late_initcall(imx_phycore_init); 95late_initcall(imx_phycore_init);