Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 371778
b: refs/heads/master
c: ee929a9
h: refs/heads/master
v: v3
  • Loading branch information
Charles Keepax authored and Mark Brown committed Mar 4, 2013
1 parent d1fe78b commit 23c7d07
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 5 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: de1e6eedddeab2fa417c38c231d896198f903129
refs/heads/master: ee929a9780605f21ad67a1ccb626baa41e038c1a
39 changes: 39 additions & 0 deletions trunk/sound/soc/codecs/arizona.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,45 @@ static void arizona_disable_fll(struct arizona_fll *fll)
pm_runtime_put_autosuspend(arizona->dev);
}

int arizona_set_fll_refclk(struct arizona_fll *fll, int source,
unsigned int Fref, unsigned int Fout)
{
struct arizona_fll_cfg ref, sync;
int ret;

if (source < 0)
return -EINVAL;

if (fll->ref_src == source && fll->ref_freq == Fref &&
fll->fout == Fout)
return 0;

if (Fout) {
ret = arizona_calc_fll(fll, &ref, Fref, Fout);
if (ret != 0)
return ret;

if (fll->sync_src >= 0) {
ret = arizona_calc_fll(fll, &sync, fll->sync_freq, Fout);
if (ret != 0)
return ret;
}
}

fll->ref_src = source;
fll->ref_freq = Fref;
fll->fout = Fout;

if (Fout) {
arizona_enable_fll(fll, &ref, &sync);
} else {
arizona_disable_fll(fll);
}

return 0;
}
EXPORT_SYMBOL_GPL(arizona_set_fll_refclk);

int arizona_set_fll(struct arizona_fll *fll, int source,
unsigned int Fref, unsigned int Fout)
{
Expand Down
2 changes: 2 additions & 0 deletions trunk/sound/soc/codecs/arizona.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ struct arizona_fll {

extern int arizona_init_fll(struct arizona *arizona, int id, int base,
int lock_irq, int ok_irq, struct arizona_fll *fll);
extern int arizona_set_fll_refclk(struct arizona_fll *fll, int source,
unsigned int Fref, unsigned int Fout);
extern int arizona_set_fll(struct arizona_fll *fll, int source,
unsigned int Fref, unsigned int Fout);

Expand Down
6 changes: 6 additions & 0 deletions trunk/sound/soc/codecs/wm5102.c
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,12 @@ static int wm5102_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
return arizona_set_fll(&wm5102->fll[0], source, Fref, Fout);
case WM5102_FLL2:
return arizona_set_fll(&wm5102->fll[1], source, Fref, Fout);
case WM5102_FLL1_REFCLK:
return arizona_set_fll_refclk(&wm5102->fll[0], source, Fref,
Fout);
case WM5102_FLL2_REFCLK:
return arizona_set_fll_refclk(&wm5102->fll[1], source, Fref,
Fout);
default:
return -EINVAL;
}
Expand Down
6 changes: 4 additions & 2 deletions trunk/sound/soc/codecs/wm5102.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

#include "arizona.h"

#define WM5102_FLL1 1
#define WM5102_FLL2 2
#define WM5102_FLL1 1
#define WM5102_FLL2 2
#define WM5102_FLL1_REFCLK 3
#define WM5102_FLL2_REFCLK 4

#endif
6 changes: 6 additions & 0 deletions trunk/sound/soc/codecs/wm5110.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,12 @@ static int wm5110_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
return arizona_set_fll(&wm5110->fll[0], source, Fref, Fout);
case WM5110_FLL2:
return arizona_set_fll(&wm5110->fll[1], source, Fref, Fout);
case WM5110_FLL1_REFCLK:
return arizona_set_fll_refclk(&wm5110->fll[0], source, Fref,
Fout);
case WM5110_FLL2_REFCLK:
return arizona_set_fll_refclk(&wm5110->fll[1], source, Fref,
Fout);
default:
return -EINVAL;
}
Expand Down
6 changes: 4 additions & 2 deletions trunk/sound/soc/codecs/wm5110.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

#include "arizona.h"

#define WM5110_FLL1 1
#define WM5110_FLL2 2
#define WM5110_FLL1 1
#define WM5110_FLL2 2
#define WM5110_FLL1_REFCLK 3
#define WM5110_FLL2_REFCLK 4

#endif

0 comments on commit 23c7d07

Please sign in to comment.