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: 5634701 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6A1EFC058D for ; Wed, 14 Jan 2015 18:49:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B7BB201BC for ; Wed, 14 Jan 2015 18:49:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7B40A201B9 for ; Wed, 14 Jan 2015 18:49:49 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id BCE28265867; Wed, 14 Jan 2015 19:49:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C783B265357; Wed, 14 Jan 2015 19:44:51 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id C83DF265357; Wed, 14 Jan 2015 19:44:48 +0100 (CET) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by alsa0.perex.cz (Postfix) with ESMTP id D00F6265350 for ; Wed, 14 Jan 2015 19:43:48 +0100 (CET) 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 alsa-devel@alsa-project.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 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 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 Subject: [alsa-devel] [PATCH V3 10/15] ASoC: samsung: odroidx2: Handle I2S CDCLK clock conditionally X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.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 */