return 1;
}
+/* _clkdm_deny_idle - private callback function used by set_pwrdm_state() */
+static int _clkdm_deny_idle(struct powerdomain *pwrdm,
+ struct clockdomain *clkdm)
+{
+ omap2_clkdm_deny_idle(clkdm);
+ return 0;
+}
+
+/* _clkdm_allow_idle - private callback function used by set_pwrdm_state() */
+static int _clkdm_allow_idle(struct powerdomain *pwrdm,
+ struct clockdomain *clkdm)
+{
+ omap2_clkdm_allow_idle(clkdm);
+ return 0;
+}
+
/* This sets pwrdm state (other than mpu & core. Currently only ON &
* RET are supported. Function is assuming that clkdm doesn't have
* hw_sup mode enabled. */
{
u32 cur_state;
int ret = 0;
- int i = 0;
if (pwrdm == NULL || IS_ERR(pwrdm))
return -EINVAL;
if (cur_state == state)
return ret;
- for (i = 0; pwrdm->pwrdm_clkdms[i]; i++)
- omap2_clkdm_deny_idle(pwrdm->pwrdm_clkdms[i]);
+ pwrdm_for_each_clkdm(pwrdm, _clkdm_deny_idle);
ret = pwrdm_set_next_pwrst(pwrdm, state);
if (ret) {
goto err;
}
- for (i = 0; pwrdm->pwrdm_clkdms[i]; i++)
- omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[i]);
+ pwrdm_for_each_clkdm(pwrdm, _clkdm_allow_idle);
err:
return ret;