From patchwork Fri Dec 19 13:55:31 2014 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: 5519951 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2DC15BEEBA for ; Fri, 19 Dec 2014 14:06:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C2982010B for ; Fri, 19 Dec 2014 14:06:48 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 259BB2014A for ; Fri, 19 Dec 2014 14:06:47 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1EC162651EB; Fri, 19 Dec 2014 15:06:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: 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 8237B2650BA; Fri, 19 Dec 2014 15:02:35 +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 E94332650C3; Fri, 19 Dec 2014 15:02:33 +0100 (CET) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by alsa0.perex.cz (Postfix) with ESMTP id 42344264F45 for ; Fri, 19 Dec 2014 14:59:21 +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 <0NGU00BS61IW8470@mailout1.samsung.com> for alsa-devel@alsa-project.org; Fri, 19 Dec 2014 22:59:20 +0900 (KST) X-AuditID: cbfee61a-f79c06d000004e71-88-54942f379ca8 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 37.44.20081.73F24945; Fri, 19 Dec 2014 22:59:20 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NGU00HVQ1CREV30@mmp2.samsung.com>; Fri, 19 Dec 2014 22:59:19 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org, kgene@kernel.org, alsa-devel@alsa-project.org Date: Fri, 19 Dec 2014 14:55:31 +0100 Message-id: <1418997336-17777-12-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1418997336-17777-1-git-send-email-s.nawrocki@samsung.com> References: <1418997336-17777-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrILMWRmVeSWpSXmKPExsVy+t9jQV0L/SkhBpc/MltcuXiIyWLqwyds FvOPnGO1eDT/MbNF/+PXzBabHl9jtZhxfh+Txe+b39ksDr9pZ7W4uOILkwOXx4bPTWwei75n eWxa1cnmsXlJvUffllWMHp83yQWwRXHZpKTmZJalFunbJXBlvDt0ir1gEXdFR79LA+MSzi5G Dg4JAROJhx9Suhg5gUwxiQv31rN1MXJxCAlMZ5SY2byAFcLpYJLY8aiRBaSKTcBQovdoHyOI LSLgKvH4/00WkCJmgWuMEi8+TWEHmSosECnRt88JxGQRUJVYeN4RpJxXwF3i76/bjBB7FSTm TLIBMTmBwsuWeoBUCAm4SWw/sZ1tAiPvAkaGVYyiqQXJBcVJ6bmGesWJucWleel6yfm5mxjB AfdMagfjygaLQ4wCHIxKPLwdhZNDhFgTy4orcw8xSnAwK4nwfhSeEiLEm5JYWZValB9fVJqT WnyIUZqDRUmcV8m+LURIID2xJDU7NbUgtQgmy8TBKdXAeJxBmON3Zznr18SZ8xwEbn9a+1d/ hZaOfIx1Z96CuVlHmxi49cqnPnxxNoV90XP1df9CqgWNmFqPeTFyFf/a+jSf8eK/Cyc4s9cE S5zvdF8SXZ905nupGEd2iImZV4/SV/+k/dJ8a3zFbvWwrNjm+7Hm3deWWO21aben8d5JWjPr D/NFabXHSizFGYmGWsxFxYkAAN7epzQCAAA= Cc: devicetree@vger.kernel.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 v2 11/16] 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 d7640e7..5a87794 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 */