ARM: shmobile: Cleanup pm-rmobile.o build using Kconfig
authorMagnus Damm <damm+renesas@opensource.se>
Mon, 25 Aug 2014 03:04:01 +0000 (12:04 +0900)
committerSimon Horman <horms+renesas@verge.net.au>
Tue, 2 Sep 2014 00:32:06 +0000 (09:32 +0900)
Add a CONFIG_PM_RMOBILE entry and enable it for R-Mobile
SoCs in case CONFIG_PM is set. Consolidate Makefile power
management objects and get rid of #ifdefs in the C code.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
arch/arm/mach-shmobile/Kconfig
arch/arm/mach-shmobile/Makefile
arch/arm/mach-shmobile/pm-rmobile.c
arch/arm/mach-shmobile/pm-rmobile.h

index cd13021cda5f74415cc7e6186173c9e75c67950f..9295776ce13650654d97b3d6bc5b685c5562b4bf 100644 (file)
@@ -4,6 +4,9 @@ config ARCH_SHMOBILE
 config PM_RCAR
        bool
 
+config PM_RMOBILE
+       bool
+
 config ARCH_RCAR_GEN1
        bool
        select PM_RCAR if PM || SMP
@@ -18,6 +21,7 @@ config ARCH_RCAR_GEN2
 
 config ARCH_RMOBILE
        bool
+       select PM_RMOBILE if PM
        select SYS_SUPPORTS_SH_CMT
        select SYS_SUPPORTS_SH_TMU
 
index c9ad16910f0a3c41ab2d558838c35de1c9e6f7a7..7b259ce60bebbbdc912f6f6c937ca48d9c127863 100644 (file)
@@ -8,10 +8,10 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/arch/arm/mach-shmobile/incl
 obj-y                          := timer.o console.o
 
 # CPU objects
-obj-$(CONFIG_ARCH_SH7372)      += setup-sh7372.o intc-sh7372.o
-obj-$(CONFIG_ARCH_SH73A0)      += setup-sh73a0.o intc-sh73a0.o
+obj-$(CONFIG_ARCH_SH7372)      += setup-sh7372.o intc-sh7372.o pm-sh7372.o
+obj-$(CONFIG_ARCH_SH73A0)      += setup-sh73a0.o intc-sh73a0.o pm-sh73a0.o
 obj-$(CONFIG_ARCH_R8A73A4)     += setup-r8a73a4.o
-obj-$(CONFIG_ARCH_R8A7740)     += setup-r8a7740.o
+obj-$(CONFIG_ARCH_R8A7740)     += setup-r8a7740.o pm-r8a7740.o
 obj-$(CONFIG_ARCH_R8A7778)     += setup-r8a7778.o
 obj-$(CONFIG_ARCH_R8A7779)     += setup-r8a7779.o pm-r8a7779.o
 obj-$(CONFIG_ARCH_R8A7790)     += setup-r8a7790.o pm-r8a7790.o
@@ -52,12 +52,10 @@ obj-$(CONFIG_SUSPEND)               += suspend.o
 obj-$(CONFIG_CPU_IDLE)         += cpuidle.o
 obj-$(CONFIG_CPU_FREQ)         += cpufreq.o
 obj-$(CONFIG_PM_RCAR)          += pm-rcar.o
-obj-$(CONFIG_ARCH_SH7372)      += pm-sh7372.o sleep-sh7372.o pm-rmobile.o
-obj-$(CONFIG_ARCH_SH73A0)      += pm-sh73a0.o
-obj-$(CONFIG_ARCH_R8A7740)     += pm-r8a7740.o pm-rmobile.o
+obj-$(CONFIG_PM_RMOBILE)       += pm-rmobile.o
 
-# IRQ objects
-obj-$(CONFIG_ARCH_SH7372)      += entry-intc.o
+# special sh7372 handling for IRQ objects and low level sleep code
+obj-$(CONFIG_ARCH_SH7372)      += entry-intc.o sleep-sh7372.o
 
 # Board objects
 ifdef CONFIG_ARCH_SHMOBILE_MULTI
index ebdd16e94a84f5d674f691edfc99e6712d7cee28..a88079af7914afe0db35514b558d13e952c36e88 100644 (file)
@@ -27,7 +27,6 @@
 #define PSTR_RETRIES   100
 #define PSTR_DELAY_US  10
 
-#ifdef CONFIG_PM
 static int rmobile_pd_power_down(struct generic_pm_domain *genpd)
 {
        struct rmobile_pm_domain *rmobile_pd = to_rmobile_pd(genpd);
@@ -151,4 +150,3 @@ void rmobile_add_devices_to_domains(struct pm_domain_device data[],
                rmobile_add_device_to_domain_td(data[j].domain_name,
                                                data[j].pdev, &latencies);
 }
-#endif /* CONFIG_PM */
index 690553a06887897a6c29ffb396ba60bafb29be8e..8f66b343162b041145241429c766d4fefec88c71 100644 (file)
@@ -36,7 +36,7 @@ struct pm_domain_device {
        struct platform_device *pdev;
 };
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_RMOBILE
 extern void rmobile_init_domains(struct rmobile_pm_domain domains[], int num);
 extern void rmobile_add_device_to_domain_td(const char *domain_name,
                                            struct platform_device *pdev,
@@ -58,6 +58,6 @@ extern void rmobile_add_devices_to_domains(struct pm_domain_device data[],
 
 static inline void rmobile_add_devices_to_domains(struct pm_domain_device d[],
                                                  int size) {}
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM_RMOBILE */
 
 #endif /* PM_RMOBILE_H */