From: Pankaj Dubey <pankaj.dubey@samsung.com> To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kgene.kim@samsung.com, linux@arm.linux.org.uk, t.figa@samsung.com, vikas.sajjan@samsung.com, joshi@samsung.com, naushad@samsung.com, thomas.ab@samsung.com, chow.kim@samsung.com, Pankaj Dubey <pankaj.dubey@samsung.com> Subject: [PATCH v7 4/4] ARM: EXYNOS: Move PMU specific definitions from common.h Date: Wed, 09 Jul 2014 09:30:55 +0530 [thread overview] Message-ID: <1404878455-31518-5-git-send-email-pankaj.dubey@samsung.com> (raw) In-Reply-To: <1404878455-31518-1-git-send-email-pankaj.dubey@samsung.com> 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 <pankaj.dubey@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> --- 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 +++++++++++++++++++- 4 files changed, 44 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 47b904b..9019d86 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -132,23 +132,6 @@ extern struct smp_operations exynos_smp_ops; extern void exynos_cpu_die(unsigned int cpu); -/* 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 bcb96be..b2efe8c 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -34,6 +34,7 @@ #include <mach/map.h> #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 5b76728..117f333 100644 --- a/arch/arm/mach-exynos/pmu.c +++ b/arch/arm/mach-exynos/pmu.c @@ -15,9 +15,16 @@ #include <linux/regmap.h> #include <linux/mfd/syscon.h> -#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; @@ -31,8 +38,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 } }, -- 1.7.9.5
WARNING: multiple messages have this Message-ID (diff)
From: pankaj.dubey@samsung.com (Pankaj Dubey) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v7 4/4] ARM: EXYNOS: Move PMU specific definitions from common.h Date: Wed, 09 Jul 2014 09:30:55 +0530 [thread overview] Message-ID: <1404878455-31518-5-git-send-email-pankaj.dubey@samsung.com> (raw) In-Reply-To: <1404878455-31518-1-git-send-email-pankaj.dubey@samsung.com> 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 <pankaj.dubey@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> --- 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 +++++++++++++++++++- 4 files changed, 44 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 47b904b..9019d86 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -132,23 +132,6 @@ extern struct smp_operations exynos_smp_ops; extern void exynos_cpu_die(unsigned int cpu); -/* 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 bcb96be..b2efe8c 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -34,6 +34,7 @@ #include <mach/map.h> #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 5b76728..117f333 100644 --- a/arch/arm/mach-exynos/pmu.c +++ b/arch/arm/mach-exynos/pmu.c @@ -15,9 +15,16 @@ #include <linux/regmap.h> #include <linux/mfd/syscon.h> -#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; @@ -31,8 +38,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 } }, -- 1.7.9.5
next prev parent reply other threads:[~2014-07-09 4:03 UTC|newest] Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-07-09 4:00 [PATCH v7 0/4] ARM: Exynos: PMU cleanup and refactoring for using DT Pankaj Dubey 2014-07-09 4:00 ` Pankaj Dubey 2014-07-09 4:00 ` [PATCH v7 1/4] ARM: EXYNOS: Add support for mapping PMU base address via DT Pankaj Dubey 2014-07-09 4:00 ` Pankaj Dubey 2014-07-10 13:49 ` Kukjin Kim 2014-07-10 13:49 ` Kukjin Kim 2014-07-27 3:33 ` Andreas Färber 2014-07-27 3:33 ` Andreas Färber 2014-07-09 4:00 ` [PATCH v7 2/4] ARM: EXYNOS: Refactored code for using PMU " Pankaj Dubey 2014-07-09 4:00 ` Pankaj Dubey 2014-07-10 13:52 ` Kukjin Kim 2014-07-10 13:52 ` Kukjin Kim 2014-07-09 4:00 ` [PATCH v7 3/4] ARM: EXYNOS: Add platform driver support for Exynos PMU Pankaj Dubey 2014-07-09 4:00 ` Pankaj Dubey 2014-07-25 4:04 ` Kukjin Kim 2014-07-25 4:04 ` Kukjin Kim 2014-07-25 5:32 ` Pankaj Dubey 2014-07-25 5:32 ` Pankaj Dubey 2014-07-25 11:00 ` Tomasz Figa 2014-07-25 11:00 ` Tomasz Figa 2014-07-28 3:10 ` Pankaj Dubey 2014-07-28 3:10 ` Pankaj Dubey 2014-08-18 17:42 ` Bartlomiej Zolnierkiewicz 2014-08-18 17:42 ` Bartlomiej Zolnierkiewicz 2014-08-19 14:30 ` Tomasz Figa 2014-08-19 14:30 ` Tomasz Figa 2014-08-21 14:07 ` Pankaj Dubey 2014-08-21 14:07 ` Pankaj Dubey 2014-08-21 15:59 ` Tomasz Figa 2014-08-21 15:59 ` Tomasz Figa 2014-07-09 4:00 ` Pankaj Dubey [this message] 2014-07-09 4:00 ` [PATCH v7 4/4] ARM: EXYNOS: Move PMU specific definitions from common.h Pankaj Dubey 2014-07-11 6:10 ` [PATCH v7 0/4] ARM: Exynos: PMU cleanup and refactoring for using DT Naveen Krishna Ch 2014-07-11 6:10 ` Naveen Krishna Ch 2014-07-11 6:10 ` Naveen Krishna Ch
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1404878455-31518-5-git-send-email-pankaj.dubey@samsung.com \ --to=pankaj.dubey@samsung.com \ --cc=chow.kim@samsung.com \ --cc=joshi@samsung.com \ --cc=kgene.kim@samsung.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-samsung-soc@vger.kernel.org \ --cc=linux@arm.linux.org.uk \ --cc=naushad@samsung.com \ --cc=t.figa@samsung.com \ --cc=thomas.ab@samsung.com \ --cc=vikas.sajjan@samsung.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.