From patchwork Thu Aug 4 09:51:25 2016 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: 9263207 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5C4EC6048F for ; Thu, 4 Aug 2016 09:52:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DA1228395 for ; Thu, 4 Aug 2016 09:52:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 421E6283AC; Thu, 4 Aug 2016 09:52:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9574928395 for ; Thu, 4 Aug 2016 09:52:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754207AbcHDJwY (ORCPT ); Thu, 4 Aug 2016 05:52:24 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:54972 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753475AbcHDJv7 (ORCPT ); Thu, 4 Aug 2016 05:51:59 -0400 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OBD00XN5Q28W860@mailout2.samsung.com> for linux-samsung-soc@vger.kernel.org; Thu, 04 Aug 2016 18:51:45 +0900 (KST) X-AuditID: cbfee61b-f79466d000001e3c-7b-57a31030a59a Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 5C.1A.07740.03013A75; Thu, 4 Aug 2016 02:51:44 -0700 (MST) Received: from AMDC1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OBD005ZVQ1XIC30@mmp2.samsung.com>; Thu, 04 Aug 2016 18:51:44 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Cc: alsa-devel@alsa-project.org, b.zolnierkie@samsung.com, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH] ASoC: samsung: Fix clock handling in S3C24XX_UDA134X card Date: Thu, 04 Aug 2016 11:51:25 +0200 Message-id: <1470304285-14831-1-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrAJMWRmVeSWpSXmKPExsVy+t9jQV0DgcXhBh03rCyuXDzEZLFxxnpW i6kPn7BZzDi/j8ni8Jt2VgdWjw2fm9g8Nq3qZPPo27KK0ePzJrkAligum5TUnMyy1CJ9uwSu jHO3VjEVdPJWbN5/ma2B8RZXFyMnh4SAicSSCXsZIWwxiQv31rN1MXJxCAnMYpTY+P4BlPOL UaJ36UQmkCo2AUOJ3qN9YB0iQB2353QygxQxC3QzSnxtWcAKkhAW8JK40NYPlODgYBFQldjy tRgkzCvgJnH17ENWiG1yEiePTWadwMi9gJFhFaNEakFyQXFSeq5RXmq5XnFibnFpXrpecn7u JkZwODyT3sF4eJf7IUYBDkYlHl6LiYvChVgTy4orcw8xSnAwK4nwmvItDhfiTUmsrEotyo8v Ks1JLT7EKM3BoiTO+/j/ujAhgfTEktTs1NSC1CKYLBMHp1QD48Ez193379p0IzY3RfH2wZWz r++ZV3879tv/3Mq1J/bpX1BhEDuyaZokz+LdnvunXJv8xHDq8+tXgkt5Vl+RWt5l9UDthY8L j3HRnu/XqzprDH50Xb/4h/Fyz3G3pfVcHuKHdDfucb0TZLToce6pm1+t6nuX5NQL7Lyae3/6 FWXTQ+uVXJ/vs9ugxFKckWioxVxUnAgAOu0pCwMCAAA= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is no "pclk" alias in the s3c2440 clk driver for "soc-audio" device so related clk_get() fails, which prevents any operation of the S3C24XX_UDA134X sound card. Instead we get the clock on behalf of the I2S device, i.e. we use the I2S block gate clock which has PCLK is its parent clock. Without this patch there is an error like: s3c24xx_uda134x_startup cannot get pclk ASoC: UDA134X startup failed: -2 Signed-off-by: Sylwester Nawrocki --- sound/soc/samsung/s3c24xx_uda134x.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/samsung/s3c24xx_uda134x.c b/sound/soc/samsung/s3c24xx_uda134x.c index 50849e1..92e88bc 100644 --- a/sound/soc/samsung/s3c24xx_uda134x.c +++ b/sound/soc/samsung/s3c24xx_uda134x.c @@ -58,10 +58,12 @@ static struct platform_device *s3c24xx_uda134x_snd_device; static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream) { - int ret = 0; + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; #ifdef ENFORCE_RATES struct snd_pcm_runtime *runtime = substream->runtime; #endif + int ret = 0; mutex_lock(&clk_lock); pr_debug("%s %d\n", __func__, clk_users); @@ -71,8 +73,7 @@ static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream) printk(KERN_ERR "%s cannot get xtal\n", __func__); ret = PTR_ERR(xtal); } else { - pclk = clk_get(&s3c24xx_uda134x_snd_device->dev, - "pclk"); + pclk = clk_get(cpu_dai->dev, "iis"); if (IS_ERR(pclk)) { printk(KERN_ERR "%s cannot get pclk\n", __func__);