aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c26
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h2
2 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index e282e35769fd..816aeb97ba28 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2218,3 +2218,29 @@ u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh)
2218 2218
2219 return ret; 2219 return ret;
2220} 2220}
2221
2222/**
2223 * omap_hwmod_no_setup_reset - prevent a hwmod from being reset upon setup
2224 * @oh: struct omap_hwmod *
2225 *
2226 * Prevent the hwmod @oh from being reset during the setup process.
2227 * Intended for use by board-*.c files on boards with devices that
2228 * cannot tolerate being reset. Must be called before the hwmod has
2229 * been set up. Returns 0 upon success or negative error code upon
2230 * failure.
2231 */
2232int omap_hwmod_no_setup_reset(struct omap_hwmod *oh)
2233{
2234 if (!oh)
2235 return -EINVAL;
2236
2237 if (oh->_state != _HWMOD_STATE_REGISTERED) {
2238 pr_err("omap_hwmod: %s: cannot prevent setup reset; in wrong state\n",
2239 oh->name);
2240 return -EINVAL;
2241 }
2242
2243 oh->flags |= HWMOD_INIT_NO_RESET;
2244
2245 return 0;
2246}
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 1eee85a8abb3..bba234337d00 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -589,6 +589,8 @@ int omap_hwmod_for_each_by_class(const char *classname,
589int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state); 589int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
590u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh); 590u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
591 591
592int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
593
592/* 594/*
593 * Chip variant-specific hwmod init routines - XXX should be converted 595 * Chip variant-specific hwmod init routines - XXX should be converted
594 * to use initcalls once the initial boot ordering is straightened out 596 * to use initcalls once the initial boot ordering is straightened out