From patchwork Mon Jul 11 23:29:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 966812 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 p6BNTZAh022522 for ; Mon, 11 Jul 2011 23:29:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758555Ab1GKX3n (ORCPT ); Mon, 11 Jul 2011 19:29:43 -0400 Received: from na3sys009aog110.obsmtp.com ([74.125.149.203]:42685 "EHLO na3sys009aog110.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758502Ab1GKX3m (ORCPT ); Mon, 11 Jul 2011 19:29:42 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]) (using TLSv1) by na3sys009aob110.postini.com ([74.125.148.12]) with SMTP ID DSNKThuHZnLHutKBiMcg06lfoCuZOO2gCBkd@postini.com; Mon, 11 Jul 2011 16:29:42 PDT Received: by mail-iy0-f174.google.com with SMTP id 12so5836239iyb.33 for ; Mon, 11 Jul 2011 16:29:42 -0700 (PDT) Received: by 10.42.29.196 with SMTP id s4mr5903215icc.163.1310426981933; Mon, 11 Jul 2011 16:29:41 -0700 (PDT) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net [24.19.7.36]) by mx.google.com with ESMTPS id d6sm14360303icx.13.2011.07.11.16.29.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jul 2011 16:29:41 -0700 (PDT) From: Kevin Hilman To: "Rafael J. Wysocki" , Paul Walmsley , linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-pm@lists.linux-foundation.org Subject: [PATCH 3/4] OMAP: PM: omap_device: add API to disable idle on suspend Date: Mon, 11 Jul 2011 16:29:28 -0700 Message-Id: <1310426969-30306-4-git-send-email-khilman@ti.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1310426969-30306-1-git-send-email-khilman@ti.com> References: <1310426969-30306-1-git-send-email-khilman@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]); Mon, 11 Jul 2011 23:29:43 +0000 (UTC) By default, omap_devices will be automatically idled on suspend (and re-enabled on resume.) Using this new API, device init code can disable this feature if desired. NOTE: any driver/device that has been runtime PM converted should not be using this API. Signed-off-by: Kevin Hilman --- arch/arm/plat-omap/include/plat/omap_device.h | 5 +++++ arch/arm/plat-omap/omap_device.c | 6 ++++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h index bc36d05..ee405b36 100644 --- a/arch/arm/plat-omap/include/plat/omap_device.h +++ b/arch/arm/plat-omap/include/plat/omap_device.h @@ -46,6 +46,7 @@ extern struct device omap_device_parent; /* omap_device.flags values */ #define OMAP_DEVICE_SUSPENDED BIT(0) +#define OMAP_DEVICE_NO_IDLE_ON_SUSPEND BIT(1) /** * struct omap_device - omap_device wrapper for platform_devices @@ -121,6 +122,10 @@ int omap_device_enable_hwmods(struct omap_device *od); int omap_device_disable_clocks(struct omap_device *od); int omap_device_enable_clocks(struct omap_device *od); +static inline void omap_device_disable_idle_on_suspend(struct omap_device *od) +{ + od->flags |= OMAP_DEVICE_NO_IDLE_ON_SUSPEND; +} /* * Entries should be kept in latency order ascending diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index b93cfdc..2526fa3 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -573,6 +573,9 @@ static int _od_suspend_noirq(struct device *dev) struct omap_device *od = to_omap_device(pdev); int ret; + if (od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND) + return pm_generic_suspend_noirq(dev); + ret = pm_generic_suspend_noirq(dev); if (!ret && !pm_runtime_status_suspended(dev)) { @@ -590,6 +593,9 @@ static int _od_resume_noirq(struct device *dev) struct platform_device *pdev = to_platform_device(dev); struct omap_device *od = to_omap_device(pdev); + if (od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND) + return pm_generic_resume_noirq(dev); + if ((od->flags & OMAP_DEVICE_SUSPENDED) && !pm_runtime_status_suspended(dev)) { od->flags &= ~OMAP_DEVICE_SUSPENDED;