summaryrefslogtreecommitdiff
path: root/arch/arm/plat-omap/omap_device.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2010-12-22 11:32:24 -0800
committerTony Lindgren <tony@atomide.com>2010-12-22 11:32:24 -0800
commit808601b75804475c9022f6375e76b7c62c99a10a (patch)
tree355a3100269e88460e36f251ef0ce2f1ed88d52e /arch/arm/plat-omap/omap_device.c
parentc10abbb26513f4ccff89c4d80912cb4d36fcd3e8 (diff)
parentf17f9726c27c3921e00a5750e85070e6dd7e1ff7 (diff)
Merge branch 'integration-2.6.38-for-tony' of git://git.pwsan.com/linux-2.6 into omap-for-linus
Diffstat (limited to 'arch/arm/plat-omap/omap_device.c')
-rw-r--r--arch/arm/plat-omap/omap_device.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index abe933cd8f0..57adb270767 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -280,6 +280,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 *
*