From patchwork Thu Jul 9 15:19:35 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 34827 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n69FNT0E028496 for ; Thu, 9 Jul 2009 15:23:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758029AbZGIPX3 (ORCPT ); Thu, 9 Jul 2009 11:23:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759503AbZGIPX3 (ORCPT ); Thu, 9 Jul 2009 11:23:29 -0400 Received: from wf-out-1314.google.com ([209.85.200.172]:57682 "EHLO wf-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758029AbZGIPX2 (ORCPT ); Thu, 9 Jul 2009 11:23:28 -0400 Received: by wf-out-1314.google.com with SMTP id 26so65459wfd.4 for ; Thu, 09 Jul 2009 08:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=FerT/Venc/XPXr10U2KHtS5L5GCftTneyNuuvq0QEhU=; b=mF3/rTj/Fd4ibTqRlb4Xo0CineqvTAXwjerOXkaoSw5to+cM46/7XiRV+17pLoxrsI Y7MZVJFSMjm5GmI1ac4lWg5IGHPX8O7V3YbNkk7Rs2GI7UjDR8alJGgxz0RqttwY6lHY qoXn1Spw3I3enMa2f0zU+/3Kyv9nVIveXIUac= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=H6JX8uSRp2dZ5fRgwmr/dwJfn1pgGDt/lLS3cHsH9zk4iCNqKc/a8j/Ta7ps9pXhPq qxz3DmkgsSinWPFpMsG22w9fMLtWVhDEzMmTHL9DIi3adKN5AzL+WdthwhF8Ab2WrNPH Tbyey/c3fX1ioAb3dX/BA85sCibuQXfKvbbLo= Received: by 10.142.100.1 with SMTP id x1mr348174wfb.119.1247153008203; Thu, 09 Jul 2009 08:23:28 -0700 (PDT) Received: from rx1.opensource.se (58x80x213x53.ap58.ftth.ucom.ne.jp [58.80.213.53]) by mx.google.com with ESMTPS id 28sm2588650wfg.25.2009.07.09.08.23.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 09 Jul 2009 08:23:26 -0700 (PDT) From: Magnus Damm To: linux-pm@lists.linux-foundation.org Cc: linux-sh@vger.kernel.org, gregkh@suse.de, rjw@sisk.pl, lethal@linux-sh.org, stern@rowland.harvard.edu, pavel@ucw.cz, Magnus Damm Date: Fri, 10 Jul 2009 00:19:35 +0900 Message-Id: <20090709151935.8385.71812.sendpatchset@rx1.opensource.se> In-Reply-To: <20090709151926.8385.92800.sendpatchset@rx1.opensource.se> References: <20090709151926.8385.92800.sendpatchset@rx1.opensource.se> Subject: [PATCH 01/06] Driver Core: Runtime PM callbacks for the Platform Bus Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm This patch adds default Runtime PM callbacks to the dev_pm_ops belonging to the platform bus. The callbacks are weak symbols that architecture specific code may override. Also, call pm_runtime_enable() for the platform bus struct device. Signed-off-by: Magnus Damm --- drivers/base/platform.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/drivers/base/platform.c +++ work/drivers/base/platform.c 2009-06-25 18:58:56.000000000 +0900 @@ -17,6 +17,7 @@ #include #include #include +#include #include "base.h" @@ -925,6 +926,30 @@ static int platform_pm_restore_noirq(str #endif /* !CONFIG_HIBERNATION */ +#ifdef CONFIG_PM_RUNTIME + +int __weak platform_pm_runtime_suspend(struct device *dev) +{ + return -EINVAL; +}; + +int __weak platform_pm_runtime_resume(struct device *dev) +{ + return -EINVAL; +}; + +void __weak platform_pm_runtime_idle(struct device *dev) +{ +}; + +#else /* !CONFIG_PM_RUNTIME */ + +#define platform_pm_runtime_suspend NULL +#define platform_pm_runtime_resume NULL +#define platform_pm_runtime_idle NULL + +#endif /* !CONFIG_PM_RUNTIME */ + static struct dev_pm_ops platform_dev_pm_ops = { .prepare = platform_pm_prepare, .complete = platform_pm_complete, @@ -940,6 +965,9 @@ static struct dev_pm_ops platform_dev_pm .thaw_noirq = platform_pm_thaw_noirq, .poweroff_noirq = platform_pm_poweroff_noirq, .restore_noirq = platform_pm_restore_noirq, + .runtime_suspend = platform_pm_runtime_suspend, + .runtime_resume = platform_pm_runtime_resume, + .runtime_idle = platform_pm_runtime_idle, }; #define PLATFORM_PM_OPS_PTR (&platform_dev_pm_ops) @@ -968,6 +996,9 @@ int __init platform_bus_init(void) error = device_register(&platform_bus); if (error) return error; + + pm_runtime_enable(&platform_bus); + error = bus_register(&platform_bus_type); if (error) device_unregister(&platform_bus);