aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/samsung/smdk_wm8994.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c
index cc2f407e9f1b..581ea4a06fc6 100644
--- a/sound/soc/samsung/smdk_wm8994.c
+++ b/sound/soc/samsung/smdk_wm8994.c
@@ -10,6 +10,7 @@
10#include "../codecs/wm8994.h" 10#include "../codecs/wm8994.h"
11#include <sound/pcm_params.h> 11#include <sound/pcm_params.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/of.h>
13 14
14 /* 15 /*
15 * Default CFG switch settings to use this driver: 16 * Default CFG switch settings to use this driver:
@@ -153,9 +154,25 @@ static struct snd_soc_card smdk = {
153static int smdk_audio_probe(struct platform_device *pdev) 154static int smdk_audio_probe(struct platform_device *pdev)
154{ 155{
155 int ret; 156 int ret;
157 struct device_node *np = pdev->dev.of_node;
156 struct snd_soc_card *card = &smdk; 158 struct snd_soc_card *card = &smdk;
157 159
158 card->dev = &pdev->dev; 160 card->dev = &pdev->dev;
161
162 if (np) {
163 smdk_dai[0].cpu_dai_name = NULL;
164 smdk_dai[0].cpu_of_node = of_parse_phandle(np,
165 "samsung,i2s-controller", 0);
166 if (!smdk_dai[0].cpu_of_node) {
167 dev_err(&pdev->dev,
168 "Property 'samsung,i2s-controller' missing or invalid\n");
169 ret = -EINVAL;
170 }
171
172 smdk_dai[0].platform_name = NULL;
173 smdk_dai[0].platform_of_node = smdk_dai[0].cpu_of_node;
174 }
175
159 ret = snd_soc_register_card(card); 176 ret = snd_soc_register_card(card);
160 177
161 if (ret) 178 if (ret)
@@ -173,10 +190,19 @@ static int smdk_audio_remove(struct platform_device *pdev)
173 return 0; 190 return 0;
174} 191}
175 192
193#ifdef CONFIG_OF
194static const struct of_device_id samsung_wm8994_of_match[] = {
195 { .compatible = "samsung,smdk-wm8994", },
196 {},
197};
198MODULE_DEVICE_TABLE(of, samsung_wm8994_of_match);
199#endif /* CONFIG_OF */
200
176static struct platform_driver smdk_audio_driver = { 201static struct platform_driver smdk_audio_driver = {
177 .driver = { 202 .driver = {
178 .name = "smdk-audio", 203 .name = "smdk-audio",
179 .owner = THIS_MODULE, 204 .owner = THIS_MODULE,
205 .of_match_table = of_match_ptr(samsung_wm8994_of_match),
180 }, 206 },
181 .probe = smdk_audio_probe, 207 .probe = smdk_audio_probe,
182 .remove = smdk_audio_remove, 208 .remove = smdk_audio_remove,