diff options
Diffstat (limited to 'arch/arm/mach-omap2/clockdomain2xxx_3xxx.c')
-rw-r--r-- | arch/arm/mach-omap2/clockdomain2xxx_3xxx.c | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c index f99e65cfb862..9a7792aec673 100644 --- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c +++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c | |||
@@ -162,6 +162,19 @@ static void _disable_hwsup(struct clockdomain *clkdm) | |||
162 | clkdm->clktrctrl_mask); | 162 | clkdm->clktrctrl_mask); |
163 | } | 163 | } |
164 | 164 | ||
165 | static int omap3_clkdm_sleep(struct clockdomain *clkdm) | ||
166 | { | ||
167 | omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs, | ||
168 | clkdm->clktrctrl_mask); | ||
169 | return 0; | ||
170 | } | ||
171 | |||
172 | static int omap3_clkdm_wakeup(struct clockdomain *clkdm) | ||
173 | { | ||
174 | omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs, | ||
175 | clkdm->clktrctrl_mask); | ||
176 | return 0; | ||
177 | } | ||
165 | 178 | ||
166 | static int omap2_clkdm_clk_enable(struct clockdomain *clkdm) | 179 | static int omap2_clkdm_clk_enable(struct clockdomain *clkdm) |
167 | { | 180 | { |
@@ -170,6 +183,17 @@ static int omap2_clkdm_clk_enable(struct clockdomain *clkdm) | |||
170 | if (!clkdm->clktrctrl_mask) | 183 | if (!clkdm->clktrctrl_mask) |
171 | return 0; | 184 | return 0; |
172 | 185 | ||
186 | /* | ||
187 | * The CLKDM_MISSING_IDLE_REPORTING flag documentation has | ||
188 | * more details on the unpleasant problem this is working | ||
189 | * around | ||
190 | */ | ||
191 | if (clkdm->flags & CLKDM_MISSING_IDLE_REPORTING && | ||
192 | !(clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) { | ||
193 | _enable_hwsup(clkdm); | ||
194 | return 0; | ||
195 | } | ||
196 | |||
173 | hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, | 197 | hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, |
174 | clkdm->clktrctrl_mask); | 198 | clkdm->clktrctrl_mask); |
175 | 199 | ||
@@ -193,6 +217,17 @@ static int omap2_clkdm_clk_disable(struct clockdomain *clkdm) | |||
193 | if (!clkdm->clktrctrl_mask) | 217 | if (!clkdm->clktrctrl_mask) |
194 | return 0; | 218 | return 0; |
195 | 219 | ||
220 | /* | ||
221 | * The CLKDM_MISSING_IDLE_REPORTING flag documentation has | ||
222 | * more details on the unpleasant problem this is working | ||
223 | * around | ||
224 | */ | ||
225 | if ((clkdm->flags & CLKDM_MISSING_IDLE_REPORTING) && | ||
226 | (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)) { | ||
227 | omap3_clkdm_wakeup(clkdm); | ||
228 | return 0; | ||
229 | } | ||
230 | |||
196 | hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, | 231 | hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, |
197 | clkdm->clktrctrl_mask); | 232 | clkdm->clktrctrl_mask); |
198 | 233 | ||
@@ -209,20 +244,6 @@ static int omap2_clkdm_clk_disable(struct clockdomain *clkdm) | |||
209 | return 0; | 244 | return 0; |
210 | } | 245 | } |
211 | 246 | ||
212 | static int omap3_clkdm_sleep(struct clockdomain *clkdm) | ||
213 | { | ||
214 | omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs, | ||
215 | clkdm->clktrctrl_mask); | ||
216 | return 0; | ||
217 | } | ||
218 | |||
219 | static int omap3_clkdm_wakeup(struct clockdomain *clkdm) | ||
220 | { | ||
221 | omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs, | ||
222 | clkdm->clktrctrl_mask); | ||
223 | return 0; | ||
224 | } | ||
225 | |||
226 | static void omap3_clkdm_allow_idle(struct clockdomain *clkdm) | 247 | static void omap3_clkdm_allow_idle(struct clockdomain *clkdm) |
227 | { | 248 | { |
228 | if (atomic_read(&clkdm->usecount) > 0) | 249 | if (atomic_read(&clkdm->usecount) > 0) |