Skip to contentSkip to conversation

ARM: shmobile: r8a7740 without PM domains prototype

PATCH/RFC Magnus Damm 2 participants 2 messages May 11, 2014 – May 12, 2014

Subsystems (4)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

From: Magnus Damm <[email protected]>

This is a prototype patch to allow building r8a7740 for multiplatform when CONFIG_PM_GENERIC_DOMAINS is unset.

It may perhaps be better to simply select PM_GENERIC_DOMAINS for r8a7740 in case of multiplatform. Same applies to sh73a0.

Not for merge. Need to figure out how to do this properly first.

Not-yet-signed-off-by Magnus Damm <[email protected]>

---

 arch/arm/mach-shmobile/include/mach/pm-rmobile.h |    4 ++--
 arch/arm/mach-shmobile/include/mach/r8a7740.h    |    4 ++--
 arch/arm/mach-shmobile/pm-r8a7740.c              |    4 ++--
 arch/arm/mach-shmobile/pm-rmobile.c              |    4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)
arch/arm/mach-shmobile/include/mach/pm-rmobile.h +2 -2
@@ -36,7 +36,7 @@ struct pm_domain_device {
 	struct platform_device *pdev;
 };
 
-#ifdef CONFIG_PM
+#if defined(CONFIG_PM) && defined(CONFIG_PM_GENERIC_DOMAINS)
 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_domai
 
 static inline void rmobile_add_devices_to_domains(struct pm_domain_device d[],
 						  int size) {}
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM && CONFIG_PM_GENERIC_DOMAINS */
 
 #endif /* PM_RMOBILE_H */
arch/arm/mach-shmobile/include/mach/r8a7740.h +2 -2
@@ -56,10 +56,10 @@ extern void r8a7740_clock_init(u8 md_ck)
 extern void r8a7740_pinmux_init(void);
 extern void r8a7740_pm_init(void);
 
-#ifdef CONFIG_PM
+#if defined(CONFIG_PM) && defined(CONFIG_PM_GENERIC_DOMAINS)
 extern void __init r8a7740_init_pm_domains(void);
 #else
 static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM && CONFIG_PM_GENERIC_DOMAINS */
 
 #endif /* __ASM_R8A7740_H__ */
arch/arm/mach-shmobile/pm-r8a7740.c +2 -2
@@ -13,7 +13,7 @@
 #include <mach/pm-rmobile.h>
 #include <mach/common.h>
 
-#ifdef CONFIG_PM
+#if defined(CONFIG_PM) && defined(CONFIG_PM_GENERIC_DOMAINS)
 static int r8a7740_pd_a4s_suspend(void)
 {
 	/*
@@ -59,7 +59,7 @@ void __init r8a7740_init_pm_domains(void
 	pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
 
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM && CONFIG_PM_GENERIC_DOMAINS */
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/pm-rmobile.c +2 -2
@@ -27,7 +27,7 @@
 #define PSTR_RETRIES	100
 #define PSTR_DELAY_US	10
 
-#ifdef CONFIG_PM
+#if defined(CONFIG_PM) && defined(CONFIG_PM_GENERIC_DOMAINS)
 static int rmobile_pd_power_down(struct generic_pm_domain *genpd)
 {
 	struct rmobile_pm_domain *rmobile_pd = to_rmobile_pd(genpd);
@@ -183,4 +183,4 @@ void rmobile_add_devices_to_domains(stru
 		rmobile_add_device_to_domain_td(data[j].domain_name,
 						data[j].pdev, &latencies);
 }
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM && CONFIG_PM_GENERIC_DOMAINS */
#1 lore raw

Hi Magnus,

Quoted 5 lines · Magnus Damm

This is a prototype patch to allow building r8a7740 for multiplatform when CONFIG_PM_GENERIC_DOMAINS is unset.

It may perhaps be better to simply select PM_GENERIC_DOMAINS for r8a7740 in case of multiplatform. Same applies to sh73a0.

Samsung S3C64XX, Exynos4, and Exynos 5250/5420 do something similar.

Review

Quoted 2 lines
(quoted diff) +1 -1
-#ifdef CONFIG_PM
+#if defined(CONFIG_PM) && defined(CONFIG_PM_GENERIC_DOMAINS)

Doesn't PM_GENERIC_DOMAINS depend on PM, so you can just test for PM_GENERIC_DOMAINS here?

Ah, you must have some additional changes to your Kconfig files to enable PM_GENERIC_DOMAINS?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds