aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2013-02-10 13:22:22 -0500
committerPaul Walmsley <paul@pwsan.com>2013-02-10 13:22:22 -0500
commit6d266f63a11bce427504d203834df3c0bb9be9a5 (patch)
tree8b1a059ab5d9bc35586ba7982d1e3acec20d8932 /arch/arm/mach-omap2
parent88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7 (diff)
ARM: OMAP2+: hwmod: add enable_preprogram hook
After setup/enable, some IP blocks need some additional setting to indicate the PRCM that they are inactive until they are configured. Some examples on OMAP4 include the AESS and FSUSB IP blocks. To fix this cleanly, this patch adds another optional function pointer, enable_preprogram, to the IP block's hwmod data. The function that is pointed to is called by the hwmod code immediately after the IP block is reset. This version of the patch includes a patch description fix from Felipe. Signed-off-by: Paul Walmsley <paul@pwsan.com> Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com> Cc: Benoît Cousson <b-cousson@ti.com> Cc: Péter Ujfalusi <peter.ujfalusi@ti.com> Cc: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c18
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 4653efb87a27..f37d22c597f9 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2053,6 +2053,23 @@ static int _omap4_get_context_lost(struct omap_hwmod *oh)
2053} 2053}
2054 2054
2055/** 2055/**
2056 * _enable_preprogram - Pre-program an IP block during the _enable() process
2057 * @oh: struct omap_hwmod *
2058 *
2059 * Some IP blocks (such as AESS) require some additional programming
2060 * after enable before they can enter idle. If a function pointer to
2061 * do so is present in the hwmod data, then call it and pass along the
2062 * return value; otherwise, return 0.
2063 */
2064static int __init _enable_preprogram(struct omap_hwmod *oh)
2065{
2066 if (!oh->class->enable_preprogram)
2067 return 0;
2068
2069 return oh->class->enable_preprogram(oh);
2070}
2071
2072/**
2056 * _enable - enable an omap_hwmod 2073 * _enable - enable an omap_hwmod
2057 * @oh: struct omap_hwmod * 2074 * @oh: struct omap_hwmod *
2058 * 2075 *
@@ -2156,6 +2173,7 @@ static int _enable(struct omap_hwmod *oh)
2156 _update_sysc_cache(oh); 2173 _update_sysc_cache(oh);
2157 _enable_sysc(oh); 2174 _enable_sysc(oh);
2158 } 2175 }
2176 r = _enable_preprogram(oh);
2159 } else { 2177 } else {
2160 if (soc_ops.disable_module) 2178 if (soc_ops.disable_module)
2161 soc_ops.disable_module(oh); 2179 soc_ops.disable_module(oh);
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 3ae852a522f9..41066b4b7a7b 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -501,6 +501,7 @@ struct omap_hwmod_omap4_prcm {
501 * @rev: revision of the IP class 501 * @rev: revision of the IP class
502 * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown 502 * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
503 * @reset: ptr to fn to be executed in place of the standard hwmod reset fn 503 * @reset: ptr to fn to be executed in place of the standard hwmod reset fn
504 * @enable_preprogram: ptr to fn to be executed during device enable
504 * 505 *
505 * Represent the class of a OMAP hardware "modules" (e.g. timer, 506 * Represent the class of a OMAP hardware "modules" (e.g. timer,
506 * smartreflex, gpio, uart...) 507 * smartreflex, gpio, uart...)
@@ -524,6 +525,7 @@ struct omap_hwmod_class {
524 u32 rev; 525 u32 rev;
525 int (*pre_shutdown)(struct omap_hwmod *oh); 526 int (*pre_shutdown)(struct omap_hwmod *oh);
526 int (*reset)(struct omap_hwmod *oh); 527 int (*reset)(struct omap_hwmod *oh);
528 int (*enable_preprogram)(struct omap_hwmod *oh);
527}; 529};
528 530
529/** 531/**