From patchwork Fri Jun 24 14:38:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 916572 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5OEcgLs019137 for ; Fri, 24 Jun 2011 14:38:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759497Ab1FXOik (ORCPT ); Fri, 24 Jun 2011 10:38:40 -0400 Received: from mail-ww0-f42.google.com ([74.125.82.42]:39770 "EHLO mail-ww0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754136Ab1FXOik (ORCPT ); Fri, 24 Jun 2011 10:38:40 -0400 Received: by wwg11 with SMTP id 11so551237wwg.1 for ; Fri, 24 Jun 2011 07:38:39 -0700 (PDT) Received: by 10.216.15.137 with SMTP id f9mr3054271wef.62.1308926318939; Fri, 24 Jun 2011 07:38:38 -0700 (PDT) Received: from localhost.localdomain (175.96-66-87.adsl-dyn.isp.belgacom.be [87.66.96.175]) by mx.google.com with ESMTPS id g2sm1425972wes.34.2011.06.24.07.38.37 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Jun 2011 07:38:38 -0700 (PDT) From: jean.pihet@newoldbits.com To: "Rafael J. Wysocki" , Paul Walmsley , Kevin Hilman , Magnus Damm , Linux PM mailing list , linux-omap@vger.kernel.org Cc: Jean Pihet Subject: [RFC/PATCH 7/9] OMAP2+: omap_hwmod: manage the wake-up latency constraints Date: Fri, 24 Jun 2011 16:38:04 +0200 Message-Id: <1308926286-30445-8-git-send-email-j-pihet@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1308926286-30445-1-git-send-email-j-pihet@ti.com> References: <1308926286-30445-1-git-send-email-j-pihet@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 24 Jun 2011 14:38:42 +0000 (UTC) From: Jean Pihet Hwmod is queried from the OMAP_PM layer 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 --- arch/arm/mach-omap2/omap_hwmod.c | 26 +++++++++++++++++++++++++- arch/arm/plat-omap/include/plat/omap_hwmod.h | 2 ++ 2 files changed, 27 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 293fa6c..69fa946 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -142,6 +142,7 @@ #include "powerdomain.h" #include #include +#include #include #include "cm2xxx_3xxx.h" @@ -2322,11 +2323,34 @@ ohsps_unlock: return ret; } +/* + * 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. + */ +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 1adea9c..bf9e81d 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h @@ -598,6 +598,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); u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh); int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);