From: Mark Brown Date: Wed, 30 Sep 2009 14:48:38 +0000 (+0100) Subject: Merge branch 'upstream/wm8974' into for-2.6.33 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=4c0bccbe66ffe34f7bc88d29c345f9a7888656eb;p=openwrt%2Fstaging%2Fblogic.git Merge branch 'upstream/wm8974' into for-2.6.33 --- 4c0bccbe66ffe34f7bc88d29c345f9a7888656eb diff --cc sound/soc/codecs/wm8974.c index 93d66e30f109,f30f86b3bda0..eff29331235b --- a/sound/soc/codecs/wm8974.c +++ b/sound/soc/codecs/wm8974.c @@@ -325,13 -376,14 +327,14 @@@ static void pll_factors(struct pll_ *pl /* Move down to proper range now rounding is done */ K /= 10; - pll_div.k = K; + pll_div->k = K; } -static int wm8974_set_dai_pll(struct snd_soc_dai *codec_dai, - int pll_id, unsigned int freq_in, unsigned int freq_out) +static int wm8974_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, + int source, unsigned int freq_in, unsigned int freq_out) { struct snd_soc_codec *codec = codec_dai->codec; + struct pll_ pll_div; u16 reg; if (freq_in == 0 || freq_out == 0) { @@@ -345,18 -397,18 +348,18 @@@ return 0; } - pll_factors(freq_out*4, freq_in); + pll_factors(&pll_div, freq_out, freq_in); - wm8974_write(codec, WM8974_PLLN, (pll_div.pre_div << 4) | pll_div.n); - wm8974_write(codec, WM8974_PLLK1, pll_div.k >> 18); - wm8974_write(codec, WM8974_PLLK2, (pll_div.k >> 9) & 0x1ff); - wm8974_write(codec, WM8974_PLLK3, pll_div.k & 0x1ff); - reg = wm8974_read_reg_cache(codec, WM8974_POWER1); - wm8974_write(codec, WM8974_POWER1, reg | 0x020); + snd_soc_write(codec, WM8974_PLLN, (pll_div.pre_div << 4) | pll_div.n); + snd_soc_write(codec, WM8974_PLLK1, pll_div.k >> 18); + snd_soc_write(codec, WM8974_PLLK2, (pll_div.k >> 9) & 0x1ff); + snd_soc_write(codec, WM8974_PLLK3, pll_div.k & 0x1ff); + reg = snd_soc_read(codec, WM8974_POWER1); + snd_soc_write(codec, WM8974_POWER1, reg | 0x020); /* Run CODEC from PLL instead of MCLK */ - reg = wm8974_read_reg_cache(codec, WM8974_CLOCK); - wm8974_write(codec, WM8974_CLOCK, reg | 0x100); + reg = snd_soc_read(codec, WM8974_CLOCK); + snd_soc_write(codec, WM8974_CLOCK, reg | 0x100); return 0; }