From patchwork Wed Mar 27 11:22:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Pargmann X-Patchwork-Id: 2349901 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 62436DFE82 for ; Wed, 27 Mar 2013 11:29:11 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UKoUE-0004hT-Fq; Wed, 27 Mar 2013 11:25:46 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UKoRk-0003BD-JJ for linux-arm-kernel@lists.infradead.org; Wed, 27 Mar 2013 11:23:14 +0000 Received: from dude.hi.pengutronix.de ([2001:6f8:1178:2:21e:67ff:fe11:9c5c]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1UKoRd-0007R4-JE; Wed, 27 Mar 2013 12:23:05 +0100 Received: from mpa by dude.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1UKoRc-0003Pt-OL; Wed, 27 Mar 2013 12:23:04 +0100 From: Markus Pargmann To: Sascha Hauer Subject: [PATCH 2/2] ARM: clk: imx35 sound admux_gate bugfix Date: Wed, 27 Mar 2013 12:22:32 +0100 Message-Id: <1364383352-27267-3-git-send-email-mpa@pengutronix.de> X-Mailer: git-send-email 1.8.2.rc2 In-Reply-To: <1364383352-27267-1-git-send-email-mpa@pengutronix.de> References: <1364383352-27267-1-git-send-email-mpa@pengutronix.de> X-SA-Exim-Connect-IP: 2001:6f8:1178:2:21e:67ff:fe11:9c5c X-SA-Exim-Mail-From: mpa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130327_072313_048681_76A95FF5 X-CRM114-Status: GOOD ( 17.44 ) X-Spam-Score: -3.2 (---) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-3.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.3 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Fabio Estevam , alsa-devel@alsa-project.org, Mark Brown , Liam Girdwood , stable@vger.kernel.org, Markus Pargmann , Shawn Guo , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org imx-ssi needs admux_gate clock to work on imx35. This patch registers this clock and enables it in the imx-ssi driver. A reboot without this patch results in a failing AC97 for example on pcm043. Signed-off-by: Markus Pargmann Cc: stable@vger.kernel.org --- arch/arm/mach-imx/clk-imx25.c | 6 ++++-- arch/arm/mach-imx/clk-imx27.c | 6 ++++-- arch/arm/mach-imx/clk-imx31.c | 6 ++++-- arch/arm/mach-imx/clk-imx35.c | 6 ++++-- arch/arm/mach-imx/clk-imx51-imx53.c | 9 ++++++--- sound/soc/fsl/imx-ssi.c | 16 +++++++++++++++- sound/soc/fsl/imx-ssi.h | 2 ++ 7 files changed, 39 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c index 69858c7..174ff8b 100644 --- a/arch/arm/mach-imx/clk-imx25.c +++ b/arch/arm/mach-imx/clk-imx25.c @@ -285,8 +285,10 @@ int __init mx25_clocks_init(void) clk_register_clkdev(clk[lcdc_ipg], "ipg", "imx21-fb.0"); clk_register_clkdev(clk[lcdc_ahb], "ahb", "imx21-fb.0"); clk_register_clkdev(clk[wdt_ipg], NULL, "imx2-wdt.0"); - clk_register_clkdev(clk[ssi1_ipg], NULL, "imx-ssi.0"); - clk_register_clkdev(clk[ssi2_ipg], NULL, "imx-ssi.1"); + clk_register_clkdev(clk[ssi1_ipg], "ipg", "imx-ssi.0"); + clk_register_clkdev(clk[ssi2_ipg], "ipg", "imx-ssi.1"); + clk_register_clkdev(clk[dummy], "admux", "imx-ssi.0"); + clk_register_clkdev(clk[dummy], "admux", "imx-ssi.1"); clk_register_clkdev(clk[esdhc1_ipg_per], "per", "sdhci-esdhc-imx25.0"); clk_register_clkdev(clk[esdhc1_ipg], "ipg", "sdhci-esdhc-imx25.0"); clk_register_clkdev(clk[esdhc1_ahb], "ahb", "sdhci-esdhc-imx25.0"); diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c index 30b3242..439d5bd 100644 --- a/arch/arm/mach-imx/clk-imx27.c +++ b/arch/arm/mach-imx/clk-imx27.c @@ -252,8 +252,10 @@ int __init mx27_clocks_init(unsigned long fref) clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.2"); clk_register_clkdev(clk[usb_ipg_gate], "ipg", "mxc-ehci.2"); clk_register_clkdev(clk[usb_ahb_gate], "ahb", "mxc-ehci.2"); - clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "imx-ssi.0"); - clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1"); + clk_register_clkdev(clk[ssi1_ipg_gate], "ipg", "imx-ssi.0"); + clk_register_clkdev(clk[ssi2_ipg_gate], "ipg", "imx-ssi.1"); + clk_register_clkdev(clk[dummy], "admux", "imx-ssi.0"); + clk_register_clkdev(clk[dummy], "admux", "imx-ssi.1"); clk_register_clkdev(clk[nfc_baud_gate], NULL, "imx27-nand.0"); clk_register_clkdev(clk[vpu_baud_gate], "per", "coda-imx27.0"); clk_register_clkdev(clk[vpu_ahb_gate], "ahb", "coda-imx27.0"); diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c index b5b65f3..478b33e 100644 --- a/arch/arm/mach-imx/clk-imx31.c +++ b/arch/arm/mach-imx/clk-imx31.c @@ -171,8 +171,10 @@ int __init mx31_clocks_init(unsigned long fref) clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0"); clk_register_clkdev(clk[sdhc1_gate], NULL, "imx31-mmc.0"); clk_register_clkdev(clk[sdhc2_gate], NULL, "imx31-mmc.1"); - clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0"); - clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1"); + clk_register_clkdev(clk[ssi1_gate], "ipg", "imx-ssi.0"); + clk_register_clkdev(clk[ssi2_gate], "ipg", "imx-ssi.1"); + clk_register_clkdev(clk[dummy], "admux", "imx-ssi.0"); + clk_register_clkdev(clk[dummy], "admux", "imx-ssi.1"); clk_register_clkdev(clk[firi_gate], "firi", NULL); clk_register_clkdev(clk[ata_gate], NULL, "pata_imx"); clk_register_clkdev(clk[rtic_gate], "rtic", NULL); diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c index b95898a..4ab18ac 100644 --- a/arch/arm/mach-imx/clk-imx35.c +++ b/arch/arm/mach-imx/clk-imx35.c @@ -233,8 +233,10 @@ int __init mx35_clocks_init(void) clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad"); clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1"); clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma"); - clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0"); - clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1"); + clk_register_clkdev(clk[ssi1_gate], "ipg", "imx-ssi.0"); + clk_register_clkdev(clk[ssi2_gate], "ipg", "imx-ssi.1"); + clk_register_clkdev(clk[admux_gate], "admux", "imx-ssi.0"); + clk_register_clkdev(clk[admux_gate], "admux", "imx-ssi.1"); /* i.mx35 has the i.mx21 type uart */ clk_register_clkdev(clk[uart1_gate], "per", "imx21-uart.0"); clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.0"); diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c index 0f39f8c..b413a1e 100644 --- a/arch/arm/mach-imx/clk-imx51-imx53.c +++ b/arch/arm/mach-imx/clk-imx51-imx53.c @@ -275,9 +275,12 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil, clk_register_clkdev(clk[usboh3_gate], "ipg", "imx-udc-mx51"); clk_register_clkdev(clk[usboh3_gate], "ahb", "imx-udc-mx51"); clk_register_clkdev(clk[nfc_gate], NULL, "imx51-nand"); - clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "imx-ssi.0"); - clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1"); - clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "imx-ssi.2"); + clk_register_clkdev(clk[ssi1_ipg_gate], "ipg", "imx-ssi.0"); + clk_register_clkdev(clk[ssi2_ipg_gate], "ipg", "imx-ssi.1"); + clk_register_clkdev(clk[ssi3_ipg_gate], "ipg", "imx-ssi.2"); + clk_register_clkdev(clk[dummy], "admux", "imx-ssi.0"); + clk_register_clkdev(clk[dummy], "admux", "imx-ssi.1"); + clk_register_clkdev(clk[dummy], "admux", "imx-ssi.2"); clk_register_clkdev(clk[ssi_ext1_gate], "ssi_ext1", NULL); clk_register_clkdev(clk[ssi_ext2_gate], "ssi_ext2", NULL); clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma"); diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c index 55464a5..9f96785 100644 --- a/sound/soc/fsl/imx-ssi.c +++ b/sound/soc/fsl/imx-ssi.c @@ -535,7 +535,7 @@ static int imx_ssi_probe(struct platform_device *pdev) ssi->irq = platform_get_irq(pdev, 0); - ssi->clk = devm_clk_get(&pdev->dev, NULL); + ssi->clk = devm_clk_get(&pdev->dev, "ipg"); if (IS_ERR(ssi->clk)) { ret = PTR_ERR(ssi->clk); dev_err(&pdev->dev, "Cannot get the clock: %d\n", @@ -544,6 +544,15 @@ static int imx_ssi_probe(struct platform_device *pdev) } clk_prepare_enable(ssi->clk); + ssi->admux_clk = devm_clk_get(&pdev->dev, "admux"); + if (IS_ERR(ssi->admux_clk)) { + if (PTR_ERR(ssi->admux_clk) == -ENOMEM) + goto failed_admux_clk_mem; + ssi->admux_clk = NULL; + } else { + clk_prepare_enable(ssi->admux_clk); + } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { ret = -ENODEV; @@ -631,6 +640,9 @@ failed_pdev_fiq_alloc: failed_register: release_mem_region(res->start, resource_size(res)); failed_get_resource: + if (ssi->admux_clk) + clk_disable_unprepare(ssi->admux_clk); +failed_admux_clk_mem: clk_disable_unprepare(ssi->clk); failed_clk: @@ -652,6 +664,8 @@ static int imx_ssi_remove(struct platform_device *pdev) release_mem_region(res->start, resource_size(res)); clk_disable_unprepare(ssi->clk); + if (ssi->admux_clk) + clk_disable_unprepare(ssi->admux_clk); return 0; } diff --git a/sound/soc/fsl/imx-ssi.h b/sound/soc/fsl/imx-ssi.h index dc114bd..3dfbd92 100644 --- a/sound/soc/fsl/imx-ssi.h +++ b/sound/soc/fsl/imx-ssi.h @@ -194,6 +194,8 @@ struct imx_ssi { struct snd_soc_dai *imx_ac97; struct clk *clk; + /* imx35 has a admux clock that has to be active for sound to work */ + struct clk *admux_clk; void __iomem *base; int irq; int fiq_enable;