From 4c4c746399a6fdd34c4f0c60e4041c9d49f3b940 Mon Sep 17 00:00:00 2001 From: Padmavathi Venna Date: Fri, 18 Jan 2013 17:17:04 +0530 Subject: ARM: dts: Add nodes for i2s controllers for Samsung Exynos5 platforms Add device nodes for the three instances of i2s controllers in Exynos5 platforms. Enable instance i2s 0 for exynos5250 board and disable all other i2s instances. Signed-off-by: Padmavathi Venna Signed-off-by: Mark Brown --- arch/arm/boot/dts/exynos5250-smdk5250.dts | 14 ++++++++++++++ arch/arm/boot/dts/exynos5250.dtsi | 29 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) (limited to 'arch/arm/boot/dts') diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts index 942d5761ca9..78fee35d09f 100644 --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts @@ -204,4 +204,18 @@ samsung,mfc-r = <0x43000000 0x800000>; samsung,mfc-l = <0x51000000 0x800000>; }; + + i2s@03830000 { + gpios = <&gpz 0 2 0 0>, <&gpz 1 2 0 0>, <&gpz 2 2 0 0>, + <&gpz 3 2 0 0>, <&gpz 4 2 0 0>, <&gpz 5 2 0 0>, + <&gpz 6 2 0 0>; + }; + + i2s@12D60000 { + status = "disabled"; + }; + + i2s@12D70000 { + status = "disabled"; + }; }; diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi index 3acf594ea60..fe05b60a398 100644 --- a/arch/arm/boot/dts/exynos5250.dtsi +++ b/arch/arm/boot/dts/exynos5250.dtsi @@ -269,6 +269,35 @@ #size-cells = <0>; }; + i2s@03830000 { + compatible = "samsung,i2s-v5"; + reg = <0x03830000 0x100>; + dmas = <&pdma0 10 + &pdma0 9 + &pdma0 8>; + dma-names = "tx", "rx", "tx-sec"; + samsung,supports-6ch; + samsung,supports-rstclr; + samsung,supports-secdai; + samsung,idma-addr = <0x03000000>; + }; + + i2s@12D60000 { + compatible = "samsung,i2s-v5"; + reg = <0x12D60000 0x100>; + dmas = <&pdma1 12 + &pdma1 11>; + dma-names = "tx", "rx"; + }; + + i2s@12D70000 { + compatible = "samsung,i2s-v5"; + reg = <0x12D70000 0x100>; + dmas = <&pdma0 12 + &pdma0 11>; + dma-names = "tx", "rx"; + }; + amba { #address-cells = <1>; #size-cells = <1>; -- cgit v1.2.3-70-g09d2 From 28a480583361b8e67b0a7f4898180725b71cceec Mon Sep 17 00:00:00 2001 From: Padmavathi Venna Date: Fri, 18 Jan 2013 17:17:06 +0530 Subject: ASoC: SMDK: WM8994: Add device tree support for machine file Add the basic device tree based lookup. Signed-off-by: Padmavathi Venna Signed-off-by: Mark Brown --- .../bindings/sound/samsung,smdk-wm8994.txt | 14 ++++++++++++ arch/arm/boot/dts/exynos5250-smdk5250.dts | 18 ++++++++++++--- arch/arm/boot/dts/exynos5250.dtsi | 6 ++--- sound/soc/samsung/smdk_wm8994.c | 26 ++++++++++++++++++++++ 4 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/samsung,smdk-wm8994.txt (limited to 'arch/arm/boot/dts') 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 00000000000..4686646fb12 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/samsung,smdk-wm8994.txt @@ -0,0 +1,14 @@ +Samsung SMDK audio complex + +Required properties: +- compatible : "samsung,smdk-wm8994" +- samsung,i2s-controller: The phandle of the Samsung I2S0 controller +- samsung,audio-codec: The phandle of the WM8994 audio codec +Example: + +sound { + compatible = "samsung,smdk-wm8994"; + + samsung,i2s-controller = <&i2s0>; + samsung,audio-codec = <&wm8994>; +}; diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts index 78fee35d09f..127b8cd1385 100644 --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts @@ -49,6 +49,11 @@ compatible = "samsung,s524ad0xd1"; reg = <0x51>; }; + + wm8994: wm8994@1a { + compatible = "wlf,wm8994"; + reg = <0x1a>; + }; }; i2c@121D0000 { @@ -205,17 +210,24 @@ samsung,mfc-l = <0x51000000 0x800000>; }; - i2s@03830000 { + i2s0: i2s@03830000 { gpios = <&gpz 0 2 0 0>, <&gpz 1 2 0 0>, <&gpz 2 2 0 0>, <&gpz 3 2 0 0>, <&gpz 4 2 0 0>, <&gpz 5 2 0 0>, <&gpz 6 2 0 0>; }; - i2s@12D60000 { + i2s1: i2s@12D60000 { status = "disabled"; }; - i2s@12D70000 { + i2s2: i2s@12D70000 { status = "disabled"; }; + + sound { + compatible = "samsung,smdk-wm8994"; + + samsung,i2s-controller = <&i2s0>; + samsung,audio-codec = <&wm8994>; + }; }; diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi index fe05b60a398..a320b4ac11d 100644 --- a/arch/arm/boot/dts/exynos5250.dtsi +++ b/arch/arm/boot/dts/exynos5250.dtsi @@ -269,7 +269,7 @@ #size-cells = <0>; }; - i2s@03830000 { + i2s0: i2s@03830000 { compatible = "samsung,i2s-v5"; reg = <0x03830000 0x100>; dmas = <&pdma0 10 @@ -282,7 +282,7 @@ samsung,idma-addr = <0x03000000>; }; - i2s@12D60000 { + i2s1: i2s@12D60000 { compatible = "samsung,i2s-v5"; reg = <0x12D60000 0x100>; dmas = <&pdma1 12 @@ -290,7 +290,7 @@ dma-names = "tx", "rx"; }; - i2s@12D70000 { + i2s2: i2s@12D70000 { compatible = "samsung,i2s-v5"; reg = <0x12D70000 0x100>; dmas = <&pdma0 12 diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c index cc2f407e9f1..581ea4a06fc 100644 --- a/sound/soc/samsung/smdk_wm8994.c +++ b/sound/soc/samsung/smdk_wm8994.c @@ -10,6 +10,7 @@ #include "../codecs/wm8994.h" #include #include +#include /* * Default CFG switch settings to use this driver: @@ -153,9 +154,25 @@ static struct snd_soc_card smdk = { static int smdk_audio_probe(struct platform_device *pdev) { int ret; + struct device_node *np = pdev->dev.of_node; struct snd_soc_card *card = &smdk; card->dev = &pdev->dev; + + if (np) { + smdk_dai[0].cpu_dai_name = NULL; + smdk_dai[0].cpu_of_node = of_parse_phandle(np, + "samsung,i2s-controller", 0); + if (!smdk_dai[0].cpu_of_node) { + dev_err(&pdev->dev, + "Property 'samsung,i2s-controller' missing or invalid\n"); + ret = -EINVAL; + } + + smdk_dai[0].platform_name = NULL; + smdk_dai[0].platform_of_node = smdk_dai[0].cpu_of_node; + } + ret = snd_soc_register_card(card); if (ret) @@ -173,10 +190,19 @@ static int smdk_audio_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id samsung_wm8994_of_match[] = { + { .compatible = "samsung,smdk-wm8994", }, + {}, +}; +MODULE_DEVICE_TABLE(of, samsung_wm8994_of_match); +#endif /* CONFIG_OF */ + static struct platform_driver smdk_audio_driver = { .driver = { .name = "smdk-audio", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(samsung_wm8994_of_match), }, .probe = smdk_audio_probe, .remove = smdk_audio_remove, -- cgit v1.2.3-70-g09d2 From a4a8a9d3aee357d8f34060c2fee711d2a9df3709 Mon Sep 17 00:00:00 2001 From: Padmavathi Venna Date: Fri, 18 Jan 2013 17:17:07 +0530 Subject: ARM: dts: Modify SPI nodes according generic DMA DT bindings This patch removes custom way of adding spi dma channels and adds according to new generic DMA DT bindings. Signed-off-by: Padmavathi Venna Signed-off-by: Mark Brown --- arch/arm/boot/dts/exynos5250.dtsi | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'arch/arm/boot/dts') diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi index a320b4ac11d..f50b4e85435 100644 --- a/arch/arm/boot/dts/exynos5250.dtsi +++ b/arch/arm/boot/dts/exynos5250.dtsi @@ -211,8 +211,9 @@ compatible = "samsung,exynos4210-spi"; reg = <0x12d20000 0x100>; interrupts = <0 66 0>; - tx-dma-channel = <&pdma0 5>; /* preliminary */ - rx-dma-channel = <&pdma0 4>; /* preliminary */ + dmas = <&pdma0 5 + &pdma0 4>; + dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; }; @@ -221,8 +222,9 @@ compatible = "samsung,exynos4210-spi"; reg = <0x12d30000 0x100>; interrupts = <0 67 0>; - tx-dma-channel = <&pdma1 5>; /* preliminary */ - rx-dma-channel = <&pdma1 4>; /* preliminary */ + dmas = <&pdma1 5 + &pdma1 4>; + dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; }; @@ -231,8 +233,9 @@ compatible = "samsung,exynos4210-spi"; reg = <0x12d40000 0x100>; interrupts = <0 68 0>; - tx-dma-channel = <&pdma0 7>; /* preliminary */ - rx-dma-channel = <&pdma0 6>; /* preliminary */ + dmas = <&pdma0 7 + &pdma0 6>; + dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; }; -- cgit v1.2.3-70-g09d2