aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_hwmod.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@deeprootsystems.com>2010-12-21 23:31:55 -0500
committerPaul Walmsley <paul@pwsan.com>2010-12-21 23:31:55 -0500
commitc80705aa7074045e7431ed2ebeb0f7d5773615ab (patch)
tree8c62b8e0456a95844237bdb87e021318fc588f9a /arch/arm/mach-omap2/omap_hwmod.c
parent7f595674e08b8b4d3faf64a19bccc95445d7ed35 (diff)
OMAP: PM: implement context loss count APIs
Implement OMAP PM layer omap_pm_get_dev_context_loss_count() API by creating similar APIs at the omap_device and omap_hwmod levels. The omap_hwmod level call is the layer with access to the powerdomain core, so it is the place where the powerdomain is queried to get the context loss count. The new APIs return an unsigned value that can wrap as the context-loss count grows. However, the wrapping is not important as the role of this function is to determine context loss by checking for any difference in subsequent calls to this function. Note that these APIs at each level can return zero when no context loss is detected, or on errors. This is to avoid returning error codes which could potentially be mistaken for large context loss counters. NOTE: only works for devices which have been converted to use omap_device/omap_hwmod. Longer term, we could possibly remove this API from the OMAP PM layer, and instead directly use the omap_device level API. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 03ffa3b282b1..77a8be64cfae 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2188,3 +2188,25 @@ ohsps_unlock:
2188 2188
2189 return ret; 2189 return ret;
2190} 2190}
2191
2192/**
2193 * omap_hwmod_get_context_loss_count - get lost context count
2194 * @oh: struct omap_hwmod *
2195 *
2196 * Query the powerdomain of of @oh to get the context loss
2197 * count for this device.
2198 *
2199 * Returns the context loss count of the powerdomain assocated with @oh
2200 * upon success, or zero if no powerdomain exists for @oh.
2201 */
2202u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh)
2203{
2204 struct powerdomain *pwrdm;
2205 int ret = 0;
2206
2207 pwrdm = omap_hwmod_get_pwrdm(oh);
2208 if (pwrdm)
2209 ret = pwrdm_get_context_loss_count(pwrdm);
2210
2211 return ret;
2212}