]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: arizona: Allow specification of base for arizona_is_enabled_fll
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Fri, 2 Sep 2016 15:52:44 +0000 (16:52 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 14 Sep 2016 17:07:10 +0000 (18:07 +0100)
In preparation for future improvements allow a base to be passed to
arizona_is_enabled_fll, this will allow it to be used to check the state
of the synchroniser path as well.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/arizona.c

index ecfdbfcae366cf5840e40b1c847d9bc6d56ba4e4..5455d0e87f0f665428d4ead445548302fd8e5100 100644 (file)
@@ -2188,13 +2188,13 @@ static void arizona_apply_fll(struct arizona *arizona, unsigned int base,
                                 ARIZONA_FLL1_CTRL_UPD | cfg->n);
 }
 
-static int arizona_is_enabled_fll(struct arizona_fll *fll)
+static int arizona_is_enabled_fll(struct arizona_fll *fll, int base)
 {
        struct arizona *arizona = fll->arizona;
        unsigned int reg;
        int ret;
 
-       ret = regmap_read(arizona->regmap, fll->base + 1, &reg);
+       ret = regmap_read(arizona->regmap, base + 1, &reg);
        if (ret != 0) {
                arizona_fll_err(fll, "Failed to read current state: %d\n",
                                ret);
@@ -2208,7 +2208,7 @@ static int arizona_enable_fll(struct arizona_fll *fll)
 {
        struct arizona *arizona = fll->arizona;
        bool use_sync = false;
-       int already_enabled = arizona_is_enabled_fll(fll);
+       int already_enabled = arizona_is_enabled_fll(fll, fll->base);
        struct arizona_fll_cfg cfg;
        int i;
        unsigned int val;