]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/arm/plat-omap/omap_device.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / arch / arm / plat-omap / omap_device.c
index abe933cd8f0926c99b059d2a214bda900e5326eb..57adb270767b8bb2ebc409cdd2a50e6d6e83b0d0 100644 (file)
@@ -279,6 +279,34 @@ static void _add_optional_clock_alias(struct omap_device *od,
 
 /* Public functions for use by core code */
 
+/**
+ * omap_device_get_context_loss_count - get lost context count
+ * @od: struct omap_device *
+ *
+ * Using the primary hwmod, query the context loss count for this
+ * device.
+ *
+ * Callers should consider context for this device lost any time this
+ * function returns a value different than the value the caller got
+ * the last time it called this function.
+ *
+ * If any hwmods exist for the omap_device assoiated with @pdev,
+ * return the context loss counter for that hwmod, otherwise return
+ * zero.
+ */
+u32 omap_device_get_context_loss_count(struct platform_device *pdev)
+{
+       struct omap_device *od;
+       u32 ret = 0;
+
+       od = _find_by_pdev(pdev);
+
+       if (od->hwmods_cnt)
+               ret = omap_hwmod_get_context_loss_count(od->hwmods[0]);
+
+       return ret;
+}
+
 /**
  * omap_device_count_resources - count number of struct resource entries needed
  * @od: struct omap_device *