diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-01-29 10:17:12 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-21 16:37:09 -0400 |
commit | d3725761ee3d4813c6071ea1d952de1094d8b68f (patch) | |
tree | fb34c8d888cfa1761743960632955d9e7415c8ba /sound/soc/codecs | |
parent | 3cf956eebe54cdb7cf1701642085507f0354e56a (diff) |
ASoC: wm8994: Restore AIFnCLK after reducing it for low clock rates
This helps to ensure a smooth startup when we restore.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/wm8994.c | 32 | ||||
-rw-r--r-- | sound/soc/codecs/wm8994.h | 1 |
2 files changed, 33 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 318ea64b9800..1c02a47910e4 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -2268,10 +2268,26 @@ out: | |||
2268 | */ | 2268 | */ |
2269 | if (max(wm8994->aifclk[0], wm8994->aifclk[1]) < 50000) { | 2269 | if (max(wm8994->aifclk[0], wm8994->aifclk[1]) < 50000) { |
2270 | dev_dbg(codec->dev, "Configuring AIFs for 128fs\n"); | 2270 | dev_dbg(codec->dev, "Configuring AIFs for 128fs\n"); |
2271 | |||
2272 | wm8994->aifdiv[0] = snd_soc_read(codec, WM8994_AIF1_RATE) | ||
2273 | & WM8994_AIF1CLK_RATE_MASK; | ||
2274 | wm8994->aifdiv[1] = snd_soc_read(codec, WM8994_AIF2_RATE) | ||
2275 | & WM8994_AIF1CLK_RATE_MASK; | ||
2276 | |||
2271 | snd_soc_update_bits(codec, WM8994_AIF1_RATE, | 2277 | snd_soc_update_bits(codec, WM8994_AIF1_RATE, |
2272 | WM8994_AIF1CLK_RATE_MASK, 0x1); | 2278 | WM8994_AIF1CLK_RATE_MASK, 0x1); |
2273 | snd_soc_update_bits(codec, WM8994_AIF2_RATE, | 2279 | snd_soc_update_bits(codec, WM8994_AIF2_RATE, |
2274 | WM8994_AIF2CLK_RATE_MASK, 0x1); | 2280 | WM8994_AIF2CLK_RATE_MASK, 0x1); |
2281 | } else if (wm8994->aifdiv[0]) { | ||
2282 | snd_soc_update_bits(codec, WM8994_AIF1_RATE, | ||
2283 | WM8994_AIF1CLK_RATE_MASK, | ||
2284 | wm8994->aifdiv[0]); | ||
2285 | snd_soc_update_bits(codec, WM8994_AIF2_RATE, | ||
2286 | WM8994_AIF2CLK_RATE_MASK, | ||
2287 | wm8994->aifdiv[1]); | ||
2288 | |||
2289 | wm8994->aifdiv[0] = 0; | ||
2290 | wm8994->aifdiv[1] = 0; | ||
2275 | } | 2291 | } |
2276 | 2292 | ||
2277 | return 0; | 2293 | return 0; |
@@ -2368,10 +2384,26 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai, | |||
2368 | */ | 2384 | */ |
2369 | if (max(wm8994->aifclk[0], wm8994->aifclk[1]) < 50000) { | 2385 | if (max(wm8994->aifclk[0], wm8994->aifclk[1]) < 50000) { |
2370 | dev_dbg(codec->dev, "Configuring AIFs for 128fs\n"); | 2386 | dev_dbg(codec->dev, "Configuring AIFs for 128fs\n"); |
2387 | |||
2388 | wm8994->aifdiv[0] = snd_soc_read(codec, WM8994_AIF1_RATE) | ||
2389 | & WM8994_AIF1CLK_RATE_MASK; | ||
2390 | wm8994->aifdiv[1] = snd_soc_read(codec, WM8994_AIF2_RATE) | ||
2391 | & WM8994_AIF1CLK_RATE_MASK; | ||
2392 | |||
2371 | snd_soc_update_bits(codec, WM8994_AIF1_RATE, | 2393 | snd_soc_update_bits(codec, WM8994_AIF1_RATE, |
2372 | WM8994_AIF1CLK_RATE_MASK, 0x1); | 2394 | WM8994_AIF1CLK_RATE_MASK, 0x1); |
2373 | snd_soc_update_bits(codec, WM8994_AIF2_RATE, | 2395 | snd_soc_update_bits(codec, WM8994_AIF2_RATE, |
2374 | WM8994_AIF2CLK_RATE_MASK, 0x1); | 2396 | WM8994_AIF2CLK_RATE_MASK, 0x1); |
2397 | } else if (wm8994->aifdiv[0]) { | ||
2398 | snd_soc_update_bits(codec, WM8994_AIF1_RATE, | ||
2399 | WM8994_AIF1CLK_RATE_MASK, | ||
2400 | wm8994->aifdiv[0]); | ||
2401 | snd_soc_update_bits(codec, WM8994_AIF2_RATE, | ||
2402 | WM8994_AIF2CLK_RATE_MASK, | ||
2403 | wm8994->aifdiv[1]); | ||
2404 | |||
2405 | wm8994->aifdiv[0] = 0; | ||
2406 | wm8994->aifdiv[1] = 0; | ||
2375 | } | 2407 | } |
2376 | 2408 | ||
2377 | return 0; | 2409 | return 0; |
diff --git a/sound/soc/codecs/wm8994.h b/sound/soc/codecs/wm8994.h index 45f192702024..928e2c256450 100644 --- a/sound/soc/codecs/wm8994.h +++ b/sound/soc/codecs/wm8994.h | |||
@@ -79,6 +79,7 @@ struct wm8994_priv { | |||
79 | int sysclk_rate[2]; | 79 | int sysclk_rate[2]; |
80 | int mclk[2]; | 80 | int mclk[2]; |
81 | int aifclk[2]; | 81 | int aifclk[2]; |
82 | int aifdiv[2]; | ||
82 | int channels[2]; | 83 | int channels[2]; |
83 | struct wm8994_fll_config fll[2], fll_suspend[2]; | 84 | struct wm8994_fll_config fll[2], fll_suspend[2]; |
84 | struct completion fll_locked[2]; | 85 | struct completion fll_locked[2]; |