Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305564
b: refs/heads/master
c: 95cd98f
h: refs/heads/master
v: v3
  • Loading branch information
Shawn Guo authored and Mark Brown committed Apr 1, 2012
1 parent b54c635 commit ea35a41
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 01651babb66fb7b51719ff3389a7bfc3ad25fe13
refs/heads/master: 95cd98f9a6dcf112d2abf724ac07c56ec745180f
24 changes: 22 additions & 2 deletions trunk/sound/soc/fsl/fsl_ssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/io.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/delay.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -119,6 +120,7 @@ struct fsl_ssi_private {

bool new_binding;
bool ssi_on_imx;
struct clk *clk;
struct platform_device *imx_pcm_pdev;
struct imx_pcm_dma_params dma_params_tx;
struct imx_pcm_dma_params dma_params_rx;
Expand Down Expand Up @@ -722,6 +724,15 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev)
if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx21-ssi")) {
u32 dma_events[2];
ssi_private->ssi_on_imx = true;

ssi_private->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(ssi_private->clk)) {
ret = PTR_ERR(ssi_private->clk);
dev_err(&pdev->dev, "could not get clock: %d\n", ret);
goto error_irq;
}
clk_prepare_enable(ssi_private->clk);

/*
* We have burstsize be "fifo_depth - 2" to match the SSI
* watermark setting in fsl_ssi_startup().
Expand All @@ -742,7 +753,7 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev)
"fsl,ssi-dma-events", dma_events, 2);
if (ret) {
dev_err(&pdev->dev, "could not get dma events\n");
goto error_irq;
goto error_clk;
}
ssi_private->dma_params_tx.dma = dma_events[0];
ssi_private->dma_params_rx.dma = dma_events[1];
Expand Down Expand Up @@ -830,6 +841,12 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, NULL);
device_remove_file(&pdev->dev, dev_attr);

error_clk:
if (ssi_private->ssi_on_imx) {
clk_disable_unprepare(ssi_private->clk);
clk_put(ssi_private->clk);
}

error_irq:
free_irq(ssi_private->irq, ssi_private);

Expand All @@ -851,8 +868,11 @@ static int fsl_ssi_remove(struct platform_device *pdev)

if (!ssi_private->new_binding)
platform_device_unregister(ssi_private->pdev);
if (ssi_private->ssi_on_imx)
if (ssi_private->ssi_on_imx) {
platform_device_unregister(ssi_private->imx_pcm_pdev);
clk_disable_unprepare(ssi_private->clk);
clk_put(ssi_private->clk);
}
snd_soc_unregister_dai(&pdev->dev);
device_remove_file(&pdev->dev, &ssi_private->dev_attr);

Expand Down

0 comments on commit ea35a41

Please sign in to comment.