diff options
-rw-r--r-- | sound/soc/codecs/arizona.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index 4640bccbfba2..a8821a819adc 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c | |||
@@ -1090,6 +1090,20 @@ static bool arizona_is_enabled_fll(struct arizona_fll *fll) | |||
1090 | return reg & ARIZONA_FLL1_ENA; | 1090 | return reg & ARIZONA_FLL1_ENA; |
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | static void arizona_disable_fll(struct arizona_fll *fll) | ||
1094 | { | ||
1095 | struct arizona *arizona = fll->arizona; | ||
1096 | bool change; | ||
1097 | |||
1098 | regmap_update_bits_check(arizona->regmap, fll->base + 1, | ||
1099 | ARIZONA_FLL1_ENA, 0, &change); | ||
1100 | regmap_update_bits(arizona->regmap, fll->base + 0x11, | ||
1101 | ARIZONA_FLL1_SYNC_ENA, 0); | ||
1102 | |||
1103 | if (change) | ||
1104 | pm_runtime_put_autosuspend(arizona->dev); | ||
1105 | } | ||
1106 | |||
1093 | int arizona_set_fll(struct arizona_fll *fll, int source, | 1107 | int arizona_set_fll(struct arizona_fll *fll, int source, |
1094 | unsigned int Fref, unsigned int Fout) | 1108 | unsigned int Fref, unsigned int Fout) |
1095 | { | 1109 | { |
@@ -1156,13 +1170,7 @@ int arizona_set_fll(struct arizona_fll *fll, int source, | |||
1156 | if (ret == 0) | 1170 | if (ret == 0) |
1157 | arizona_fll_warn(fll, "Timed out waiting for lock\n"); | 1171 | arizona_fll_warn(fll, "Timed out waiting for lock\n"); |
1158 | } else { | 1172 | } else { |
1159 | regmap_update_bits(arizona->regmap, fll->base + 1, | 1173 | arizona_disable_fll(fll); |
1160 | ARIZONA_FLL1_ENA, 0); | ||
1161 | regmap_update_bits(arizona->regmap, fll->base + 0x11, | ||
1162 | ARIZONA_FLL1_SYNC_ENA, 0); | ||
1163 | |||
1164 | if (ena) | ||
1165 | pm_runtime_put_autosuspend(arizona->dev); | ||
1166 | } | 1174 | } |
1167 | 1175 | ||
1168 | fll->fref = Fref; | 1176 | fll->fref = Fref; |