summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8983.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-02-11 14:03:37 +0100
committerTakashi Iwai <tiwai@suse.de>2013-02-11 14:03:37 +0100
commit83048ea7b1d11f5e560dea53873fb51d860202eb (patch)
tree5cc41aa9c2999188d3148e8828d44c4724115f5e /sound/soc/codecs/wm8983.c
parente9a25e04b845aade311aaa268a696c5c4ff3eece (diff)
parent699ba4546cfe3f4eee73aff4f307bf16362f9232 (diff)
Merge tag 'asoc-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Updates for v3.9 A fairly quiet release for ASoC: - Support for a wider range of hardware in the compressed stream code. - The ability to mute capture streams as well as playback streams while inactive. - DT support for AK4642, FSI, Samsung I2S and WM8962. - AC'97 support for Tegra. - New driver for max98090, replacing the stub which was there. Due to dependencies we've also got support for asynchronous I/O in regmap and DTification of DMA support for Samsung platforms (used only by the I2S driver and SPI) merged here as well.
Diffstat (limited to 'sound/soc/codecs/wm8983.c')
-rw-r--r--sound/soc/codecs/wm8983.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/sound/soc/codecs/wm8983.c b/sound/soc/codecs/wm8983.c
index 9fe1e041da49..c9c707b8698f 100644
--- a/sound/soc/codecs/wm8983.c
+++ b/sound/soc/codecs/wm8983.c
@@ -851,30 +851,33 @@ static int wm8983_set_pll(struct snd_soc_dai *dai, int pll_id,
struct pll_div pll_div;
codec = dai->codec;
- if (freq_in && freq_out) {
+ if (!freq_in || !freq_out) {
+ /* disable the PLL */
+ snd_soc_update_bits(codec, WM8983_POWER_MANAGEMENT_1,
+ WM8983_PLLEN_MASK, 0);
+ return 0;
+ } else {
ret = pll_factors(&pll_div, freq_out * 4 * 2, freq_in);
if (ret)
return ret;
- }
-
- /* disable the PLL before re-programming it */
- snd_soc_update_bits(codec, WM8983_POWER_MANAGEMENT_1,
- WM8983_PLLEN_MASK, 0);
- if (!freq_in || !freq_out)
- return 0;
+ /* disable the PLL before re-programming it */
+ snd_soc_update_bits(codec, WM8983_POWER_MANAGEMENT_1,
+ WM8983_PLLEN_MASK, 0);
+
+ /* set PLLN and PRESCALE */
+ snd_soc_write(codec, WM8983_PLL_N,
+ (pll_div.div2 << WM8983_PLL_PRESCALE_SHIFT)
+ | pll_div.n);
+ /* set PLLK */
+ snd_soc_write(codec, WM8983_PLL_K_3, pll_div.k & 0x1ff);
+ snd_soc_write(codec, WM8983_PLL_K_2, (pll_div.k >> 9) & 0x1ff);
+ snd_soc_write(codec, WM8983_PLL_K_1, (pll_div.k >> 18));
+ /* enable the PLL */
+ snd_soc_update_bits(codec, WM8983_POWER_MANAGEMENT_1,
+ WM8983_PLLEN_MASK, WM8983_PLLEN);
+ }
- /* set PLLN and PRESCALE */
- snd_soc_write(codec, WM8983_PLL_N,
- (pll_div.div2 << WM8983_PLL_PRESCALE_SHIFT)
- | pll_div.n);
- /* set PLLK */
- snd_soc_write(codec, WM8983_PLL_K_3, pll_div.k & 0x1ff);
- snd_soc_write(codec, WM8983_PLL_K_2, (pll_div.k >> 9) & 0x1ff);
- snd_soc_write(codec, WM8983_PLL_K_1, (pll_div.k >> 18));
- /* enable the PLL */
- snd_soc_update_bits(codec, WM8983_POWER_MANAGEMENT_1,
- WM8983_PLLEN_MASK, WM8983_PLLEN);
return 0;
}