From: jean.pihet@newoldbits.com
To: linux-omap@vger.kernel.org
Subject: [PATCH 09/13] OMAP2+: PM: export suspend_set_ops to PM modules
Date: Wed, 18 May 2011 19:32:26 +0200 [thread overview]
Message-ID: <1305739950-11695-10-git-send-email-j-pihet@ti.com> (raw)
In-Reply-To: <1305739950-11695-1-git-send-email-j-pihet@ti.com>
From: Jean Pihet <j-pihet@ti.com>
Export the suspend_set_ops API as omap_pm_suspend_set_ops in the pm
generic code, under CONFIG_SUSPEND.
Note -hack warning-: since the 'suspend_valid_only_mem' function is
not exported to modules, fill the 'valid' field value of
'struct platform_suspend_ops' in the common code.
Signed-off-by: Jean Pihet <j-pihet@ti.com>
---
arch/arm/mach-omap2/pm.c | 10 ++++++++++
arch/arm/mach-omap2/pm.h | 5 +++++
arch/arm/mach-omap2/pm24xx.c | 9 ++++-----
arch/arm/mach-omap2/pm34xx.c | 5 ++---
arch/arm/mach-omap2/pm44xx.c | 6 +++---
5 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 0c451e3..2e43fd6 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -16,6 +16,7 @@
#include <linux/opp.h>
#include <linux/hrtimer.h>
#include <linux/tick.h>
+#include <linux/suspend.h>
#include <plat/omap-pm.h>
#include <plat/omap_device.h>
@@ -324,3 +325,12 @@ unsigned long omap_pm_tick_nohz_get_sleep_length_us(void)
EXPORT_SYMBOL(omap_pm_tick_nohz_get_sleep_length_us);
#endif
+#ifdef CONFIG_SUSPEND
+void omap_pm_suspend_set_ops(struct platform_suspend_ops *pm_ops)
+{
+ if (pm_ops)
+ pm_ops->valid = suspend_valid_only_mem;
+ suspend_set_ops((const struct platform_suspend_ops *) pm_ops);
+}
+EXPORT_SYMBOL(omap_pm_suspend_set_ops);
+#endif
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 70eb80e..d1bc6a3 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -12,6 +12,7 @@
#define __ARCH_ARM_MACH_OMAP2_PM_H
#include <linux/err.h>
+#include <linux/suspend.h>
#include "powerdomain.h"
@@ -79,6 +80,10 @@ extern u32 sleep_while_idle;
extern unsigned long omap_pm_tick_nohz_get_sleep_length_us(void);
#endif
+#ifdef CONFIG_SUSPEND
+extern void omap_pm_suspend_set_ops(struct platform_suspend_ops *pm_ops);
+#endif
+
#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
extern int pm_dbg_regset_save(int reg_set);
extern int pm_dbg_regset_init(int reg_set);
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index df3ded6..340da03 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -350,14 +350,11 @@ static void omap2_pm_end(void)
enable_hlt();
}
-static const struct platform_suspend_ops omap_pm_ops = {
+static struct platform_suspend_ops omap_pm_ops = {
.begin = omap2_pm_begin,
.enter = omap2_pm_enter,
.end = omap2_pm_end,
- .valid = suspend_valid_only_mem,
};
-#else
-static const struct platform_suspend_ops __initdata omap_pm_ops;
#endif /* CONFIG_SUSPEND */
/* XXX This function should be shareable between OMAP2xxx and OMAP3 */
@@ -515,7 +512,9 @@ static int __init omap2_pm_init(void)
omap24xx_cpu_suspend_sz);
}
- suspend_set_ops(&omap_pm_ops);
+#ifdef CONFIG_SUSPEND
+ omap_pm_suspend_set_ops(&omap_pm_ops);
+#endif
pm_idle = omap2_pm_idle;
return 0;
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 4c80861..967b931 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -609,11 +609,10 @@ static void omap3_pm_end(void)
return;
}
-static const struct platform_suspend_ops omap_pm_ops = {
+static struct platform_suspend_ops omap_pm_ops = {
.begin = omap3_pm_begin,
.end = omap3_pm_end,
.enter = omap3_pm_enter,
- .valid = suspend_valid_only_mem,
};
#endif /* CONFIG_SUSPEND */
@@ -962,7 +961,7 @@ static int __init omap3_pm_init(void)
omap_push_sram_idle();
#ifdef CONFIG_SUSPEND
- suspend_set_ops(&omap_pm_ops);
+ omap_pm_suspend_set_ops(&omap_pm_ops);
#endif /* CONFIG_SUSPEND */
pm_idle = omap3_pm_idle;
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
index 59a870b..3d6b991 100644
--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@ -18,6 +18,7 @@
#include "powerdomain.h"
#include <mach/omap4-common.h>
+#include "pm.h"
struct power_state {
struct powerdomain *pwrdm;
@@ -65,11 +66,10 @@ static void omap4_pm_end(void)
return;
}
-static const struct platform_suspend_ops omap_pm_ops = {
+static struct platform_suspend_ops omap_pm_ops = {
.begin = omap4_pm_begin,
.end = omap4_pm_end,
.enter = omap4_pm_enter,
- .valid = suspend_valid_only_mem,
};
#endif /* CONFIG_SUSPEND */
@@ -112,7 +112,7 @@ static int __init omap4_pm_init(void)
}
#ifdef CONFIG_SUSPEND
- suspend_set_ops(&omap_pm_ops);
+ omap_pm_suspend_set_ops(&omap_pm_ops);
#endif /* CONFIG_SUSPEND */
err2:
--
1.7.4.1
next prev parent reply other threads:[~2011-05-18 17:32 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-18 17:32 [RFC/PATCH 00/13] OMAP2+: PM: isolate PM code in modules jean.pihet
2011-05-18 17:32 ` [PATCH 01/13] perf: export power_start and power_end tracepoints jean.pihet
2011-05-18 17:32 ` [PATCH 02/13] OMAP2+: PM: isolate PM code jean.pihet
2011-05-18 17:32 ` [PATCH 03/13] OMAP2+: PM: clean up usage of SRAM functions jean.pihet
2011-05-26 20:34 ` Kevin Hilman
2011-05-18 17:32 ` [PATCH 04/13] OMAP2+: cpuidle: register the board specific C-states table jean.pihet
2011-05-18 17:32 ` [PATCH 05/13] OMAP2+: PM: move common code from pm-debug.c to pm.c jean.pihet
2011-05-18 17:32 ` [PATCH 06/13] OMAP2+: PM: isolate the scratchpad save function from the PM code jean.pihet
2011-05-18 17:32 ` [PATCH 07/13] OMAP2+: PM: move the powerdomains time stats to powerdomain code jean.pihet
2011-05-26 20:45 ` Kevin Hilman
2011-05-18 17:32 ` [PATCH 08/13] OMAP2+: PM: provide the next timer event API to PM modules jean.pihet
2011-05-19 7:59 ` Santosh Shilimkar
2011-05-19 12:02 ` Jean Pihet
2011-05-26 23:00 ` Kevin Hilman
2011-05-27 7:44 ` Jean Pihet
2011-05-18 17:32 ` jean.pihet [this message]
2011-05-26 23:09 ` [PATCH 09/13] OMAP2+: PM: export suspend_set_ops " Kevin Hilman
2011-05-27 7:48 ` Jean Pihet
2011-05-28 0:28 ` Kevin Hilman
2011-05-18 17:32 ` [PATCH 10/13] OMAP3: PM: export the v7_flush_dcache_all API to modules jean.pihet
2011-05-19 8:04 ` Santosh Shilimkar
2011-05-25 12:21 ` Jean Pihet
2011-05-18 17:32 ` [PATCH 11/13] OMAP2+: PM: implement modules insertion and removal code jean.pihet
2011-05-18 17:32 ` [PATCH 12/13] OMAP2+: PM: export functions and variables to PM modules jean.pihet
2011-05-19 8:32 ` Santosh Shilimkar
2011-05-18 17:32 ` [PATCH 13/13] OMAP2+: PM: build PM functionality as modules jean.pihet
2011-05-31 8:02 ` [RFC/PATCH 00/13] OMAP2+: PM: isolate PM code in modules Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1305739950-11695-10-git-send-email-j-pihet@ti.com \
--to=jean.pihet@newoldbits.com \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).