diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2014-03-07 11:34:21 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-09 04:28:06 -0400 |
commit | 8ccefcd265b486186c94ea70c77511e7c570347d (patch) | |
tree | 2b8598a4cec44acea677b4a506f09e0024d1bbf2 | |
parent | 23f785a8bc33a98c4c384a653b9bff9c0cc3591d (diff) |
ASoC: arizona: Don't pass Fout into arizona_calc_fll
As we now calculate the FLL configuration at a later stage in the
process the fout member of the FLL structure will contain the desired
Fout frequency so no need to pass this in seperately.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/codecs/arizona.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index 7398c69192cb..7b1354ae337b 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c | |||
@@ -1408,13 +1408,12 @@ static int arizona_validate_fll(struct arizona_fll *fll, | |||
1408 | 1408 | ||
1409 | static int arizona_calc_fll(struct arizona_fll *fll, | 1409 | static int arizona_calc_fll(struct arizona_fll *fll, |
1410 | struct arizona_fll_cfg *cfg, | 1410 | struct arizona_fll_cfg *cfg, |
1411 | unsigned int Fref, | 1411 | unsigned int Fref) |
1412 | unsigned int Fout) | ||
1413 | { | 1412 | { |
1414 | unsigned int target, div, gcd_fll; | 1413 | unsigned int target, div, gcd_fll; |
1415 | int i, ratio; | 1414 | int i, ratio; |
1416 | 1415 | ||
1417 | arizona_fll_dbg(fll, "Fref=%u Fout=%u\n", Fref, Fout); | 1416 | arizona_fll_dbg(fll, "Fref=%u Fout=%u\n", Fref, fll->fout); |
1418 | 1417 | ||
1419 | /* Fref must be <=13.5MHz */ | 1418 | /* Fref must be <=13.5MHz */ |
1420 | div = 1; | 1419 | div = 1; |
@@ -1432,12 +1431,12 @@ static int arizona_calc_fll(struct arizona_fll *fll, | |||
1432 | 1431 | ||
1433 | /* Fvco should be over the targt; don't check the upper bound */ | 1432 | /* Fvco should be over the targt; don't check the upper bound */ |
1434 | div = ARIZONA_FLL_MIN_OUTDIV; | 1433 | div = ARIZONA_FLL_MIN_OUTDIV; |
1435 | while (Fout * div < ARIZONA_FLL_MIN_FVCO * fll->vco_mult) { | 1434 | while (fll->fout * div < ARIZONA_FLL_MIN_FVCO * fll->vco_mult) { |
1436 | div++; | 1435 | div++; |
1437 | if (div > ARIZONA_FLL_MAX_OUTDIV) | 1436 | if (div > ARIZONA_FLL_MAX_OUTDIV) |
1438 | return -EINVAL; | 1437 | return -EINVAL; |
1439 | } | 1438 | } |
1440 | target = Fout * div / fll->vco_mult; | 1439 | target = fll->fout * div / fll->vco_mult; |
1441 | cfg->outdiv = div; | 1440 | cfg->outdiv = div; |
1442 | 1441 | ||
1443 | arizona_fll_dbg(fll, "Fvco=%dHz\n", target); | 1442 | arizona_fll_dbg(fll, "Fvco=%dHz\n", target); |
@@ -1565,19 +1564,19 @@ static void arizona_enable_fll(struct arizona_fll *fll) | |||
1565 | */ | 1564 | */ |
1566 | if (fll->ref_src >= 0 && fll->ref_freq && | 1565 | if (fll->ref_src >= 0 && fll->ref_freq && |
1567 | fll->ref_src != fll->sync_src) { | 1566 | fll->ref_src != fll->sync_src) { |
1568 | arizona_calc_fll(fll, &cfg, fll->ref_freq, fll->fout); | 1567 | arizona_calc_fll(fll, &cfg, fll->ref_freq); |
1569 | 1568 | ||
1570 | arizona_apply_fll(arizona, fll->base, &cfg, fll->ref_src, | 1569 | arizona_apply_fll(arizona, fll->base, &cfg, fll->ref_src, |
1571 | false); | 1570 | false); |
1572 | if (fll->sync_src >= 0) { | 1571 | if (fll->sync_src >= 0) { |
1573 | arizona_calc_fll(fll, &cfg, fll->sync_freq, fll->fout); | 1572 | arizona_calc_fll(fll, &cfg, fll->sync_freq); |
1574 | 1573 | ||
1575 | arizona_apply_fll(arizona, fll->base + 0x10, &cfg, | 1574 | arizona_apply_fll(arizona, fll->base + 0x10, &cfg, |
1576 | fll->sync_src, true); | 1575 | fll->sync_src, true); |
1577 | use_sync = true; | 1576 | use_sync = true; |
1578 | } | 1577 | } |
1579 | } else if (fll->sync_src >= 0) { | 1578 | } else if (fll->sync_src >= 0) { |
1580 | arizona_calc_fll(fll, &cfg, fll->sync_freq, fll->fout); | 1579 | arizona_calc_fll(fll, &cfg, fll->sync_freq); |
1581 | 1580 | ||
1582 | arizona_apply_fll(arizona, fll->base, &cfg, | 1581 | arizona_apply_fll(arizona, fll->base, &cfg, |
1583 | fll->sync_src, false); | 1582 | fll->sync_src, false); |