Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 371774
b: refs/heads/master
c: d122d6c
h: refs/heads/master
v: v3
  • Loading branch information
Charles Keepax authored and Mark Brown committed Mar 4, 2013
1 parent cda430a commit 6f1b331
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9e359c645fa86daf0e3e5cc2dcbe7388f6e4d16a
refs/heads/master: d122d6c974e35c940a638c26aa70bea363141d27
25 changes: 17 additions & 8 deletions trunk/sound/soc/codecs/arizona.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,12 +1074,27 @@ static void arizona_apply_fll(struct arizona *arizona, unsigned int base,
ARIZONA_FLL1_CTRL_UPD | cfg->n);
}

static bool arizona_is_enabled_fll(struct arizona_fll *fll)
{
struct arizona *arizona = fll->arizona;
unsigned int reg;
int ret;

ret = regmap_read(arizona->regmap, fll->base + 1, &reg);
if (ret != 0) {
arizona_fll_err(fll, "Failed to read current state: %d\n",
ret);
return ret;
}

return reg & ARIZONA_FLL1_ENA;
}

int arizona_set_fll(struct arizona_fll *fll, int source,
unsigned int Fref, unsigned int Fout)
{
struct arizona *arizona = fll->arizona;
struct arizona_fll_cfg ref, sync;
unsigned int reg;
bool ena;
int ret;

Expand Down Expand Up @@ -1111,13 +1126,7 @@ int arizona_set_fll(struct arizona_fll *fll, int source,
fll->sync_freq = Fref;
}

ret = regmap_read(arizona->regmap, fll->base + 1, &reg);
if (ret != 0) {
arizona_fll_err(fll, "Failed to read current state: %d\n",
ret);
return ret;
}
ena = reg & ARIZONA_FLL1_ENA;
ena = arizona_is_enabled_fll(fll);

if (Fout) {
regmap_update_bits(arizona->regmap, fll->base + 5,
Expand Down

0 comments on commit 6f1b331

Please sign in to comment.