summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2014-01-09 17:24:23 +0100
committerSylwester Nawrocki <s.nawrocki@samsung.com>2014-09-10 02:49:42 -0700
commit3fadf6f0f16cf0e1e390439cc07fe72f1341170a (patch)
tree76377805425a56acd6641e437f3d16aee8f3736a
parentf8dd43ef2a761653d5903db5fa7cbe5ad34809b9 (diff)
downloadlinux-3.10-3fadf6f0f16cf0e1e390439cc07fe72f1341170a.tar.gz
linux-3.10-3fadf6f0f16cf0e1e390439cc07fe72f1341170a.tar.bz2
linux-3.10-3fadf6f0f16cf0e1e390439cc07fe72f1341170a.zip
sound: soc/samsung: i2s: Handle bus clock gating
This patch adds handling of controller bus clock gating to make sure that the clock is enabled before starting operation. Change-Id: Ib7069487e3d4477fc6b7d09e411b06bfc3f8f263 Signed-off-by: Tomasz Figa <t.figa@samsung.com>
-rw-r--r--sound/soc/samsung/i2s.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index b144817bcf4..95fab0f26a0 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -78,6 +78,8 @@ struct i2s_dai {
struct clk *dout_bus;
/* i2s clock's divider */
struct clk *dout_i2s;
+ /* Controller's bus clock */
+ struct clk *bus_clk;
/* Clock for generating I2S signals */
struct clk *op_clk;
/* Pointer to the Primary_Fifo if this is Sec_Fifo, NULL otherwise */
@@ -1245,6 +1247,10 @@ static int samsung_i2s_probe(struct platform_device *pdev)
}
}
+ pri_dai->bus_clk = devm_clk_get(&pdev->dev, "iis");
+ if (!IS_ERR(pri_dai->bus_clk))
+ clk_prepare_enable(pri_dai->bus_clk);
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "Unable to get I2S SFR address\n");
@@ -1336,6 +1342,9 @@ static int samsung_i2s_remove(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res)
release_mem_region(res->start, resource_size(res));
+
+ if (!IS_ERR(i2s->bus_clk))
+ clk_disable_unprepare(i2s->bus_clk);
}
i2s->pri_dai = NULL;