From patchwork Mon Oct 8 19:34:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 1566771 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 5522ADFF71 for ; Mon, 8 Oct 2012 19:36:26 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TLJ5v-0003qw-0r; Mon, 08 Oct 2012 19:34:27 +0000 Received: from am1ehsobe006.messaging.microsoft.com ([213.199.154.209] helo=am1outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TLJ5r-0003qe-3R for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2012 19:34:23 +0000 Received: from mail103-am1-R.bigfish.com (10.3.201.236) by AM1EHSOBE006.bigfish.com (10.3.204.26) with Microsoft SMTP Server id 14.1.225.23; Mon, 8 Oct 2012 19:34:15 +0000 Received: from mail103-am1 (localhost [127.0.0.1]) by mail103-am1-R.bigfish.com (Postfix) with ESMTP id 15A062C005E; Mon, 8 Oct 2012 19:34:15 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1202h1d1ah1d2ahzz8275bhz2dh2a8h668h839hd24he5bhf0ah107ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1155h) Received: from mail103-am1 (localhost.localdomain [127.0.0.1]) by mail103-am1 (MessageSwitch) id 134972485293289_11615; Mon, 8 Oct 2012 19:34:12 +0000 (UTC) Received: from AM1EHSMHS016.bigfish.com (unknown [10.3.201.240]) by mail103-am1.bigfish.com (Postfix) with ESMTP id 0807780017; Mon, 8 Oct 2012 19:34:12 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS016.bigfish.com (10.3.207.154) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 8 Oct 2012 19:34:11 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.309.3; Mon, 8 Oct 2012 19:34:09 +0000 Received: from fabio-Latitude-E6410.am.freescale.net ([10.29.240.141]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id q98JY29B016886; Mon, 8 Oct 2012 12:34:07 -0700 From: Fabio Estevam To: Subject: [PATCH 2/2] ASoC: imx-ssi: Adopt 'per' and 'ipg' clocks Date: Mon, 8 Oct 2012 16:34:00 -0300 Message-ID: <1349724840-10466-2-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349724840-10466-1-git-send-email-fabio.estevam@freescale.com> References: <1349724840-10466-1-git-send-email-fabio.estevam@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [213.199.154.209 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Fabio Estevam , alsa-devel@alsa-project.org, broonie@opensource.wolfsonmicro.com, linux-arm-kernel@lists.infradead.org, gcembed@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Currently imx ssi driver has been using only the ipg clock as only slave mode is supported. For mx27 it is necessay to provide both 'ipg' and 'per' clocks in order to get ssi functional. This issue was found on mx27 by unselecting the mmc driver from the kernel ,which resulted on a system that could not play audio. When the mmc driver is selected the required 'per2' clock is provided and it allows the ssi to work. So make the driver request and handle both clocks. Signed-off-by: Fabio Estevam --- sound/soc/fsl/imx-ssi.c | 25 ++++++++++++++++++------- sound/soc/fsl/imx-ssi.h | 2 +- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c index 006f7d4..0742153 100644 --- a/sound/soc/fsl/imx-ssi.c +++ b/sound/soc/fsl/imx-ssi.c @@ -536,14 +536,23 @@ static int imx_ssi_probe(struct platform_device *pdev) ssi->irq = platform_get_irq(pdev, 0); - ssi->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(ssi->clk)) { - ret = PTR_ERR(ssi->clk); - dev_err(&pdev->dev, "Cannot get the clock: %d\n", + ssi->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); + if (IS_ERR(ssi->clk_ipg)) { + ret = PTR_ERR(ssi->clk_ipg); + dev_err(&pdev->dev, "Cannot get the ipg clock: %d\n", ret); goto failed_clk; } - clk_prepare_enable(ssi->clk); + clk_prepare_enable(ssi->clk_ipg); + + ssi->clk_per = devm_clk_get(&pdev->dev, "per"); + if (IS_ERR(ssi->clk_per)) { + ret = PTR_ERR(ssi->clk_per); + dev_err(&pdev->dev, "Cannot get the per clock: %d\n", + ret); + goto failed_clk; + } + clk_prepare_enable(ssi->clk_per); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { @@ -633,7 +642,8 @@ failed_pdev_fiq_alloc: failed_register: release_mem_region(res->start, resource_size(res)); failed_get_resource: - clk_disable_unprepare(ssi->clk); + clk_disable_unprepare(ssi->clk_ipg); + clk_disable_unprepare(ssi->clk_per); failed_clk: return ret; @@ -653,7 +663,8 @@ static int __devexit imx_ssi_remove(struct platform_device *pdev) ac97_ssi = NULL; release_mem_region(res->start, resource_size(res)); - clk_disable_unprepare(ssi->clk); + clk_disable_unprepare(ssi->clk_ipg); + clk_disable_unprepare(ssi->clk_per); return 0; } diff --git a/sound/soc/fsl/imx-ssi.h b/sound/soc/fsl/imx-ssi.h index dc114bd..1ac54c9 100644 --- a/sound/soc/fsl/imx-ssi.h +++ b/sound/soc/fsl/imx-ssi.h @@ -193,7 +193,7 @@ struct imx_ssi { struct platform_device *ac97_dev; struct snd_soc_dai *imx_ac97; - struct clk *clk; + struct clk *clk_ipg, *clk_per; void __iomem *base; int irq; int fiq_enable;