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: 9264597 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 4ED2260467 for ; Thu, 4 Aug 2016 23:22:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3535D283DF for ; Thu, 4 Aug 2016 23:22:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29E8728424; Thu, 4 Aug 2016 23:22:45 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1587C283DF for ; Thu, 4 Aug 2016 23:22:42 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id CCF05265CA8; Fri, 5 Aug 2016 01:22:39 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id C1E91266BE4; Thu, 4 Aug 2016 17:00:32 +0200 (CEST) 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 40703267523; Thu, 4 Aug 2016 17:00:31 +0200 (CEST) Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by alsa0.perex.cz (Postfix) with ESMTP id BD7FB26792D for ; Thu, 4 Aug 2016 11:51:47 +0200 (CEST) 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 alsa-devel@alsa-project.org; Thu, 04 Aug 2016 18:51:44 +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 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= Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki , b.zolnierkie@samsung.com Subject: [alsa-devel] [PATCH] ASoC: samsung: Fix clock handling in S3C24XX_UDA134X card 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 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__);