diff options
author | Nicolin Chen <b42378@freescale.com> | 2013-08-05 03:07:21 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:01:00 -0400 |
commit | 2e691b22d8096cc24380ee0f49779d8ab6d951c8 (patch) | |
tree | dd132bccb1289643255a29179ec72d92abb85fa4 /sound/soc | |
parent | 4f900cb1310ecb5647118cbf939d228bad2a6386 (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>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 10 |
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, | |||
330 | snd_soc_dai_get_drvdata(rtd->cpu_dai); | 330 | snd_soc_dai_get_drvdata(rtd->cpu_dai); |
331 | int synchronous = ssi_private->cpu_dai_drv.symmetric_rates; | 331 | int synchronous = ssi_private->cpu_dai_drv.symmetric_rates; |
332 | 332 | ||
333 | clk_enable(ssi_private->clk); | ||
334 | |||
333 | /* | 335 | /* |
334 | * If this is the first stream opened, then request the IRQ | 336 | * If this is the first stream opened, then request the IRQ |
335 | * and initialize the SSI registers. | 337 | * and initialize the SSI registers. |
@@ -573,6 +575,8 @@ static void fsl_ssi_shutdown(struct snd_pcm_substream *substream, | |||
573 | 575 | ||
574 | ssi_private->second_stream = NULL; | 576 | ssi_private->second_stream = NULL; |
575 | 577 | ||
578 | clk_disable(ssi_private->clk); | ||
579 | |||
576 | /* If this is the last active substream, disable the interrupts. */ | 580 | /* If this is the last active substream, disable the interrupts. */ |
577 | if (!ssi_private->first_stream) { | 581 | if (!ssi_private->first_stream) { |
578 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; | 582 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; |
@@ -779,7 +783,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
779 | dev_err(&pdev->dev, "could not get clock: %d\n", ret); | 783 | dev_err(&pdev->dev, "could not get clock: %d\n", ret); |
780 | goto error_irq; | 784 | goto error_irq; |
781 | } | 785 | } |
782 | clk_prepare_enable(ssi_private->clk); | 786 | clk_prepare(ssi_private->clk); |
783 | 787 | ||
784 | /* | 788 | /* |
785 | * We have burstsize be "fifo_depth - 2" to match the SSI | 789 | * We have burstsize be "fifo_depth - 2" to match the SSI |
@@ -872,7 +876,7 @@ error_dev: | |||
872 | device_remove_file(&pdev->dev, dev_attr); | 876 | device_remove_file(&pdev->dev, dev_attr); |
873 | 877 | ||
874 | if (ssi_private->ssi_on_imx) { | 878 | if (ssi_private->ssi_on_imx) { |
875 | clk_disable_unprepare(ssi_private->clk); | 879 | clk_unprepare(ssi_private->clk); |
876 | clk_put(ssi_private->clk); | 880 | clk_put(ssi_private->clk); |
877 | } | 881 | } |
878 | 882 | ||
@@ -899,7 +903,7 @@ static int fsl_ssi_remove(struct platform_device *pdev) | |||
899 | platform_device_unregister(ssi_private->pdev); | 903 | platform_device_unregister(ssi_private->pdev); |
900 | if (ssi_private->ssi_on_imx) { | 904 | if (ssi_private->ssi_on_imx) { |
901 | imx_pcm_dma_exit(pdev); | 905 | imx_pcm_dma_exit(pdev); |
902 | clk_disable_unprepare(ssi_private->clk); | 906 | clk_unprepare(ssi_private->clk); |
903 | clk_put(ssi_private->clk); | 907 | clk_put(ssi_private->clk); |
904 | } | 908 | } |
905 | snd_soc_unregister_component(&pdev->dev); | 909 | snd_soc_unregister_component(&pdev->dev); |