diff mbox

[v5,5/5] ARM: EXYNOS: Move PMU specific definitions from common.h

Message ID 1403705032-14835-6-git-send-email-pankaj.dubey@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Pankaj Dubey June 25, 2014, 2:03 p.m. UTC
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>
---
 arch/arm/mach-exynos/common.h     |   17 -----------------
 arch/arm/mach-exynos/exynos-pmu.h |   31 +++++++++++++++++++++++++++++++
 arch/arm/mach-exynos/pm.c         |    1 +
 arch/arm/mach-exynos/pmu.c        |    2 +-
 4 files changed, 33 insertions(+), 18 deletions(-)
 create mode 100644 arch/arm/mach-exynos/exynos-pmu.h

Comments

Tomasz Figa June 30, 2014, 5:15 p.m. UTC | #1
Hi Pankaj,

On 25.06.2014 16:03, Pankaj Dubey wrote:
> 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>
> ---
>  arch/arm/mach-exynos/common.h     |   17 -----------------
>  arch/arm/mach-exynos/exynos-pmu.h |   31 +++++++++++++++++++++++++++++++
>  arch/arm/mach-exynos/pm.c         |    1 +
>  arch/arm/mach-exynos/pmu.c        |    2 +-
>  4 files changed, 33 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 296c6e1..0326ca2 100644
> --- a/arch/arm/mach-exynos/common.h
> +++ b/arch/arm/mach-exynos/common.h
> @@ -135,23 +135,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];
> -};

While at it, I'd say this struct could be moved to pmu.c, along with the
PMU_TABLE_END macro as they are both private to this file.

Best regards,
Tomasz
Pankaj Dubey July 5, 2014, 7:10 a.m. UTC | #2
Hi Tomasz,

On Monday, June 30, 2014 Tomasz Figa wrote:
> Hi Pankaj,
> 
> On 25.06.2014 16:03, Pankaj Dubey wrote:
> > 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>
> > ---
> >  arch/arm/mach-exynos/common.h     |   17 -----------------
> >  arch/arm/mach-exynos/exynos-pmu.h |   31
> +++++++++++++++++++++++++++++++
> >  arch/arm/mach-exynos/pm.c         |    1 +
> >  arch/arm/mach-exynos/pmu.c        |    2 +-
> >  4 files changed, 33 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 296c6e1..0326ca2 100644
> > --- a/arch/arm/mach-exynos/common.h
> > +++ b/arch/arm/mach-exynos/common.h
> > @@ -135,23 +135,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];
> > -};
> 
> While at it, I'd say this struct could be moved to pmu.c, along with the
> PMU_TABLE_END macro as they are both private to this file.
> 

OK, I will update this.

> Best regards,
> Tomasz

Thanks,
Pankaj Dubey
diff mbox

Patch

diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 296c6e1..0326ca2 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -135,23 +135,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..16ff036
--- /dev/null
+++ b/arch/arm/mach-exynos/exynos-pmu.h
@@ -0,0 +1,31 @@ 
+/*
+ * 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
+
+#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);
+
+#endif /* __EXYNOS_PMU_H */
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index 519aefe..de61d48 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 c80a648..ca57a54 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -17,7 +17,7 @@ 
 #include <linux/regmap.h>
 #include <linux/mfd/syscon.h>
 
-#include "common.h"
+#include "exynos-pmu.h"
 #include "regs-pmu.h"
 
 struct exynos_pmu_data {