Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170190
b: refs/heads/master
c: 2845fa1
h: refs/heads/master
v: v3
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed Oct 28, 2009
1 parent 13d23a9 commit e6294bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 78e08e2f209e5e7777e81919d32cfcddad126cfa
refs/heads/master: 2845fa13e5cbe708ece7fafe29c91f32c66e4f59
20 changes: 10 additions & 10 deletions trunk/sound/soc/codecs/twl4030.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct twl4030_priv {
struct snd_soc_codec codec;

unsigned int codec_powered;
unsigned int codec_muted;
unsigned int apll_enabled;

struct snd_pcm_substream *master_substream;
struct snd_pcm_substream *slave_substream;
Expand Down Expand Up @@ -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;
int status;

if (mute == twl4030->codec_muted)
if (enable == twl4030->apll_enabled)
return;

if (mute)
/* Disable PLL */
status = twl4030_codec_disable_resource(TWL4030_CODEC_RES_APLL);
else
if (enable)
/* Enable PLL */
status = twl4030_codec_enable_resource(TWL4030_CODEC_RES_APLL);
else
/* Disable PLL */
status = twl4030_codec_disable_resource(TWL4030_CODEC_RES_APLL);

if (status >= 0)
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)
Expand Down Expand Up @@ -1464,14 +1464,14 @@ static int twl4030_set_bias_level(struct snd_soc_codec *codec,
{
switch (level) {
case SND_SOC_BIAS_ON:
twl4030_codec_mute(codec, 0);
twl4030_apll_enable(codec, 1);
break;
case SND_SOC_BIAS_PREPARE:
break;
case SND_SOC_BIAS_STANDBY:
if (codec->bias_level == SND_SOC_BIAS_OFF)
twl4030_power_up(codec);
twl4030_codec_mute(codec, 1);
twl4030_apll_enable(codec, 0);
break;
case SND_SOC_BIAS_OFF:
twl4030_power_down(codec);
Expand Down

0 comments on commit e6294bb

Please sign in to comment.