aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/codecs/wm8994.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index c749ef339665..377ae646e20c 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -2299,6 +2299,33 @@ static int wm8994_aif3_hw_params(struct snd_pcm_substream *substream,
2299 return snd_soc_update_bits(codec, aif1_reg, WM8994_AIF1_WL_MASK, aif1); 2299 return snd_soc_update_bits(codec, aif1_reg, WM8994_AIF1_WL_MASK, aif1);
2300} 2300}
2301 2301
2302static void wm8994_aif_shutdown(struct snd_pcm_substream *substream,
2303 struct snd_soc_dai *dai)
2304{
2305 struct snd_soc_codec *codec = dai->codec;
2306 int rate_reg = 0;
2307
2308 switch (dai->id) {
2309 case 1:
2310 rate_reg = WM8994_AIF1_RATE;
2311 break;
2312 case 2:
2313 rate_reg = WM8994_AIF1_RATE;
2314 break;
2315 default:
2316 break;
2317 }
2318
2319 /* If the DAI is idle then configure the divider tree for the
2320 * lowest output rate to save a little power if the clock is
2321 * still active (eg, because it is system clock).
2322 */
2323 if (rate_reg && !dai->playback_active && !dai->capture_active)
2324 snd_soc_update_bits(codec, rate_reg,
2325 WM8994_AIF1_SR_MASK |
2326 WM8994_AIF1CLK_RATE_MASK, 0x9);
2327}
2328
2302static int wm8994_aif_mute(struct snd_soc_dai *codec_dai, int mute) 2329static int wm8994_aif_mute(struct snd_soc_dai *codec_dai, int mute)
2303{ 2330{
2304 struct snd_soc_codec *codec = codec_dai->codec; 2331 struct snd_soc_codec *codec = codec_dai->codec;
@@ -2365,6 +2392,7 @@ static struct snd_soc_dai_ops wm8994_aif1_dai_ops = {
2365 .set_sysclk = wm8994_set_dai_sysclk, 2392 .set_sysclk = wm8994_set_dai_sysclk,
2366 .set_fmt = wm8994_set_dai_fmt, 2393 .set_fmt = wm8994_set_dai_fmt,
2367 .hw_params = wm8994_hw_params, 2394 .hw_params = wm8994_hw_params,
2395 .shutdown = wm8994_aif_shutdown,
2368 .digital_mute = wm8994_aif_mute, 2396 .digital_mute = wm8994_aif_mute,
2369 .set_pll = wm8994_set_fll, 2397 .set_pll = wm8994_set_fll,
2370 .set_tristate = wm8994_set_tristate, 2398 .set_tristate = wm8994_set_tristate,
@@ -2374,6 +2402,7 @@ static struct snd_soc_dai_ops wm8994_aif2_dai_ops = {
2374 .set_sysclk = wm8994_set_dai_sysclk, 2402 .set_sysclk = wm8994_set_dai_sysclk,
2375 .set_fmt = wm8994_set_dai_fmt, 2403 .set_fmt = wm8994_set_dai_fmt,
2376 .hw_params = wm8994_hw_params, 2404 .hw_params = wm8994_hw_params,
2405 .shutdown = wm8994_aif_shutdown,
2377 .digital_mute = wm8994_aif_mute, 2406 .digital_mute = wm8994_aif_mute,
2378 .set_pll = wm8994_set_fll, 2407 .set_pll = wm8994_set_fll,
2379 .set_tristate = wm8994_set_tristate, 2408 .set_tristate = wm8994_set_tristate,