From patchwork Wed Jan 14 18:42:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 5634691 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1EA049F444 for ; Wed, 14 Jan 2015 18:49:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 54FC32017E for ; Wed, 14 Jan 2015 18:49:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3ABDA2012E for ; Wed, 14 Jan 2015 18:49:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YBSxx-00008Z-Kp; Wed, 14 Jan 2015 18:46:53 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YBSv4-0005ZO-FR for linux-arm-kernel@lists.infradead.org; Wed, 14 Jan 2015 18:43:55 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NI600GFWK0ZPH60@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 15 Jan 2015 03:43:47 +0900 (KST) X-AuditID: cbfee61a-f79c06d000004e71-8d-54b6b8e35a84 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 26.82.20081.3E8B6B45; Thu, 15 Jan 2015 03:43:47 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NI600JMDJZE6P20@mmp1.samsung.com>; Thu, 15 Jan 2015 03:43:47 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org, kgene@kernel.org Subject: [PATCH V3 10/15] ASoC: samsung: odroidx2: Handle I2S CDCLK clock conditionally Date: Wed, 14 Jan 2015 19:42:37 +0100 Message-id: <1421260962-16892-11-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1421260962-16892-1-git-send-email-s.nawrocki@samsung.com> References: <1421260962-16892-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGLMWRmVeSWpSXmKPExsVy+t9jAd3HO7aFGDQe0rK4cvEQk8XUh0/Y LOYfOcdq8Wj+Y2aL/sevmS02Pb7GajHj/D4mi983v7NZHH7TzmpxccUXJgcujw2fm9g8Fn3P 8ti0qpPNY/OSeo++LasYPT5vkgtgi+KySUnNySxLLdK3S+DKuL56JlvBIu6KO6eWszQwLuHs YuTkkBAwkbj5fzIrhC0mceHeerYuRi4OIYFFjBL7e68zQjgdTBJLFi9gBKliEzCU6D3aB2aL CGhIbNn4lgmkiFngK6PE/6m9LCAJYYFIifMXX4LZLAKqErNO3AFr4BVwl7i+5B1QAwfQOgWJ OZNsQMKcQOHL5+4ygdhCAm4S7y99Z53AyLuAkWEVo2hqQXJBcVJ6rqFecWJucWleul5yfu4m RnDoPZPawbiyweIQowAHoxIPr8ORrSFCrIllxZW5hxglOJiVRHhXbdkWIsSbklhZlVqUH19U mpNafIhRmoNFSZxXyb4tREggPbEkNTs1tSC1CCbLxMEp1cAo51P+5W3Vdf6Zwq/YHO8mx5x6 PV2TNy+ky6B/6drtsvZRJ79U9ajefRr45mterbq1uMFuAevXrl1Peec360qxOPFoWT+OfqZ7 sIgrPolzy95cg9RZ4mlJMunxCr8tl6zPSDnUx/zLNuU3yz+vMt01ym9UBViDw+bPFtFJuJmW O2fS5MjwvUosxRmJhlrMRcWJABIGiUk5AgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150114_104354_684404_E2001C4E X-CRM114-Status: GOOD ( 12.33 ) X-Spam-Score: -5.0 (-----) Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, padma.v@samsung.com, sbkim73@samsung.com, drake@endlessm.com, Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In order to support old DTs we check the codec device node if it contains "clocks" property and only if it doesn't (which indicates an old DT) we proceed with enabling the CDCLK clock by means of the set_sysclk() callback. For new DTs which use the common clock bindings for CDCLK that clock is supposed to be handled outside the sound machine driver. Signed-off-by: Sylwester Nawrocki --- sound/soc/samsung/odroidx2_max98090.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/samsung/odroidx2_max98090.c b/sound/soc/samsung/odroidx2_max98090.c index fa4f1d2..596f118 100644 --- a/sound/soc/samsung/odroidx2_max98090.c +++ b/sound/soc/samsung/odroidx2_max98090.c @@ -21,6 +21,8 @@ struct odroidx2_drv_data { /* The I2S CDCLK output clock frequency for the MAX98090 codec */ #define MAX98090_MCLK 19200000 +static struct snd_soc_dai_link odroidx2_dai[]; + static int odroidx2_late_probe(struct snd_soc_card *card) { struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; @@ -29,7 +31,9 @@ static int odroidx2_late_probe(struct snd_soc_card *card) ret = snd_soc_dai_set_sysclk(codec_dai, 0, MAX98090_MCLK, SND_SOC_CLOCK_IN); - if (ret < 0) + + if (ret < 0 || of_find_property(odroidx2_dai[0].codec_of_node, + "clocks", NULL)) return ret; /* Set the cpu DAI configuration in order to use CDCLK */