Commit 8b112c0abd10163170ff71114def61ddbc889dc5

Authored by Dave Gerlach
Committed by Rajendra Nayak
1 parent fe66c6993c

ARM: OMAP2+: omap_hwmod: Maintain legacy context loss count

In the case of am43xx, make sure we allow hwmods that don't use the hwmod
context_offs for context loss counting to still use powerdomains to count
context loss.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>

Showing 1 changed file with 16 additions and 1 deletions Side-by-side Diff

arch/arm/mach-omap2/omap_hwmod.c
... ... @@ -181,6 +181,9 @@
181 181 * device drivers. Until then, this should avoid huge blocks of cpu_is_*()
182 182 * conditionals in this code.
183 183 */
  184 +
  185 +#define SOC_HWMOD_CHECK_FOR_CONTEXT_FLAG (0x1 << 0)
  186 +
184 187 struct omap_hwmod_soc_ops {
185 188 void (*enable_module)(struct omap_hwmod *oh);
186 189 int (*disable_module)(struct omap_hwmod *oh);
... ... @@ -194,6 +197,7 @@
194 197 int (*init_clkdm)(struct omap_hwmod *oh);
195 198 void (*update_context_lost)(struct omap_hwmod *oh);
196 199 int (*get_context_lost)(struct omap_hwmod *oh);
  200 + u8 flags;
197 201 };
198 202  
199 203 /* soc_ops: adapts the omap_hwmod code to the currently-booted SoC */
200 204  
201 205  
... ... @@ -4117,9 +4121,19 @@
4117 4121 struct powerdomain *pwrdm;
4118 4122 int ret = 0;
4119 4123  
4120   - if (soc_ops.get_context_lost)
  4124 + if (soc_ops.get_context_lost) {
  4125 + /*
  4126 + * On SoCs like AM437x where we dont use hwmod to check context
  4127 + * loss on certain devices..
  4128 + */
  4129 + if ((soc_ops.flags & SOC_HWMOD_CHECK_FOR_CONTEXT_FLAG) &&
  4130 + !(oh->prcm.omap4.flags & HWMOD_AM437X_HAS_CONTEXT_LOSS_BIT))
  4131 + goto get_pwrdm_context_loss_count;
  4132 +
4121 4133 return soc_ops.get_context_lost(oh);
  4134 + }
4122 4135  
  4136 +get_pwrdm_context_loss_count:
4123 4137 pwrdm = omap_hwmod_get_pwrdm(oh);
4124 4138 if (pwrdm)
4125 4139 ret = pwrdm_get_context_loss_count(pwrdm);
... ... @@ -4247,6 +4261,7 @@
4247 4261 soc_ops.init_clkdm = _init_clkdm;
4248 4262 soc_ops.update_context_lost = _am437x_update_context_lost;
4249 4263 soc_ops.get_context_lost = _omap4_get_context_lost;
  4264 + soc_ops.flags = SOC_HWMOD_CHECK_FOR_CONTEXT_FLAG;
4250 4265 } else if (soc_is_am33xx()) {
4251 4266 soc_ops.enable_module = _am33xx_enable_module;
4252 4267 soc_ops.disable_module = _am33xx_disable_module;