From patchwork Fri Dec 7 08:29:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmavathi Venna X-Patchwork-Id: 1849111 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 58E9B3FCD5 for ; Fri, 7 Dec 2012 08:29:50 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TgtHC-0008TJ-F3; Fri, 07 Dec 2012 08:27:18 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TgtGl-0008Du-W7 for linux-arm-kernel@lists.infradead.org; Fri, 07 Dec 2012 08:26:53 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MEN00A01JF6Q1R0@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 07 Dec 2012 17:26:40 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.123]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 0D.A6.12699.048A1C05; Fri, 07 Dec 2012 17:26:40 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-e3-50c1a8404634 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id BB.A6.12699.F38A1C05; Fri, 07 Dec 2012 17:26:40 +0900 (KST) Received: from padma-linuxpc.sisodomain.com ([107.108.83.35]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MEN00FSFJG1WS20@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 07 Dec 2012 17:26:39 +0900 (KST) From: Padmavathi Venna To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, alsa-devel@alsa-project.org, devicetree-discuss@lists.ozlabs.org, padma.kvr@gmail.com Subject: [PATCH RESEND V2 2/2] ASoC: SMDK: WM8994: Add device tree support for machine file Date: Fri, 07 Dec 2012 13:59:22 +0530 Message-id: <1354868962-7862-3-git-send-email-padma.v@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1354868962-7862-1-git-send-email-padma.v@samsung.com> References: <1354868962-7862-1-git-send-email-padma.v@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDLMWRmVeSWpSXmKPExsWyRsSkWtdhxcEAgw3TBC02Pb7G6sDosXlJ fQBjFJdNSmpOZllqkb5dAlfGm+2rWArWSVesfbGAuYFxu1gXIweHhICJxJWpHF2MnECmmMSF e+vZuhi5OIQEljJKfPh9lQUiYSLx9MVPqMR0Ron/c68wQzhbmSQ+bjnOCDKJTUBHouWsC0hc RGAZo8SsQ+9YQBxmgdNMEp/7prCDjBIWiJU4/vEtmM0ioCpxqO0cE4jNK+Ak0XD8HDPEOgWJ Y1O/soLYnALOEo9nTwarFwKqefmhhQmiV0Di2+RDLBAvyEpsOgB2kITAdTaJSVt2s0PMkZQ4 uOIGywRG4QWMDKsYRVMLkguKk9JzjfSKE3OLS/PS9ZLzczcxAoPw9L9n0jsYVzVYHGIU4GBU 4uHVeHIgQIg1say4MvcQowQHs5IIb0ffwQAh3pTEyqrUovz4otKc1OJDjD5Al0xklhJNzgdG SF5JvKGxibmpsamlkZGZqSkOYSVx3maPlAAhgfTEktTs1NSC1CKYcUwcnFINjHP3PnZc7nYk PGlVxuJD6xf8Wrb5iNR2zslWVRua5T4n7dFgzRc/mcgzteJQYuaHH27z044zO+lp52UkMWV+ 0Zkv7Mv9PikmKnMub0O9jfrMh8WVaumzmTfnXw0/+VL/8aWwUxJzW3v3CB7Q8bv2/9thUc81 ZQf9eRsX1NYI/Nl7poyhsspeTomlOCPRUIu5qDgRAKrmDS9vAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42I5/e+xoK7DioMBBpvuM1tsenyN1YHRY/OS +gDGqAZGm4zUxJTUIoXUvOT8lMy8dFsl7+B453hTMwNDXUNLC3MlhbzE3FRbJRefAF23zByg qUoKZYk5pUChgMTiYiV9O0wTQkPcdC1gGiN0fUOC4HqMDNBAwhrGjDfbV7EUrJOuWPtiAXMD 43axLkZODgkBE4mnL36yQdhiEhfurQeyuTiEBKYzSvyfe4UZwtnKJPFxy3HGLkYODjYBHYmW sy4gcRGBZYwSsw69YwFxmAVOM0l87pvCDjJKWCBW4vjHt2A2i4CqxKG2c0wgNq+Ak0TD8XPM EOsUJI5N/coKYnMKOEs8nj0ZrF4IqOblhxamCYy8CxgZVjGKphYkFxQnpeca6RUn5haX5qXr JefnbmIEB/kz6R2MqxosDjEKcDAq8fBqPDkQIMSaWFZcmXuIUYKDWUmEt6PvYIAQb0piZVVq UX58UWlOavEhRh+gqyYyS4km5wMjMK8k3tDYxNzU2NTSxMLEzBKHsJI4b7NHSoCQQHpiSWp2 ampBahHMOCYOTqkGxpyq4Jm/Ht368NTU27s05LlGzg/NRf8dFltWaTIn9nEcUbHXVAzbKfV2 72TPbJ5sB5EjPAuTDge6/C7kK4zmyGBaJiZd8XdD05Vg7p1tl3Xvz/e8PeGXgmr0v//bK2/9 jRJsOnC6tmGpeArn7Bu9gVmfZU4dbWW1dfp992Enh8BT7YSSjBYdJZbijERDLeai4kQAuqGU MZ8CAAA= X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121207_032652_557234_E0BEAF77 X-CRM114-Status: GOOD ( 15.67 ) X-Spam-Score: -4.6 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.34 listed in list.dnswl.org] 3.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: jassisinghbrar@gmail.com, kgene.kim@samsung.com, philipp.zabel@gmail.com, sbkim73@samsung.com, graeme.gregory@wolfsonmicro.com, broonie@opensource.wolfsonmicro.com, mcuelenaere@gmail.com, anarsoul@gmail.com, tiwai@suse.de, ben-linux@fluff.org, dgreenday@gmail.com, chripell@evolware.org, lrg@ti.com, lrg@slimlogic.co.uk X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add the basic device tree based lookup. Signed-off-by: Padmavathi Venna --- .../bindings/sound/samsung,smdk-wm8994.txt | 14 ++++++++++ arch/arm/boot/dts/exynos5250-smdk5250.dts | 12 +++++++++ sound/soc/samsung/smdk_wm8994.c | 26 ++++++++++++++++++++ 3 files changed, 52 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/samsung,smdk-wm8994.txt 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 0000000..13cb189 --- /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 = <&i2s_0>; + samsung,audio-codec = <&wm8994>; +}; diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts index a352df4..5cbb08d 100644 --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts @@ -53,6 +53,11 @@ compatible = "samsung,s524ad0xd1"; reg = <0x51>; }; + + wm8994: wm8994@1a { + compatible = "wlf,wm8994"; + reg = <0x1a>; + }; }; i2c@12C80000 { @@ -166,4 +171,11 @@ spi_2: spi@12d40000 { status = "disabled"; }; + + sound { + compatible = "samsung,smdk-wm8994"; + + samsung,i2s-controller = <&i2s_0>; + samsung,audio-codec = <&wm8994>; + }; }; diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c index dd0aa8c..2f3e2b8 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 __devinit 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 __devexit 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 = __devexit_p(smdk_audio_remove),