From patchwork Tue Sep 30 10:21:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Dubey X-Patchwork-Id: 5001921 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DC8E2BEEA6 for ; Tue, 30 Sep 2014 10:26:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 954812020E for ; Tue, 30 Sep 2014 10:26:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C175C201EC for ; Tue, 30 Sep 2014 10:26:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751889AbaI3K03 (ORCPT ); Tue, 30 Sep 2014 06:26:29 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:40002 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751221AbaI3K0V (ORCPT ); Tue, 30 Sep 2014 06:26:21 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NCP00EV7MBTADD0@mailout3.samsung.com>; Tue, 30 Sep 2014 19:26:17 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.126]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 42.2F.11124.9458A245; Tue, 30 Sep 2014 19:26:17 +0900 (KST) X-AuditID: cbfee68e-f79b46d000002b74-1b-542a85492cbc Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id C0.94.09430.9458A245; Tue, 30 Sep 2014 19:26:17 +0900 (KST) Received: from chromebld-server.sisodomain.com ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NCP0079VMBJYW00@mmp2.samsung.com>; Tue, 30 Sep 2014 19:26:17 +0900 (KST) From: Pankaj Dubey To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: kgene.kim@samsung.com, tomasz.figa@gmail.com, linux@arm.linux.org.uk, vikas.sajjan@samsung.com, naushad@samsung.com, thomas.ab@samsung.com, Pankaj Dubey Subject: [PATCH v8 2/2] ARM: EXYNOS: Move PMU specific definitions from common.h Date: Tue, 30 Sep 2014 15:51:21 +0530 Message-id: <1412072481-22370-3-git-send-email-pankaj.dubey@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1412072481-22370-1-git-send-email-pankaj.dubey@samsung.com> References: <1412072481-22370-1-git-send-email-pankaj.dubey@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKLMWRmVeSWpSXmKPExsWyRsSkTtezVSvE4MlUBYveBVfZLDY9vsZq cXnXHDaLGef3MVncvsxr8enof1aLRVu/sFt0LGO0WLXrD6PFzWfbmRy4PFqae9g8ds66y+6x eUm9R9+WVYwenzfJBbBGcdmkpOZklqUW6dslcGX87NjKXHBMvmLyxL0sDYwrpLoYOTkkBEwk 9q5bwA5hi0lcuLeeDcQWEljKKHH+ZwJMzZfj3YxdjFxA8emMEo8/LmOGcCYwSbw70wbWzSag K/Hk/VxmEFtEIFvix7fJLCA2s8BuRom3n8VAbGGBAIk9dw+DbWARUJV49+EBaxcjBwevgIfE 9H8JIKaEgILEnEk2IBWcAp4S/x+9Yoe4x0Piz8abrCBrJQTWsUvMeL6ZHWKMgMS3yYdYIHpl JTYdYIa4WVLi4IobLBMYhRcwMqxiFE0tSC4oTkovMtIrTswtLs1L10vOz93ECAz90/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O93X2dIpYeKygRuIA16xzqkJXr4TmNfCysZYklV1b7KY4L9+t0EJE/5Xp jvTbmybx18xzy4ne6hk0wfb59NDZ5bUTNCw2ZkSmmLaGCebUxL86cn1nkd/ur+I1SizFGYmG WsxFxYkAtV2kBsMCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch moves PMU specific definitions into a new file as exynos-pmu.h. This will help in reducing dependency of common.h in pmu.c. Signed-off-by: Pankaj Dubey Reviewed-by: Tomasz Figa --- arch/arm/mach-exynos/common.h | 17 ----------------- arch/arm/mach-exynos/exynos-pmu.h | 24 ++++++++++++++++++++++++ arch/arm/mach-exynos/pm.c | 1 + arch/arm/mach-exynos/pmu.c | 20 +++++++++++++++++++- arch/arm/mach-exynos/suspend.c | 1 + 5 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 arch/arm/mach-exynos/exynos-pmu.h diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index d4d09bc..431be1b 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -139,23 +139,6 @@ extern void exynos_cpu_resume_ns(void); extern struct smp_operations exynos_smp_ops; -/* PMU(Power Management Unit) support */ - -#define PMU_TABLE_END (-1U) - -enum sys_powerdown { - SYS_AFTR, - SYS_LPA, - SYS_SLEEP, - NUM_SYS_POWERDOWN, -}; - -struct exynos_pmu_conf { - unsigned int offset; - unsigned int val[NUM_SYS_POWERDOWN]; -}; - -extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); extern void exynos_cpu_power_down(int cpu); extern void exynos_cpu_power_up(int cpu); extern int exynos_cpu_power_state(int cpu); diff --git a/arch/arm/mach-exynos/exynos-pmu.h b/arch/arm/mach-exynos/exynos-pmu.h new file mode 100644 index 0000000..a2ab0d5 --- /dev/null +++ b/arch/arm/mach-exynos/exynos-pmu.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * Header for EXYNOS PMU Driver support + * + * 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. + */ + +#ifndef __EXYNOS_PMU_H +#define __EXYNOS_PMU_H + +enum sys_powerdown { + SYS_AFTR, + SYS_LPA, + SYS_SLEEP, + NUM_SYS_POWERDOWN, +}; + +extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); + +#endif /* __EXYNOS_PMU_H */ diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index 4f10fa6..86f3ecd 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -26,6 +26,7 @@ #include #include "common.h" +#include "exynos-pmu.h" #include "regs-pmu.h" #include "regs-sys.h" diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c index 1f5aaa7..87613e0 100644 --- a/arch/arm/mach-exynos/pmu.c +++ b/arch/arm/mach-exynos/pmu.c @@ -13,9 +13,16 @@ #include #include -#include "common.h" +#include "exynos-pmu.h" #include "regs-pmu.h" +#define PMU_TABLE_END (-1U) + +struct exynos_pmu_conf { + unsigned int offset; + unsigned int val[NUM_SYS_POWERDOWN]; +}; + struct exynos_pmu_data { const struct exynos_pmu_conf *pmu_config; const struct exynos_pmu_conf *pmu_config_extra; @@ -29,8 +36,19 @@ struct exynos_pmu_context { const struct exynos_pmu_data *pmu_data; }; +static void __iomem *pmu_base_addr; static struct exynos_pmu_context *pmu_context; +static inline void pmu_raw_writel(u32 val, u32 offset) +{ + __raw_writel(val, pmu_base_addr + offset); +} + +static inline u32 pmu_raw_readl(u32 offset) +{ + return __raw_readl(pmu_base_addr + offset); +} + static const struct exynos_pmu_conf exynos4210_pmu_config[] = { /* { .offset = offset, .val = { AFTR, LPA, SLEEP } */ { S5P_ARM_CORE0_LOWPWR, { 0x0, 0x0, 0x2 } }, diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index f5d9773..079d999 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -33,6 +33,7 @@ #include "common.h" #include "regs-pmu.h" #include "regs-sys.h" +#include "exynos-pmu.h" #define S5P_CHECK_SLEEP 0x00000BAD