diff options
author | huisung.kang <hs1218.kang@samsung.com> | 2010-10-10 14:23:59 -0700 |
---|---|---|
committer | Arve Hjønnevåg <arve@android.com> | 2011-11-17 17:49:29 -0800 |
commit | ff2ebb45ccc5b0a9c9e4c06fcbc4ec8aba736a64 (patch) | |
tree | 01ec113ee9762468fa63be03f48b1fb2752bd41e | |
parent | 93f3433c13c5a4a17ad8d7b681ce3bf88c1239ab (diff) | |
download | kernel_samsung_crespo-ff2ebb45ccc5b0a9c9e4c06fcbc4ec8aba736a64.zip kernel_samsung_crespo-ff2ebb45ccc5b0a9c9e4c06fcbc4ec8aba736a64.tar.gz kernel_samsung_crespo-ff2ebb45ccc5b0a9c9e4c06fcbc4ec8aba736a64.tar.bz2 |
S5PC11X: SOUND: Add control code of audio power domain gating.
Change-Id: I7d9136c5141c0540440fb88fcef60dcdbb1071c5
Signed-off-by: huisung.kang <hs1218.kang@samsung.com>
-rw-r--r-- | sound/soc/samsung/s3c-i2s-v2.h | 1 | ||||
-rw-r--r-- | sound/soc/samsung/s5pc1xx-i2s.c | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sound/soc/samsung/s3c-i2s-v2.h b/sound/soc/samsung/s3c-i2s-v2.h index 67c595e..f77e0ad 100644 --- a/sound/soc/samsung/s3c-i2s-v2.h +++ b/sound/soc/samsung/s3c-i2s-v2.h @@ -48,6 +48,7 @@ struct s3c_i2sv2_info { struct clk *iis_cclk; struct clk *iis_clk; struct clk *iis_busclk; + struct regulator *regulator; unsigned char master; diff --git a/sound/soc/samsung/s5pc1xx-i2s.c b/sound/soc/samsung/s5pc1xx-i2s.c index aaad05a..ca738d9 100644 --- a/sound/soc/samsung/s5pc1xx-i2s.c +++ b/sound/soc/samsung/s5pc1xx-i2s.c @@ -18,6 +18,7 @@ #include <linux/device.h> #include <linux/clk.h> #include <linux/io.h> +#include <linux/regulator/consumer.h> #include <sound/soc.h> @@ -99,6 +100,9 @@ void s5p_i2s_set_clk_enabled(struct snd_soc_dai *dai, bool state) pr_debug("..entering %s\n", __func__); if (state) { + if (audio_clk_gated == 1) + regulator_enable(i2s->regulator); + if (dai->id == 0) { /* I2S V5.1? */ clk_enable(i2s->iis_ipclk); clk_enable(i2s->iis_clk); @@ -112,6 +116,9 @@ void s5p_i2s_set_clk_enabled(struct snd_soc_dai *dai, bool state) clk_disable(i2s->iis_ipclk); } + if (audio_clk_gated == 0) + regulator_disable(i2s->regulator); + audio_clk_gated = 1; } } @@ -668,6 +675,17 @@ static __devinit int s3c64xx_iis_dev_probe(struct platform_device *pdev) return -EINVAL; } + /* Get i2s power domain regulator */ + i2s->regulator = regulator_get(&pdev->dev, "pd"); + if (IS_ERR(i2s->regulator)) { + dev_err(&pdev->dev, "%s: failed to get resource %s\n", + __func__, "i2s"); + return PTR_ERR(i2s->regulator); + } + + /* Enable Power domain */ + regulator_enable(i2s->regulator); + /* Audio Clock * fout_epll >> mout_epll >> sclk_audio * fout_epll >> mout_audss >> audio-bus(iis_clk) |