Merge remote-tracking branch 'ftrace/for-next'
[deliverable/linux.git] / sound / soc / codecs / arizona.c
index ecfdbfcae366cf5840e40b1c847d9bc6d56ba4e4..ded235f3090fcb4e0ca2fae0da0911768ba9d885 100644 (file)
@@ -1920,8 +1920,8 @@ static struct {
 
 struct arizona_fll_cfg {
        int n;
-       int theta;
-       int lambda;
+       unsigned int theta;
+       unsigned int lambda;
        int refdiv;
        int outdiv;
        int fratio;
@@ -2218,11 +2218,11 @@ static int arizona_enable_fll(struct arizona_fll *fll)
 
        if (already_enabled) {
                /* Facilitate smooth refclk across the transition */
-               regmap_update_bits_async(fll->arizona->regmap, fll->base + 0x9,
-                                        ARIZONA_FLL1_GAIN_MASK, 0);
                regmap_update_bits(fll->arizona->regmap, fll->base + 1,
                                   ARIZONA_FLL1_FREERUN, ARIZONA_FLL1_FREERUN);
                udelay(32);
+               regmap_update_bits_async(fll->arizona->regmap, fll->base + 0x9,
+                                        ARIZONA_FLL1_GAIN_MASK, 0);
        }
 
        /*
@@ -2233,6 +2233,10 @@ static int arizona_enable_fll(struct arizona_fll *fll)
            fll->ref_src != fll->sync_src) {
                arizona_calc_fll(fll, &cfg, fll->ref_freq, false);
 
+               /* Ref path hardcodes lambda to 65536 when sync is on */
+               if (fll->sync_src >= 0 && cfg.lambda)
+                       cfg.theta = (cfg.theta * (1 << 16)) / cfg.lambda;
+
                arizona_apply_fll(arizona, fll->base, &cfg, fll->ref_src,
                                  false);
                if (fll->sync_src >= 0) {
@@ -2268,7 +2272,7 @@ static int arizona_enable_fll(struct arizona_fll *fll)
                                         ARIZONA_FLL1_SYNC_BW);
 
        if (!already_enabled)
-               pm_runtime_get(arizona->dev);
+               pm_runtime_get_sync(arizona->dev);
 
        regmap_update_bits_async(arizona->regmap, fll->base + 1,
                                 ARIZONA_FLL1_ENA, ARIZONA_FLL1_ENA);
This page took 0.02641 seconds and 5 git commands to generate.