From: Fabio Estevam <fabio.estevam@freescale.com>
To: kernel@pengutronix.de
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
alsa-devel@alsa-project.org, broonie@opensource.wolfsonmicro.com,
linux-arm-kernel@lists.infradead.org, gcembed@gmail.com
Subject: [PATCH 2/2] ASoC: imx-ssi: Adopt 'per' and 'ipg' clocks
Date: Mon, 8 Oct 2012 16:34:00 -0300 [thread overview]
Message-ID: <1349724840-10466-2-git-send-email-fabio.estevam@freescale.com> (raw)
In-Reply-To: <1349724840-10466-1-git-send-email-fabio.estevam@freescale.com>
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 <fabio.estevam@freescale.com>
---
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;
--
1.7.9.5
prev parent reply other threads:[~2012-10-08 19:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-08 19:33 [PATCH 1/2] ARM: imx: clk: Split SSI clock into 'ipg' and 'per' Fabio Estevam
2012-10-08 19:34 ` Fabio Estevam [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1349724840-10466-2-git-send-email-fabio.estevam@freescale.com \
--to=fabio.estevam@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=gcembed@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).