From patchwork Sat Dec 1 10:07:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmavathi Venna X-Patchwork-Id: 1828891 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 43D6C3FC64 for ; Sat, 1 Dec 2012 10:14:36 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tek1e-0006VE-00; Sat, 01 Dec 2012 10:10:22 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tejv9-0005PT-KW for linux-arm-kernel@lists.infradead.org; Sat, 01 Dec 2012 10:03:41 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MEC00J2MJWIP350@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Sat, 01 Dec 2012 19:03:36 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.122]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id D4.AF.01231.8F5D9B05; Sat, 01 Dec 2012 19:03:36 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-68-50b9d5f87bac Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 24.AF.01231.7F5D9B05; Sat, 01 Dec 2012 19:03:35 +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 <0MEC00MJCJXROT30@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Sat, 01 Dec 2012 19:03:35 +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 1/2] ASoC: Samsung: WM8994: Add basic device tree support for machine file Date: Sat, 01 Dec 2012 15:37:26 +0530 Message-id: <1354356447-16784-2-git-send-email-padma.v@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1354356447-16784-1-git-send-email-padma.v@samsung.com> References: <1354356447-16784-1-git-send-email-padma.v@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNLMWRmVeSWpSXmKPExsWyRsSkSvfH1Z0BBpffs1tsenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6Mhw+WMxas46u4efEfawPjPe4uRk4OCQETiSPrdzBD2GISF+6t Z+ti5OIQEljKKPF/7VsmmKKFv5qgEtMZJSafucAK4Wxlkti29RFLFyMHB5uAjkTLWReQuIjA MkaJWYfesYA4zAKtjBLLbzYwgowSFoiR+PeqixWkgUVAVWLa/GwQk1fAWWLBYy6IZQoSx6Z+ ZQWxOQVcJO78PQd2hBBQyYEdLewgNouAgMS3yYfA1koIyEpsOsAMsklC4DabxPK+s4wQcyQl Dq64wTKBUXgBI8MqRtHUguSC4qT0XEO94sTc4tK8dL3k/NxNjMAQPP3vmdQOxpUNFocYBTgY lXh4Ex/uCBBiTSwrrsw9xCjBwawkwrts2c4AId6UxMqq1KL8+KLSnNTiQ4w+QJdMZJYSTc4H xkdeSbyhsYm5qbGppZGRmakpDmElcd5mj5QAIYH0xJLU7NTUgtQimHFMHJxSDYxTghhnNp/8 raF77v7uOZsXVBqcN+qxkQu4eeSZUpgNV3z43RcfTZuXt7w8knNr45qvHscuRzPd3bko+ltZ n9/1XX9eOi5XNlzYqqx3cYrVY+Xrn78f2VV84P2ktisztq5lmPN1GqPPxqwerWTtTrMNhcxO Z+Vepk+7yOum6ZpUpxI075jh9Me1SizFGYmGWsxFxYkAuDoWZm4CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupikeLIzCtJLcpLzFFi42I5/e+xoO73qzsDDM7tsrLY9PgaqwOjx+Yl 9QGMUQ2MNhmpiSmpRQqpecn5KZl56bZK3sHxzvGmZgaGuoaWFuZKCnmJuam2Si4+AbpumTlA U5UUyhJzSoFCAYnFxUr6dpgmhIa46VrANEbo+oYEwfUYGaCBhDWMGQ8fLGcsWMdXcfPiP9YG xnvcXYycHBICJhILfzWxQdhiEhfurQeyuTiEBKYzSkw+c4EVwtnKJLFt6yOWLkYODjYBHYmW sy4gcRGBZYwSsw69YwFxmAVaGSWW32xgBBklLBAj8e9VFytIA4uAqsS0+dkgJq+As8SCx1wQ yxQkjk39ygpicwq4SNz5e44JxBYCKjmwo4V9AiPvAkaGVYyiqQXJBcVJ6bmGesWJucWleel6 yfm5mxjBAf5MagfjygaLQ4wCHIxKPLyJD3cECLEmlhVX5h5ilOBgVhLhXbZsZ4AQb0piZVVq UX58UWlOavEhRh+gmyYyS4km5wOjL68k3tDYxNzU2NTSxMLEzBKHsJI4b7NHSoCQQHpiSWp2 ampBahHMOCYOTqkGxj3z7gp84jB35jKVdPqy7C5j9YO+vwyf2vco2vJ/kfC5b+Vyd9V5o7gX q6aIvpHJPL5x+mmP9Qukffn0LwWI+vJIyjE4Z+78cCV3xnFvXs2Ip70Pd3z7lOWk+mq5T8Gd oyIMKz0e/3/L3jNXuyZZY1Hss0dLjwgeerVXI3FrvEhtR+a9Y/P3+ymxFGckGmoxFxUnAgAO 7s4jnQIAAA== X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121201_050340_052659_5EA273C6 X-CRM114-Status: GOOD ( 13.26 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.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] -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: kgene.kim@samsung.com, sbkim73@samsung.com, broonie@opensource.wolfsonmicro.com, tiwai@suse.de, ben-linux@fluff.org, lrg@ti.com 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 --- sound/soc/samsung/smdk_wm8994.c | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c index 48dd4dd..f9ba2b9 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,22 @@ 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; + } + } + ret = snd_soc_register_card(card); if (ret) @@ -173,10 +187,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),