Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257604
b: refs/heads/master
c: 7d02173
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown committed Jul 17, 2011
1 parent df8e160 commit c00b692
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ca1004bab9c6829e64036f7da5e25a698756ee28
refs/heads/master: 7d02173cd17a1ac3db04aa9b9e5de153f2d02dd5
29 changes: 29 additions & 0 deletions trunk/sound/soc/codecs/wm8994.c
Original file line number Diff line number Diff line change
Expand Up @@ -2299,6 +2299,33 @@ static int wm8994_aif3_hw_params(struct snd_pcm_substream *substream,
return snd_soc_update_bits(codec, aif1_reg, WM8994_AIF1_WL_MASK, aif1);
}

static void wm8994_aif_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct snd_soc_codec *codec = dai->codec;
int rate_reg = 0;

switch (dai->id) {
case 1:
rate_reg = WM8994_AIF1_RATE;
break;
case 2:
rate_reg = WM8994_AIF1_RATE;
break;
default:
break;
}

/* If the DAI is idle then configure the divider tree for the
* lowest output rate to save a little power if the clock is
* still active (eg, because it is system clock).
*/
if (rate_reg && !dai->playback_active && !dai->capture_active)
snd_soc_update_bits(codec, rate_reg,
WM8994_AIF1_SR_MASK |
WM8994_AIF1CLK_RATE_MASK, 0x9);
}

static int wm8994_aif_mute(struct snd_soc_dai *codec_dai, int mute)
{
struct snd_soc_codec *codec = codec_dai->codec;
Expand Down Expand Up @@ -2365,6 +2392,7 @@ static struct snd_soc_dai_ops wm8994_aif1_dai_ops = {
.set_sysclk = wm8994_set_dai_sysclk,
.set_fmt = wm8994_set_dai_fmt,
.hw_params = wm8994_hw_params,
.shutdown = wm8994_aif_shutdown,
.digital_mute = wm8994_aif_mute,
.set_pll = wm8994_set_fll,
.set_tristate = wm8994_set_tristate,
Expand All @@ -2374,6 +2402,7 @@ static struct snd_soc_dai_ops wm8994_aif2_dai_ops = {
.set_sysclk = wm8994_set_dai_sysclk,
.set_fmt = wm8994_set_dai_fmt,
.hw_params = wm8994_hw_params,
.shutdown = wm8994_aif_shutdown,
.digital_mute = wm8994_aif_mute,
.set_pll = wm8994_set_fll,
.set_tristate = wm8994_set_tristate,
Expand Down

0 comments on commit c00b692

Please sign in to comment.