From patchwork Wed Mar 30 15:19:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 674391 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2UFJZfJ002041 for ; Wed, 30 Mar 2011 15:19:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754812Ab1C3PTj (ORCPT ); Wed, 30 Mar 2011 11:19:39 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:46038 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754785Ab1C3PTi (ORCPT ); Wed, 30 Mar 2011 11:19:38 -0400 Received: by wya21 with SMTP id 21so1176228wya.19 for ; Wed, 30 Mar 2011 08:19:37 -0700 (PDT) Received: by 10.227.207.7 with SMTP id fw7mr1407305wbb.137.1301498377755; Wed, 30 Mar 2011 08:19:37 -0700 (PDT) Received: from localhost.localdomain (245.207-245-81.adsl-dyn.isp.belgacom.be [81.245.207.245]) by mx.google.com with ESMTPS id w25sm104997wbd.39.2011.03.30.08.19.36 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Mar 2011 08:19:37 -0700 (PDT) From: jean.pihet@newoldbits.com To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , paul@pwsan.com Cc: Jean Pihet Subject: [PATCH 4/8] OMAP2+: omap_hwmod: manage the omap_devices the wake-up latency constraints Date: Wed, 30 Mar 2011 17:19:20 +0200 Message-Id: <1301498364-726-5-git-send-email-j-pihet@ti.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1301498364-726-1-git-send-email-j-pihet@ti.com> References: <1301498364-726-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 (demeter1.kernel.org [140.211.167.41]); Wed, 30 Mar 2011 15:19:40 +0000 (UTC) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index e034294..62de888 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 (!PTR_ERR(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);