summaryrefslogtreecommitdiff
path: root/sound/soc/kirkwood
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2012-03-09 09:56:41 +0100
committerMike Turquette <mturquette@linaro.org>2012-05-08 16:34:03 -0700
commite919c71665d2386eec6dc2ecd58d01bae69fc0fd (patch)
treee48c032ee0b94b470e91f097a6a0ba7f0959511b /sound/soc/kirkwood
parent27e53cfbce493bb062212263aa24bbbc5a1077f4 (diff)
downloadlinux-3.10-e919c71665d2386eec6dc2ecd58d01bae69fc0fd.tar.gz
linux-3.10-e919c71665d2386eec6dc2ecd58d01bae69fc0fd.tar.bz2
linux-3.10-e919c71665d2386eec6dc2ecd58d01bae69fc0fd.zip
ARM: Orion: Audio: Add clk/clkdev support
Signed-off-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Jamie Lentin <jm@lentin.co.uk> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'sound/soc/kirkwood')
-rw-r--r--sound/soc/kirkwood/kirkwood-i2s.c13
-rw-r--r--sound/soc/kirkwood/kirkwood.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index 3cb9aa4299d..fa455675045 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -17,6 +17,7 @@
#include <linux/slab.h>
#include <linux/mbus.h>
#include <linux/delay.h>
+#include <linux/clk.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
@@ -449,6 +450,14 @@ static __devinit int kirkwood_i2s_dev_probe(struct platform_device *pdev)
priv->burst = data->burst;
+ priv->clk = clk_get(&pdev->dev, NULL);
+ if (IS_ERR(priv->clk)) {
+ dev_err(&pdev->dev, "no clock\n");
+ err = PTR_ERR(priv->clk);
+ goto err_ioremap;
+ }
+ clk_prepare_enable(priv->clk);
+
return snd_soc_register_dai(&pdev->dev, &kirkwood_i2s_dai);
err_ioremap:
@@ -466,6 +475,10 @@ static __devexit int kirkwood_i2s_dev_remove(struct platform_device *pdev)
struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev);
snd_soc_unregister_dai(&pdev->dev);
+
+ clk_disable_unprepare(priv->clk);
+ clk_put(priv->clk);
+
iounmap(priv->io);
release_mem_region(priv->mem->start, SZ_16K);
kfree(priv);
diff --git a/sound/soc/kirkwood/kirkwood.h b/sound/soc/kirkwood/kirkwood.h
index 9047436b393..f9084d83e6b 100644
--- a/sound/soc/kirkwood/kirkwood.h
+++ b/sound/soc/kirkwood/kirkwood.h
@@ -123,6 +123,7 @@ struct kirkwood_dma_data {
void __iomem *io;
int irq;
int burst;
+ struct clk *clk;
};
#endif