@@ -654,12 +654,6 @@ static void _sysc_enable(struct omap_hwmod *oh)
_set_master_standbymode(oh, idlemode, &v);
}
- if (sf & SYSC_HAS_AUTOIDLE) {
- idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
- 0 : 1;
- _set_module_autoidle(oh, idlemode, &v);
- }
-
/* XXX OCP ENAWAKEUP bit? */
/*
@@ -672,6 +666,18 @@ static void _sysc_enable(struct omap_hwmod *oh)
_set_clockactivity(oh, oh->class->sysc->clockact, &v);
_write_sysconfig(v, oh);
+
+ /* Set the auto idle bit only after setting the smartidle bit
+ * as this is requirement for some modules like USBOTG
+ * setting this will not have any impact on the other modues.
+ */
+
+ if (sf & SYSC_HAS_AUTOIDLE) {
+ idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
+ 0 : 1;
+ _set_module_autoidle(oh, idlemode, &v);
+ }
+ _write_sysconfig(v, oh);
}
/**
@@ -116,6 +116,8 @@ int omap_device_enable_hwmods(struct omap_device *od);
int omap_device_disable_clocks(struct omap_device *od);
int omap_device_enable_clocks(struct omap_device *od);
+int omap_device_enable_wakeup(struct platform_device *pdev);
+int omap_device_disable_wakeup(struct platform_device *pdev);
/*
* Entries should be kept in latency order ascending
@@ -757,3 +757,46 @@ int omap_device_enable_clocks(struct omap_device *od)
/* XXX pass along return value here? */
return 0;
}
+
+/**
+ * omap_device_enable_wakeup - Enable the wakeup bit
+ * @od: struct omap_device *od
+ *
+ * Enable the wakup bit for omap_hwmods associated
+ * with the omap_device. Returns 0.
+ */
+int omap_device_enable_wakeup(struct platform_device *pdev)
+{
+ struct omap_hwmod *oh;
+ struct omap_device *od = _find_by_pdev(pdev);
+ int i;
+
+ for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++)
+ omap_hwmod_enable_wakeup(oh);
+
+ /* XXX pass along return value here? */
+ return 0;
+}
+
+/**
+ * omap_device_disable_wakeup -Disable the wakeup bit
+ * @od: struct omap_device *od
+ *
+ * Disable the wakup bit for omap_hwmods associated
+ * with the omap_device. Returns 0.
+ */
+
+
+int omap_device_disable_wakeup(struct platform_device *pdev)
+{
+ struct omap_hwmod *oh;
+ struct omap_device *od = _find_by_pdev(pdev);
+ int i;
+
+ for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++)
+ omap_hwmod_disable_wakeup(oh);
+
+ /* XXX pass along return value here? */
+ return 0;
+}
+