aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx/smdk_wm9713.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/s3c24xx/smdk_wm9713.c')
-rw-r--r--sound/soc/s3c24xx/smdk_wm9713.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/sound/soc/s3c24xx/smdk_wm9713.c b/sound/soc/s3c24xx/smdk_wm9713.c
index 5527b9e88c98..33ba8fdbcf07 100644
--- a/sound/soc/s3c24xx/smdk_wm9713.c
+++ b/sound/soc/s3c24xx/smdk_wm9713.c
@@ -15,7 +15,6 @@
15#include <linux/device.h> 15#include <linux/device.h>
16#include <sound/soc.h> 16#include <sound/soc.h>
17 17
18#include "../codecs/wm9713.h"
19#include "s3c-dma.h" 18#include "s3c-dma.h"
20#include "s3c-ac97.h" 19#include "s3c-ac97.h"
21 20
@@ -46,46 +45,57 @@ static struct snd_soc_card smdk;
46static struct snd_soc_dai_link smdk_dai = { 45static struct snd_soc_dai_link smdk_dai = {
47 .name = "AC97", 46 .name = "AC97",
48 .stream_name = "AC97 PCM", 47 .stream_name = "AC97 PCM",
49 .cpu_dai = &s3c_ac97_dai[S3C_AC97_DAI_PCM], 48 .platform_name = "s3c24xx-pcm-audio",
50 .codec_dai = &wm9713_dai[WM9713_DAI_AC97_HIFI], 49 .cpu_dai_name = "s3c-ac97",
50 .codec_dai_name = "wm9713-hifi",
51 .codec_name = "wm9713-codec",
51}; 52};
52 53
53static struct snd_soc_card smdk = { 54static struct snd_soc_card smdk = {
54 .name = "SMDK", 55 .name = "SMDK WM9713",
55 .platform = &s3c24xx_soc_platform,
56 .dai_link = &smdk_dai, 56 .dai_link = &smdk_dai,
57 .num_links = 1, 57 .num_links = 1,
58}; 58};
59 59
60static struct snd_soc_device smdk_snd_ac97_devdata = { 60static struct platform_device *smdk_snd_wm9713_device;
61 .card = &smdk,
62 .codec_dev = &soc_codec_dev_wm9713,
63};
64
65static struct platform_device *smdk_snd_ac97_device; 61static struct platform_device *smdk_snd_ac97_device;
66 62
67static int __init smdk_init(void) 63static int __init smdk_init(void)
68{ 64{
69 int ret; 65 int ret;
70 66
71 smdk_snd_ac97_device = platform_device_alloc("soc-audio", -1); 67 smdk_snd_wm9713_device = platform_device_alloc("wm9713-codec", -1);
72 if (!smdk_snd_ac97_device) 68 if (!smdk_snd_wm9713_device)
73 return -ENOMEM; 69 return -ENOMEM;
74 70
75 platform_set_drvdata(smdk_snd_ac97_device, 71 ret = platform_device_add(smdk_snd_wm9713_device);
76 &smdk_snd_ac97_devdata); 72 if (ret)
77 smdk_snd_ac97_devdata.dev = &smdk_snd_ac97_device->dev; 73 goto err;
74
75 smdk_snd_ac97_device = platform_device_alloc("soc-audio", -1);
76 if (!smdk_snd_ac97_device) {
77 ret = -ENOMEM;
78 goto err;
79 }
80
81 platform_set_drvdata(smdk_snd_ac97_device, &smdk);
78 82
79 ret = platform_device_add(smdk_snd_ac97_device); 83 ret = platform_device_add(smdk_snd_ac97_device);
80 if (ret) 84 if (ret) {
81 platform_device_put(smdk_snd_ac97_device); 85 platform_device_put(smdk_snd_ac97_device);
86 goto err;
87 }
82 88
89 return 0;
90err:
91 platform_device_put(smdk_snd_wm9713_device);
83 return ret; 92 return ret;
84} 93}
85 94
86static void __exit smdk_exit(void) 95static void __exit smdk_exit(void)
87{ 96{
88 platform_device_unregister(smdk_snd_ac97_device); 97 platform_device_unregister(smdk_snd_ac97_device);
98 platform_device_unregister(smdk_snd_wm9713_device);
89} 99}
90 100
91module_init(smdk_init); 101module_init(smdk_init);