From patchwork Wed Oct 20 23:38:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 269561 X-Patchwork-Delegate: khilman@deeprootsystems.com 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 o9KNd35S003402 for ; Wed, 20 Oct 2010 23:39:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752460Ab0JTXiv (ORCPT ); Wed, 20 Oct 2010 19:38:51 -0400 Received: from mail-pw0-f46.google.com ([209.85.160.46]:49407 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752112Ab0JTXiv (ORCPT ); Wed, 20 Oct 2010 19:38:51 -0400 Received: by pwj9 with SMTP id 9so99084pwj.19 for ; Wed, 20 Oct 2010 16:38:50 -0700 (PDT) Received: by 10.142.140.15 with SMTP id n15mr96724wfd.247.1287617930782; Wed, 20 Oct 2010 16:38:50 -0700 (PDT) Received: from localhost (c-24-18-179-55.hsd1.wa.comcast.net [24.18.179.55]) by mx.google.com with ESMTPS id y42sm1209980wfd.22.2010.10.20.16.38.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 20 Oct 2010 16:38:50 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Subject: [RFC/PATCH 1/2] OMAP: PM: add "early" idle notifications Date: Wed, 20 Oct 2010 16:38:45 -0700 Message-Id: <1287617926-24308-2-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.7.2.1 In-Reply-To: <1287617926-24308-1-git-send-email-khilman@deeprootsystems.com> References: <1287617926-24308-1-git-send-email-khilman@deeprootsystems.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.3 (demeter1.kernel.org [140.211.167.41]); Wed, 20 Oct 2010 23:39:03 +0000 (UTC) diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 343e8d6..e927419 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c @@ -54,6 +54,33 @@ void omap_idle_notifier_end(void) atomic_notifier_call_chain(&idle_notifier, OMAP_IDLE_END, NULL); } +/* idle notifications early in the idle path (interrupts enabled) */ +static BLOCKING_NOTIFIER_HEAD(early_idle_notifier); + +void omap_early_idle_notifier_register(struct notifier_block *n) +{ + blocking_notifier_chain_register(&early_idle_notifier, n); +} +EXPORT_SYMBOL_GPL(omap_early_idle_notifier_register); + +void omap_early_idle_notifier_unregister(struct notifier_block *n) +{ + blocking_notifier_chain_unregister(&early_idle_notifier, n); +} +EXPORT_SYMBOL_GPL(omap_early_idle_notifier_unregister); + +void omap_early_idle_notifier_start(void) +{ + blocking_notifier_call_chain(&early_idle_notifier, + OMAP_IDLE_START, NULL); +} + +void omap_early_idle_notifier_end(void) +{ + blocking_notifier_call_chain(&early_idle_notifier, + OMAP_IDLE_END, NULL); +} + struct device *omap2_get_mpuss_device(void) { WARN_ON_ONCE(!mpu_dev); diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h index 1ca32cf..1bd57f1 100644 --- a/arch/arm/plat-omap/include/plat/common.h +++ b/arch/arm/plat-omap/include/plat/common.h @@ -106,4 +106,10 @@ extern void omap_idle_notifier_unregister(struct notifier_block *n); extern void omap_idle_notifier_start(void); extern void omap_idle_notifier_end(void); +/* idle notifications early in the idle path (interrupts enabled) */ +extern void omap_early_idle_notifier_register(struct notifier_block *n); +extern void omap_early_idle_notifier_unregister(struct notifier_block *n); +extern void omap_early_idle_notifier_start(void); +extern void omap_early_idle_notifier_end(void); + #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */