@@ -868,6 +868,36 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
}
/**
+ * omap2_clkdm_read_hwsup - read the hwsup idle transition bit
+ * @clkdm: struct clockdomain *
+ *
+ * Checks whether hardware is allowed to switch the clockdomain @clkdm
+ * automatically into active or idle states. Returns -EINVAL if @clkdm
+ * is NULL; otherwise, 1 if hardware auto-idle is enabled, 0 if not.
+ */
+int omap2_clkdm_read_hwsup(struct clockdomain *clkdm)
+{
+ u32 u, v;
+
+ if (!clkdm)
+ return -EINVAL;
+
+ u = cm_read_mod_reg(clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL);
+ u &= clkdm->clktrctrl_mask;
+
+ if (cpu_is_omap24xx())
+ v = OMAP24XX_CLKSTCTRL_ENABLE_AUTO;
+ else if (cpu_is_omap34xx() || cpu_is_omap44xx())
+ v = OMAP34XX_CLKSTCTRL_ENABLE_AUTO;
+ else
+ BUG();
+
+ v <<= __ffs(clkdm->clktrctrl_mask);
+
+ return (u == v) ? 1 : 0;
+}
+
+/**
* omap2_clkdm_allow_idle - enable hwsup idle transitions for clkdm
* @clkdm: struct clockdomain *
*
@@ -129,6 +129,7 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm);
+int omap2_clkdm_read_hwsup(struct clockdomain *clkdm);
void omap2_clkdm_allow_idle(struct clockdomain *clkdm);
void omap2_clkdm_deny_idle(struct clockdomain *clkdm);