summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolin Chen <b42378@freescale.com>2013-08-05 15:07:21 +0800
committerJason Liu <r64343@freescale.com>2013-08-23 07:30:07 +0800
commita7093abd1e1186da195666a0c932409ca74f913b (patch)
tree469e41177e0dd80509d181cfddf8857293756202
parent046dae5f01743e0414110110181934d56409ebbb (diff)
ENGR00273838-5 ASoC: fsl: Add clock control for ssi
Enable core clock when startup and disable it when shutdown to save power. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
-rw-r--r--sound/soc/fsl/fsl_ssi.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 7cef35d9af60..70df5a0caca7 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -330,6 +330,8 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream,
snd_soc_dai_get_drvdata(rtd->cpu_dai);
int synchronous = ssi_private->cpu_dai_drv.symmetric_rates;
+ clk_enable(ssi_private->clk);
+
/*
* If this is the first stream opened, then request the IRQ
* and initialize the SSI registers.
@@ -573,6 +575,8 @@ static void fsl_ssi_shutdown(struct snd_pcm_substream *substream,
ssi_private->second_stream = NULL;
+ clk_disable(ssi_private->clk);
+
/* If this is the last active substream, disable the interrupts. */
if (!ssi_private->first_stream) {
struct ccsr_ssi __iomem *ssi = ssi_private->ssi;
@@ -779,7 +783,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "could not get clock: %d\n", ret);
goto error_irq;
}
- clk_prepare_enable(ssi_private->clk);
+ clk_prepare(ssi_private->clk);
/*
* We have burstsize be "fifo_depth - 2" to match the SSI
@@ -872,7 +876,7 @@ error_dev:
device_remove_file(&pdev->dev, dev_attr);
if (ssi_private->ssi_on_imx) {
- clk_disable_unprepare(ssi_private->clk);
+ clk_unprepare(ssi_private->clk);
clk_put(ssi_private->clk);
}
@@ -899,7 +903,7 @@ static int fsl_ssi_remove(struct platform_device *pdev)
platform_device_unregister(ssi_private->pdev);
if (ssi_private->ssi_on_imx) {
imx_pcm_dma_exit(pdev);
- clk_disable_unprepare(ssi_private->clk);
+ clk_unprepare(ssi_private->clk);
clk_put(ssi_private->clk);
}
snd_soc_unregister_component(&pdev->dev);