aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPadmavathi Venna <padma.v@samsung.com>2013-01-18 06:47:06 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-29 02:36:28 -0500
commit28a480583361b8e67b0a7f4898180725b71cceec (patch)
treeb0f6434f93599ed86f264153854b3962e17b795b
parent99b97fdccbde9860366ec00bd61f2622055f1b86 (diff)
ASoC: SMDK: WM8994: Add device tree support for machine file
Add the basic device tree based lookup. Signed-off-by: Padmavathi Venna <padma.v@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--Documentation/devicetree/bindings/sound/samsung,smdk-wm8994.txt14
-rw-r--r--arch/arm/boot/dts/exynos5250-smdk5250.dts18
-rw-r--r--arch/arm/boot/dts/exynos5250.dtsi6
-rw-r--r--sound/soc/samsung/smdk_wm8994.c26
4 files changed, 58 insertions, 6 deletions
diff --git a/Documentation/devicetree/bindings/sound/samsung,smdk-wm8994.txt b/Documentation/devicetree/bindings/sound/samsung,smdk-wm8994.txt
new file mode 100644
index 000000000000..4686646fb122
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/samsung,smdk-wm8994.txt
@@ -0,0 +1,14 @@
1Samsung SMDK audio complex
2
3Required properties:
4- compatible : "samsung,smdk-wm8994"
5- samsung,i2s-controller: The phandle of the Samsung I2S0 controller
6- samsung,audio-codec: The phandle of the WM8994 audio codec
7Example:
8
9sound {
10 compatible = "samsung,smdk-wm8994";
11
12 samsung,i2s-controller = <&i2s0>;
13 samsung,audio-codec = <&wm8994>;
14};
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts
index 78fee35d09fc..127b8cd1385c 100644
--- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
@@ -49,6 +49,11 @@
49 compatible = "samsung,s524ad0xd1"; 49 compatible = "samsung,s524ad0xd1";
50 reg = <0x51>; 50 reg = <0x51>;
51 }; 51 };
52
53 wm8994: wm8994@1a {
54 compatible = "wlf,wm8994";
55 reg = <0x1a>;
56 };
52 }; 57 };
53 58
54 i2c@121D0000 { 59 i2c@121D0000 {
@@ -205,17 +210,24 @@
205 samsung,mfc-l = <0x51000000 0x800000>; 210 samsung,mfc-l = <0x51000000 0x800000>;
206 }; 211 };
207 212
208 i2s@03830000 { 213 i2s0: i2s@03830000 {
209 gpios = <&gpz 0 2 0 0>, <&gpz 1 2 0 0>, <&gpz 2 2 0 0>, 214 gpios = <&gpz 0 2 0 0>, <&gpz 1 2 0 0>, <&gpz 2 2 0 0>,
210 <&gpz 3 2 0 0>, <&gpz 4 2 0 0>, <&gpz 5 2 0 0>, 215 <&gpz 3 2 0 0>, <&gpz 4 2 0 0>, <&gpz 5 2 0 0>,
211 <&gpz 6 2 0 0>; 216 <&gpz 6 2 0 0>;
212 }; 217 };
213 218
214 i2s@12D60000 { 219 i2s1: i2s@12D60000 {
215 status = "disabled"; 220 status = "disabled";
216 }; 221 };
217 222
218 i2s@12D70000 { 223 i2s2: i2s@12D70000 {
219 status = "disabled"; 224 status = "disabled";
220 }; 225 };
226
227 sound {
228 compatible = "samsung,smdk-wm8994";
229
230 samsung,i2s-controller = <&i2s0>;
231 samsung,audio-codec = <&wm8994>;
232 };
221}; 233};
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index fe05b60a3984..a320b4ac11dd 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -269,7 +269,7 @@
269 #size-cells = <0>; 269 #size-cells = <0>;
270 }; 270 };
271 271
272 i2s@03830000 { 272 i2s0: i2s@03830000 {
273 compatible = "samsung,i2s-v5"; 273 compatible = "samsung,i2s-v5";
274 reg = <0x03830000 0x100>; 274 reg = <0x03830000 0x100>;
275 dmas = <&pdma0 10 275 dmas = <&pdma0 10
@@ -282,7 +282,7 @@
282 samsung,idma-addr = <0x03000000>; 282 samsung,idma-addr = <0x03000000>;
283 }; 283 };
284 284
285 i2s@12D60000 { 285 i2s1: i2s@12D60000 {
286 compatible = "samsung,i2s-v5"; 286 compatible = "samsung,i2s-v5";
287 reg = <0x12D60000 0x100>; 287 reg = <0x12D60000 0x100>;
288 dmas = <&pdma1 12 288 dmas = <&pdma1 12
@@ -290,7 +290,7 @@
290 dma-names = "tx", "rx"; 290 dma-names = "tx", "rx";
291 }; 291 };
292 292
293 i2s@12D70000 { 293 i2s2: i2s@12D70000 {
294 compatible = "samsung,i2s-v5"; 294 compatible = "samsung,i2s-v5";
295 reg = <0x12D70000 0x100>; 295 reg = <0x12D70000 0x100>;
296 dmas = <&pdma0 12 296 dmas = <&pdma0 12
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,