Browse Source

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>
isee-imx_3.14.28.y
Shengjiu Wang 6 years ago
committed by Nitin Garg
parent
commit
52d7db754c
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      sound/soc/fsl/fsl_esai.c

+ 13
- 0
sound/soc/fsl/fsl_esai.c View File

@ -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];
@ -464,6 +465,9 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream,
* clocks, so keep all clocks open/close at the same time for safety
*/
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)) {
@ -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);


Loading…
Cancel
Save