From 539a25550164a9a17d27235903f89a65ba2cb7e2 Mon Sep 17 00:00:00 2001 From: Zheng Yang Date: Fri, 24 Aug 2012 15:13:25 +0800 Subject: [PATCH] rk2928:acodec: add pclk_acodec control. --- sound/soc/codecs/rk2928_codec.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/rk2928_codec.c b/sound/soc/codecs/rk2928_codec.c index a31276077b7d..8fe8fedb9f0f 100755 --- a/sound/soc/codecs/rk2928_codec.c +++ b/sound/soc/codecs/rk2928_codec.c @@ -38,7 +38,7 @@ #include #include - +#include #include "rk2928_codec.h" static struct rk2928_codec_data { @@ -46,6 +46,7 @@ static struct rk2928_codec_data { int regbase; int regbase_phy; int regsize_phy; + struct clk *pclk; int mute; int hdmi_enable; int spkctl; @@ -246,6 +247,15 @@ static int rk2928_probe(struct snd_soc_codec *codec) goto err1; } + rk2928_data.pclk = clk_get(NULL,"pclk_acodec"); + if(IS_ERR(rk2928_data.pclk)) + { + dev_err(rk2928_data.dev, "Unable to get acodec hclk\n"); + ret = -ENXIO; + goto err1; + } + clk_enable(rk2928_data.pclk); + res = platform_get_resource(pdev, IORESOURCE_IO, 0); if(!res) { rk2928_data.spkctl = INVALID_GPIO; @@ -293,12 +303,14 @@ static int rk2928_suspend(struct snd_soc_codec *codec, pm_message_t state) { DBG("%s", __FUNCTION__); rk2928_set_bias_level(codec, SND_SOC_BIAS_OFF); + clk_disable(rk2928_data.pclk); return 0; } static int rk2928_resume(struct snd_soc_codec *codec) { DBG("%s", __FUNCTION__); + clk_enable(rk2928_data.pclk); rk2928_write(codec, CODEC_REG_POWER, v_PD_ADC(1) | v_PD_DAC(1) | v_PD_MIC_BIAS(1)); return 0; } -- 2.34.1