diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-07-10 12:03:46 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-07-10 12:17:35 -0400 |
commit | 2b4d39fc2a80e271ac8d44fccd02277a4b63c557 (patch) | |
tree | 9d4638752ae0466653fdec8015bde4128180b2cd /sound | |
parent | a1f34af0ec35e3131d65e0ae4cec6b048cba3e88 (diff) |
ASoC: arizona: Support variable FLL VCO multipliers
Some Arizona chips have a higher frequency for the FLL VCO, support this
in the common code.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/arizona.c | 6 | ||||
-rw-r--r-- | sound/soc/codecs/arizona.h | 1 | ||||
-rw-r--r-- | sound/soc/codecs/wm5102.c | 3 |
3 files changed, 7 insertions, 3 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index f3680c374347..5c9cacaf2d52 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c | |||
@@ -734,9 +734,9 @@ static int arizona_calc_fll(struct arizona_fll *fll, | |||
734 | /* Apply the division for our remaining calculations */ | 734 | /* Apply the division for our remaining calculations */ |
735 | Fref /= div; | 735 | Fref /= div; |
736 | 736 | ||
737 | /* Fvco should be 90-100MHz; don't check the upper bound */ | 737 | /* Fvco should be over the targt; don't check the upper bound */ |
738 | div = 1; | 738 | div = 1; |
739 | while (Fout * div < 90000000) { | 739 | while (Fout * div < 90000000 * fll->vco_mult) { |
740 | div++; | 740 | div++; |
741 | if (div > 7) { | 741 | if (div > 7) { |
742 | arizona_fll_err(fll, "No FLL_OUTDIV for Fout=%uHz\n", | 742 | arizona_fll_err(fll, "No FLL_OUTDIV for Fout=%uHz\n", |
@@ -744,7 +744,7 @@ static int arizona_calc_fll(struct arizona_fll *fll, | |||
744 | return -EINVAL; | 744 | return -EINVAL; |
745 | } | 745 | } |
746 | } | 746 | } |
747 | target = Fout * div; | 747 | target = Fout * div / fll->vco_mult; |
748 | cfg->outdiv = div; | 748 | cfg->outdiv = div; |
749 | 749 | ||
750 | arizona_fll_dbg(fll, "Fvco=%dHz\n", target); | 750 | arizona_fll_dbg(fll, "Fvco=%dHz\n", target); |
diff --git a/sound/soc/codecs/arizona.h b/sound/soc/codecs/arizona.h index b894b64e8f5c..59caca8865e8 100644 --- a/sound/soc/codecs/arizona.h +++ b/sound/soc/codecs/arizona.h | |||
@@ -141,6 +141,7 @@ struct arizona_fll { | |||
141 | struct arizona *arizona; | 141 | struct arizona *arizona; |
142 | int id; | 142 | int id; |
143 | unsigned int base; | 143 | unsigned int base; |
144 | unsigned int vco_mult; | ||
144 | struct completion lock; | 145 | struct completion lock; |
145 | struct completion ok; | 146 | struct completion ok; |
146 | 147 | ||
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c index 7a6a11a323ff..6537f16d383e 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c | |||
@@ -853,6 +853,9 @@ static int __devinit wm5102_probe(struct platform_device *pdev) | |||
853 | 853 | ||
854 | wm5102->core.arizona = arizona; | 854 | wm5102->core.arizona = arizona; |
855 | 855 | ||
856 | for (i = 0; i < ARRAY_SIZE(wm5102->fll); i++) | ||
857 | wm5102->fll[i].vco_mult = 1; | ||
858 | |||
856 | arizona_init_fll(arizona, 1, ARIZONA_FLL1_CONTROL_1 - 1, | 859 | arizona_init_fll(arizona, 1, ARIZONA_FLL1_CONTROL_1 - 1, |
857 | ARIZONA_IRQ_FLL1_LOCK, ARIZONA_IRQ_FLL1_CLOCK_OK, | 860 | ARIZONA_IRQ_FLL1_LOCK, ARIZONA_IRQ_FLL1_CLOCK_OK, |
858 | &wm5102->fll[0]); | 861 | &wm5102->fll[0]); |