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: 1055792 Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7B4vtcQ030543 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 11 Aug 2011 04:58:15 GMT Received: from daredevil.linux-foundation.org (localhost [127.0.0.1]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p7B4ueoL018906; Wed, 10 Aug 2011 21:56:40 -0700 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p7B4tcFb018719 for ; Wed, 10 Aug 2011 21:55:43 -0700 Received: from epcpsbgm2.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 <0LPQ00H8KZ0IC420@mailout1.samsung.com> for linux-pm@lists.linux-foundation.org; Thu, 11 Aug 2011 13:55:40 +0900 (KST) X-AuditID: cbfee61b-b7c3dae000002cb8-c2-4e4360cced9d Received: from epmmp1 ( [203.254.227.16]) by epcpsbgm2.samsung.com (MMPCPMTA) with SMTP id 67.7C.11448.CC0634E4; Thu, 11 Aug 2011 13:55:40 +0900 (KST) Received: from TNRNDGASPAPP1.tn.corp.samsungelectronics.net ([165.213.149.150]) by mmp1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LPQ00AZKZ0SUI@mmp1.samsung.com> for linux-pm@lists.linux-foundation.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 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== Received-SPF: pass (localhost is always allowed.) X-Spam-Status: No, hits=-12.127 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED, SAMSUNG_WEBMAIL_OSDL X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.21 Cc: Kyungmin Park , linux-samsung-soc , linux-pm@lists.linux-foundation.org, linux-arm-kernel Subject: [linux-pm] [PATCH 2/4] ARM: EXYNOS4: Support for generic Clock manipulation PM callbacks X-BeenThere: linux-pm@lists.linux-foundation.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux power management List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 11 Aug 2011 04:58:15 +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);