Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226647
b: refs/heads/master
c: c80705a
h: refs/heads/master
i:
  226645: b7eeff2
  226643: 510e5c2
  226639: 264aa9f
v: v3
  • Loading branch information
Kevin Hilman authored and Paul Walmsley committed Dec 22, 2010
1 parent c7b6c1f commit 254d69d
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7f595674e08b8b4d3faf64a19bccc95445d7ed35
refs/heads/master: c80705aa7074045e7431ed2ebeb0f7d5773615ab
22 changes: 22 additions & 0 deletions trunk/arch/arm/mach-omap2/omap_hwmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -2188,3 +2188,25 @@ int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state)

return ret;
}

/**
* omap_hwmod_get_context_loss_count - get lost context count
* @oh: struct omap_hwmod *
*
* Query the powerdomain of of @oh to get the context loss
* count for this device.
*
* Returns the context loss count of the powerdomain assocated with @oh
* upon success, or zero if no powerdomain exists for @oh.
*/
u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh)
{
struct powerdomain *pwrdm;
int ret = 0;

pwrdm = omap_hwmod_get_pwrdm(oh);
if (pwrdm)
ret = pwrdm_get_context_loss_count(pwrdm);

return ret;
}
4 changes: 2 additions & 2 deletions trunk/arch/arm/plat-omap/include/plat/omap-pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,9 @@ unsigned long omap_pm_cpu_get_freq(void);
* driver must restore device context. If the number of context losses
* exceeds the maximum positive integer, the function will wrap to 0 and
* continue counting. Returns the number of context losses for this device,
* or -EINVAL upon error.
* or zero upon error.
*/
int omap_pm_get_dev_context_loss_count(struct device *dev);
u32 omap_pm_get_dev_context_loss_count(struct device *dev);


#endif
1 change: 1 addition & 0 deletions trunk/arch/arm/plat-omap/include/plat/omap_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ void __iomem *omap_device_get_rt_va(struct omap_device *od);
int omap_device_align_pm_lat(struct platform_device *pdev,
u32 new_wakeup_lat_limit);
struct powerdomain *omap_device_get_pwrdm(struct omap_device *od);
u32 omap_device_get_context_loss_count(struct platform_device *pdev);

/* Other */

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/plat-omap/include/plat/omap_hwmod.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ int omap_hwmod_for_each_by_class(const char *classname,
void *user);

int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);

/*
* Chip variant-specific hwmod init routines - XXX should be converted
Expand Down
23 changes: 11 additions & 12 deletions trunk/arch/arm/plat-omap/omap-pm-noop.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
#include <linux/init.h>
#include <linux/cpufreq.h>
#include <linux/device.h>
#include <linux/platform_device.h>

/* Interface documentation is in mach/omap-pm.h */
#include <plat/omap-pm.h>
#include <plat/omap_device.h>

/*
* Device-driver-originated constraints (via board-*.c files)
Expand Down Expand Up @@ -282,22 +284,19 @@ unsigned long omap_pm_cpu_get_freq(void)
* Device context loss tracking
*/

int omap_pm_get_dev_context_loss_count(struct device *dev)
u32 omap_pm_get_dev_context_loss_count(struct device *dev)
{
if (!dev) {
WARN_ON(1);
return -EINVAL;
};
struct platform_device *pdev = to_platform_device(dev);
u32 count;

pr_debug("OMAP PM: returning context loss count for dev %s\n",
dev_name(dev));
if (WARN_ON(!dev))
return 0;

/*
* Map the device to the powerdomain. Return the powerdomain
* off counter.
*/
count = omap_device_get_context_loss_count(pdev);
pr_debug("OMAP PM: context loss count for dev %s = %d\n",
dev_name(dev), count);

return 0;
return count;
}


Expand Down
28 changes: 28 additions & 0 deletions trunk/arch/arm/plat-omap/omap_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down

0 comments on commit 254d69d

Please sign in to comment.