diff options
author | Tomasz Figa <t.figa@samsung.com> | 2014-01-09 17:24:23 +0100 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 12:00:43 +0900 |
commit | 71e6550dbdff8573843b8fd4d3427436948ec4eb (patch) | |
tree | e7c7f495e46201e9c4c806d81b3ac4f60e238429 /sound | |
parent | 8e8a23c37c1aaedd387318aa30dd41859439c6fd (diff) | |
download | linux-3.10-71e6550dbdff8573843b8fd4d3427436948ec4eb.tar.gz linux-3.10-71e6550dbdff8573843b8fd4d3427436948ec4eb.tar.bz2 linux-3.10-71e6550dbdff8573843b8fd4d3427436948ec4eb.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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/samsung/i2s.c | 9 |
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; |