From patchwork Thu Aug 11 04:55:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 1055752 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7B4uX1c027164 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 11 Aug 2011 04:56:54 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QrNJd-00053h-Vo; Thu, 11 Aug 2011 04:56:22 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QrNJd-0007Go-CX; Thu, 11 Aug 2011 04:56:21 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QrNJ2-00079w-Do for linux-arm-kernel@lists.infradead.org; Thu, 11 Aug 2011 04:55:45 +0000 Received: from epcpsbgm1.samsung.com (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LPQ00HHYZ0OC820@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 11 Aug 2011 13:55:40 +0900 (KST) X-AuditID: cbfee61a-b7cf0ae000006bc6-db-4e4360cc910f Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id BF.BE.27590.CC0634E4; Thu, 11 Aug 2011 13:55:40 +0900 (KST) Received: from TNRNDGASPAPP1.tn.corp.samsungelectronics.net ([165.213.149.150]) by mmp2.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LPQ00ABWZ0SZ8@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 11 Aug 2011 13:55:40 +0900 (KST) Received: from [127.0.0.1] ([165.213.219.84]) by TNRNDGASPAPP1.tn.corp.samsungelectronics.net with Microsoft SMTPSVC(6.0.3790.4675); Thu, 11 Aug 2011 13:56:15 +0900 Date: Thu, 11 Aug 2011 13:55:17 +0900 From: Chanwoo Choi Subject: [PATCH 2/4] ARM: EXYNOS4: Support for generic Clock manipulation PM callbacks To: Kukjin Kim , "Rafael J. Wysocki" , Russell King - ARM Linux Message-id: <4E4360B5.3050203@samsung.com> MIME-version: 1.0 User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) X-OriginalArrivalTime: 11 Aug 2011 04:56:15.0068 (UTC) FILETIME=[FFAD61C0:01CC57E2] X-Brightmail-Tracker: AAAAAA== X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110811_005544_845275_3079D667 X-CRM114-Status: GOOD ( 22.79 ) X-Spam-Score: -3.1 (---) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-3.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [203.254.224.24 listed in list.dnswl.org] -0.8 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Kyungmin Park , linux-samsung-soc , linux-pm@lists.linux-foundation.org, linux-arm-kernel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 11 Aug 2011 04:56:54 +0000 (UTC) Signed-off-by: Chanwoo Choi Signed-off-by: Kyungmin Park --- arch/arm/mach-exynos4/Makefile | 2 +- arch/arm/mach-exynos4/pm-runtime.c | 56 ++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-exynos4/pm-runtime.c diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile index 97c31ce..28cdb8b 100644 --- a/arch/arm/mach-exynos4/Makefile +++ b/arch/arm/mach-exynos4/Makefile @@ -5,7 +5,7 @@ # # Licensed under GPLv2 -obj-y := +obj-y := pm-runtime.o obj-m := obj-n := obj- := diff --git a/arch/arm/mach-exynos4/pm-runtime.c b/arch/arm/mach-exynos4/pm-runtime.c new file mode 100644 index 0000000..4fe9f73 --- /dev/null +++ b/arch/arm/mach-exynos4/pm-runtime.c @@ -0,0 +1,56 @@ +/* linux/arch/arm/mach-exynos4/pm-runtime.c + + * Exynos4210 Power management support + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_PM_RUNTIME + +static int default_platform_runtime_idle(struct device *dev) +{ + return pm_runtime_suspend(dev); +} + +static struct dev_pm_domain default_pm_domain = { + .ops = { + .runtime_suspend = pm_clk_suspend, + .runtime_resume = pm_clk_resume, + .runtime_idle = default_platform_runtime_idle, + USE_PLATFORM_PM_SLEEP_OPS + }, +}; + +#define DEFAULT_PM_DOMAIN_PTR (&default_pm_domain) + +#else + +#define DEFAULT_PM_DOMAIN_PTR NULL + +#endif /* CONFIG_PM_RUNTIME */ + +static struct pm_clk_notifier_block platform_bus_notifier = { + .pm_domain = DEFAULT_PM_DOMAIN_PTR, + .con_ids = { NULL, }, +}; + +static int __init exynos4_pm_runtime_init(void) +{ + pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier); + return 0; +} +core_initcall(exynos4_pm_runtime_init);