summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2014-09-17 16:42:32 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-01-15 21:17:55 -0600
commit52d7db754c52578b63c9f998f476df333dd2489b (patch)
tree8a81244fba59290a4c433985f4e2b3683342792c /sound
parentecedd4b80b18886861e7d4fa23e5f7c4d014aefe (diff)
ENGR00331799-5: ASoC: fsl_esai: add spba clock support
esai need to enable the spba clock, when sdma is using share peripheral script. If don't enable it, may cause the read/write wrong data from/to register. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_esai.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index a3b29ed84963..f942d3f88d03 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -53,6 +53,7 @@ struct fsl_esai {
struct clk *coreclk;
struct clk *extalclk;
struct clk *fsysclk;
+ struct clk *dmaclk;
u32 fifo_depth;
u32 slot_width;
u32 hck_rate[2];
@@ -466,6 +467,9 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream,
ret = clk_prepare_enable(esai_priv->coreclk);
if (ret)
return ret;
+ ret = clk_prepare_enable(esai_priv->dmaclk);
+ if (ret)
+ return ret;
if (!IS_ERR(esai_priv->extalclk)) {
ret = clk_prepare_enable(esai_priv->extalclk);
if (ret)
@@ -496,6 +500,7 @@ err_fsysclk:
if (!IS_ERR(esai_priv->extalclk))
clk_disable_unprepare(esai_priv->extalclk);
err_extalck:
+ clk_disable_unprepare(esai_priv->dmaclk);
clk_disable_unprepare(esai_priv->coreclk);
return ret;
@@ -555,6 +560,7 @@ static void fsl_esai_shutdown(struct snd_pcm_substream *substream,
clk_disable_unprepare(esai_priv->fsysclk);
if (!IS_ERR(esai_priv->extalclk))
clk_disable_unprepare(esai_priv->extalclk);
+ clk_disable_unprepare(esai_priv->dmaclk);
clk_disable_unprepare(esai_priv->coreclk);
}
@@ -765,6 +771,13 @@ static int fsl_esai_probe(struct platform_device *pdev)
dev_warn(&pdev->dev, "failed to get fsys clock: %ld\n",
PTR_ERR(esai_priv->fsysclk));
+ esai_priv->dmaclk = devm_clk_get(&pdev->dev, "dma");
+ if (IS_ERR(esai_priv->dmaclk)) {
+ dev_err(&pdev->dev, "Cannot get dma clock: %ld\n",
+ PTR_ERR(esai_priv->dmaclk));
+ return PTR_ERR(esai_priv->dmaclk);
+ }
+
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);