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: 5634471 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 6BDA89F444 for ; Wed, 14 Jan 2015 18:43:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 99861201B9 for ; Wed, 14 Jan 2015 18:43:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B6C5201C8 for ; Wed, 14 Jan 2015 18:43:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754251AbbANSnt (ORCPT ); Wed, 14 Jan 2015 13:43:49 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:19963 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752733AbbANSnt (ORCPT ); Wed, 14 Jan 2015 13:43:49 -0500 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>; 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 Cc: padma.v@samsung.com, drake@endlessm.com, sbkim73@samsung.com, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sylwester Nawrocki 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 */