From: jean.pihet@newoldbits.com (jean.pihet at newoldbits.com)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/6] OMAP2+: omap_hwmod: manage the wake-up latency constraints
Date: Wed, 14 Dec 2011 15:51:40 +0100 [thread overview]
Message-ID: <1323874304-5001-3-git-send-email-j-pihet@ti.com> (raw)
In-Reply-To: <1323874304-5001-1-git-send-email-j-pihet@ti.com>
From: Jean Pihet <j-pihet@ti.com>
The OMAP PM code implements a handler for the per-device PM QoS framework.
The handler queries the omap_hwmod layer in order to manage the power domains
wake-up latency constraints. Hwmod retrieves the correct power domain
and if it exists it calls the corresponding power domain function.
Tested on OMAP3 Beagleboard and OMAP4 Pandaboard in RET/OFF using wake-up
latency constraints on MPU, CORE and PER.
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 27 +++++++++++++++++++++++++-
arch/arm/plat-omap/include/plat/omap_hwmod.h | 2 +
2 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 529142a..c3a4cc4 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -143,6 +143,7 @@
#include "powerdomain.h"
#include <plat/clock.h>
#include <plat/omap_hwmod.h>
+#include <plat/omap_device.h>
#include <plat/prcm.h>
#include "cm2xxx_3xxx.h"
@@ -2616,10 +2617,34 @@ ohsps_unlock:
}
/**
+ * omap_hwmod_set_wkup_constraint- set/release a wake-up latency constraint
+ *
+ * @oh: struct omap_hwmod* to which the target device belongs to.
+ * @cookie: identifier of the constraints list for @oh.
+ * @min_latency: the minimum allowed wake-up latency for @oh.
+ *
+ * Returns 0 upon success, -EINVAL in case of invalid parameters, or
+ * the return value from pwrdm_set_wkup_lat_constraint.
+ */
+int omap_hwmod_set_wkup_lat_constraint(struct omap_hwmod *oh,
+ void *cookie, long min_latency)
+{
+ struct powerdomain *pwrdm = omap_hwmod_get_pwrdm(oh);
+
+ if (!pwrdm) {
+ pr_err("%s: Error: could not find powerdomain "
+ "for %s\n", __func__, oh->name);
+ return -EINVAL;
+ }
+
+ return pwrdm_set_wkup_lat_constraint(pwrdm, cookie, min_latency);
+}
+
+/**
* 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
+ * Query the powerdomain of @oh to get the context loss
* count for this device.
*
* Returns the context loss count of the powerdomain assocated with @oh
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 8b372ed..222f792 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -600,6 +600,8 @@ int omap_hwmod_for_each_by_class(const char *classname,
void *user);
int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
+int omap_hwmod_set_wkup_lat_constraint(struct omap_hwmod *oh, void *cookie,
+ long min_latency);
int omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
--
1.7.5.4
next prev parent reply other threads:[~2011-12-14 14:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-14 14:51 [PATCH v6 0/6] PM QoS: implement the OMAP low level constraints management code jean.pihet at newoldbits.com
2011-12-14 14:51 ` [PATCH 1/6] OMAP2+: powerdomain: control power domains next state jean.pihet at newoldbits.com
2011-12-14 14:51 ` jean.pihet at newoldbits.com [this message]
2011-12-19 21:11 ` [PATCH 2/6] OMAP2+: omap_hwmod: manage the wake-up latency constraints Paul Walmsley
2011-12-14 14:51 ` [PATCH 3/6] OMAP: PM: register to the per-device PM QoS framework jean.pihet at newoldbits.com
2011-12-19 21:12 ` Paul Walmsley
2011-12-14 14:51 ` [PATCH 4/6] OMAP3: cpuidle: next C-state decision depends on the PM QoS MPU and CORE constraints jean.pihet at newoldbits.com
2011-12-14 14:51 ` [PATCH 5/6] OMAP3: update cpuidle latency and threshold figures jean.pihet at newoldbits.com
2011-12-14 14:51 ` [PATCH 6/6] OMAP3: powerdomain data: add wake-up latency figures jean.pihet at newoldbits.com
2011-12-19 21:02 ` [PATCH v6 0/6] PM QoS: implement the OMAP low level constraints management code Paul Walmsley
2012-01-16 19:57 ` Jean Pihet
2012-01-16 20:04 ` Paul Walmsley
2012-01-16 20:22 ` Jean Pihet
2012-01-16 20:08 ` Paul Walmsley
-- strict thread matches above, loose matches on Subject: below --
2011-12-12 16:18 [PATCH v5 " jean.pihet at newoldbits.com
2011-12-12 16:18 ` [PATCH 2/6] OMAP2+: omap_hwmod: manage the wake-up latency constraints jean.pihet at newoldbits.com
2011-12-13 23:46 ` Kevin Hilman
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=1323874304-5001-3-git-send-email-j-pihet@ti.com \
--to=jean.pihet@newoldbits.com \
--cc=linux-arm-kernel@lists.infradead.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).