diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2012-05-10 06:02:57 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2012-06-19 18:22:37 -0400 |
commit | 164e0cbf608214bddc4d28e2777f49e7b3a0f65c (patch) | |
tree | 99990a0a737b7f2f40f50f0424db986df4c4c959 /arch/arm | |
parent | a819c4f16d5a2708c11e708fd59a96565c5384a8 (diff) |
ARM: OMAP3/4: consolidate cpuidle Makefile
The current Makefile compiles the cpuidle34xx.c and cpuidle44xx.c files
even if the cpuidle option is not set in the kernel.
This patch fixes this by creating a section in the Makefile where these
files are compiled only if the CONFIG_CPU_IDLE option is set.
This modification breaks an implicit dependency between CPU_IDLE and PM as
they belong to the same block in the Makefile. This is fixed in the Kconfig
by selecting explicitely PM is CPU_IDLE is set.
The linux coding style recommend to use no-op functions in the headers
when the subsystem is disabled instead of adding big section in C files.
This patch fix this also.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/Makefile | 7 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cpuidle34xx.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cpuidle44xx.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm.h | 17 |
5 files changed, 22 insertions, 20 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 4cf5142f22cc..cf84588cd110 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
@@ -35,6 +35,7 @@ config ARCH_OMAP3 | |||
35 | select CPU_V7 | 35 | select CPU_V7 |
36 | select USB_ARCH_HAS_EHCI if USB_SUPPORT | 36 | select USB_ARCH_HAS_EHCI if USB_SUPPORT |
37 | select ARCH_HAS_OPP | 37 | select ARCH_HAS_OPP |
38 | select PM if CPU_IDLE | ||
38 | select PM_OPP if PM | 39 | select PM_OPP if PM |
39 | select ARM_CPU_SUSPEND if PM | 40 | select ARM_CPU_SUSPEND if PM |
40 | select MULTI_IRQ_HANDLER | 41 | select MULTI_IRQ_HANDLER |
@@ -52,6 +53,7 @@ config ARCH_OMAP4 | |||
52 | select PL310_ERRATA_727915 | 53 | select PL310_ERRATA_727915 |
53 | select ARM_ERRATA_720789 | 54 | select ARM_ERRATA_720789 |
54 | select ARCH_HAS_OPP | 55 | select ARCH_HAS_OPP |
56 | select PM if CPU_IDLE | ||
55 | select PM_OPP if PM | 57 | select PM_OPP if PM |
56 | select USB_ARCH_HAS_EHCI if USB_SUPPORT | 58 | select USB_ARCH_HAS_EHCI if USB_SUPPORT |
57 | select ARM_CPU_SUSPEND if PM | 59 | select ARM_CPU_SUSPEND if PM |
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index fa742f3c2629..6be43ac5c35c 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -66,9 +66,7 @@ ifeq ($(CONFIG_PM),y) | |||
66 | obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o | 66 | obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o |
67 | obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o | 67 | obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o |
68 | obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o | 68 | obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o |
69 | obj-$(CONFIG_ARCH_OMAP3) += cpuidle34xx.o | ||
70 | obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o omap-mpuss-lowpower.o | 69 | obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o omap-mpuss-lowpower.o |
71 | obj-$(CONFIG_ARCH_OMAP4) += cpuidle44xx.o | ||
72 | obj-$(CONFIG_PM_DEBUG) += pm-debug.o | 70 | obj-$(CONFIG_PM_DEBUG) += pm-debug.o |
73 | obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o | 71 | obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o |
74 | obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o | 72 | obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o |
@@ -82,6 +80,11 @@ endif | |||
82 | 80 | ||
83 | endif | 81 | endif |
84 | 82 | ||
83 | ifeq ($(CONFIG_CPU_IDLE),y) | ||
84 | obj-$(CONFIG_ARCH_OMAP3) += cpuidle34xx.o | ||
85 | obj-$(CONFIG_ARCH_OMAP4) += cpuidle44xx.o | ||
86 | endif | ||
87 | |||
85 | # PRCM | 88 | # PRCM |
86 | obj-y += prm_common.o | 89 | obj-y += prm_common.o |
87 | obj-$(CONFIG_ARCH_OMAP2) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o | 90 | obj-$(CONFIG_ARCH_OMAP2) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o |
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 207bc1c7759f..31344528eb54 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c | |||
@@ -36,8 +36,6 @@ | |||
36 | #include "control.h" | 36 | #include "control.h" |
37 | #include "common.h" | 37 | #include "common.h" |
38 | 38 | ||
39 | #ifdef CONFIG_CPU_IDLE | ||
40 | |||
41 | /* Mach specific information to be recorded in the C-state driver_data */ | 39 | /* Mach specific information to be recorded in the C-state driver_data */ |
42 | struct omap3_idle_statedata { | 40 | struct omap3_idle_statedata { |
43 | u32 mpu_state; | 41 | u32 mpu_state; |
@@ -379,9 +377,3 @@ int __init omap3_idle_init(void) | |||
379 | 377 | ||
380 | return 0; | 378 | return 0; |
381 | } | 379 | } |
382 | #else | ||
383 | int __init omap3_idle_init(void) | ||
384 | { | ||
385 | return 0; | ||
386 | } | ||
387 | #endif /* CONFIG_CPU_IDLE */ | ||
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c index be1617ca84bd..02d15bbd4e35 100644 --- a/arch/arm/mach-omap2/cpuidle44xx.c +++ b/arch/arm/mach-omap2/cpuidle44xx.c | |||
@@ -22,8 +22,6 @@ | |||
22 | #include "pm.h" | 22 | #include "pm.h" |
23 | #include "prm.h" | 23 | #include "prm.h" |
24 | 24 | ||
25 | #ifdef CONFIG_CPU_IDLE | ||
26 | |||
27 | /* Machine specific information */ | 25 | /* Machine specific information */ |
28 | struct omap4_idle_statedata { | 26 | struct omap4_idle_statedata { |
29 | u32 cpu_state; | 27 | u32 cpu_state; |
@@ -199,9 +197,3 @@ int __init omap4_idle_init(void) | |||
199 | 197 | ||
200 | return 0; | 198 | return 0; |
201 | } | 199 | } |
202 | #else | ||
203 | int __init omap4_idle_init(void) | ||
204 | { | ||
205 | return 0; | ||
206 | } | ||
207 | #endif /* CONFIG_CPU_IDLE */ | ||
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 78564895e914..ab04d3bba2e7 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h | |||
@@ -15,12 +15,25 @@ | |||
15 | 15 | ||
16 | #include "powerdomain.h" | 16 | #include "powerdomain.h" |
17 | 17 | ||
18 | #ifdef CONFIG_CPU_IDLE | ||
19 | extern int __init omap3_idle_init(void); | ||
20 | extern int __init omap4_idle_init(void); | ||
21 | #else | ||
22 | static inline int omap3_idle_init(void) | ||
23 | { | ||
24 | return 0; | ||
25 | } | ||
26 | |||
27 | static inline int omap4_idle_init(void) | ||
28 | { | ||
29 | return 0; | ||
30 | } | ||
31 | #endif | ||
32 | |||
18 | extern void *omap3_secure_ram_storage; | 33 | extern void *omap3_secure_ram_storage; |
19 | extern void omap3_pm_off_mode_enable(int); | 34 | extern void omap3_pm_off_mode_enable(int); |
20 | extern void omap_sram_idle(void); | 35 | extern void omap_sram_idle(void); |
21 | extern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state); | 36 | extern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state); |
22 | extern int omap3_idle_init(void); | ||
23 | extern int omap4_idle_init(void); | ||
24 | extern int omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused); | 37 | extern int omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused); |
25 | extern int (*omap_pm_suspend)(void); | 38 | extern int (*omap_pm_suspend)(void); |
26 | 39 | ||