Commit 2845fa13 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown

ASoC: TWL4030: Change codec_muted to apll_enabled

codec_muted is missleading, change it to apll_enabled,
which is what it is doing: enabing and disabling the APLL.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 78e08e2f
...@@ -123,7 +123,7 @@ struct twl4030_priv { ...@@ -123,7 +123,7 @@ struct twl4030_priv {
struct snd_soc_codec codec; struct snd_soc_codec codec;
unsigned int codec_powered; unsigned int codec_powered;
unsigned int codec_muted; unsigned int apll_enabled;
struct snd_pcm_substream *master_substream; struct snd_pcm_substream *master_substream;
struct snd_pcm_substream *slave_substream; struct snd_pcm_substream *slave_substream;
...@@ -218,25 +218,25 @@ static void twl4030_init_chip(struct snd_soc_codec *codec) ...@@ -218,25 +218,25 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)
} }
static void twl4030_codec_mute(struct snd_soc_codec *codec, int mute) static void twl4030_apll_enable(struct snd_soc_codec *codec, int enable)
{ {
struct twl4030_priv *twl4030 = codec->private_data; struct twl4030_priv *twl4030 = codec->private_data;
int status; int status;
if (mute == twl4030->codec_muted) if (enable == twl4030->apll_enabled)
return; return;
if (mute) if (enable)
/* Disable PLL */
status = twl4030_codec_disable_resource(TWL4030_CODEC_RES_APLL);
else
/* Enable PLL */ /* Enable PLL */
status = twl4030_codec_enable_resource(TWL4030_CODEC_RES_APLL); status = twl4030_codec_enable_resource(TWL4030_CODEC_RES_APLL);
else
/* Disable PLL */
status = twl4030_codec_disable_resource(TWL4030_CODEC_RES_APLL);
if (status >= 0) if (status >= 0)
twl4030_write_reg_cache(codec, TWL4030_REG_APLL_CTL, status); twl4030_write_reg_cache(codec, TWL4030_REG_APLL_CTL, status);
twl4030->codec_muted = mute; twl4030->apll_enabled = enable;
} }
static void twl4030_power_up(struct snd_soc_codec *codec) static void twl4030_power_up(struct snd_soc_codec *codec)
...@@ -1464,14 +1464,14 @@ static int twl4030_set_bias_level(struct snd_soc_codec *codec, ...@@ -1464,14 +1464,14 @@ static int twl4030_set_bias_level(struct snd_soc_codec *codec,
{ {
switch (level) { switch (level) {
case SND_SOC_BIAS_ON: case SND_SOC_BIAS_ON:
twl4030_codec_mute(codec, 0); twl4030_apll_enable(codec, 1);
break; break;
case SND_SOC_BIAS_PREPARE: case SND_SOC_BIAS_PREPARE:
break; break;
case SND_SOC_BIAS_STANDBY: case SND_SOC_BIAS_STANDBY:
if (codec->bias_level == SND_SOC_BIAS_OFF) if (codec->bias_level == SND_SOC_BIAS_OFF)
twl4030_power_up(codec); twl4030_power_up(codec);
twl4030_codec_mute(codec, 1); twl4030_apll_enable(codec, 0);
break; break;
case SND_SOC_BIAS_OFF: case SND_SOC_BIAS_OFF:
twl4030_power_down(codec); twl4030_power_down(codec);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment