summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/include
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2012-01-10 15:50:01 +0900
committerPaul Mundt <lethal@linux-sh.org>2012-01-10 16:44:19 +0900
commita662c08260fac126059a148cbd1061e71e806b4a (patch)
tree214ebef2b4a7ec04e17b4897baffbd3e963470bf /arch/arm/mach-shmobile/include
parent77761b63d94bcd04bb3f02b1b52716698202276a (diff)
downloadop-kernel-dev-a662c08260fac126059a148cbd1061e71e806b4a.zip
op-kernel-dev-a662c08260fac126059a148cbd1061e71e806b4a.tar.gz
ARM: mach-shmobile: r8a7779 power domain support V2
Add power domain control support for the r8a7779 SoC V2. This adds support for 4 power domains for I/O Devices together with code that can be used for CPU cores as well. The only out of the ordinary experience is the need for ioremap() of SYSC registers. Because of that we need to execute some init function before setting up the domains. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile/include')
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h1
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7779.h35
2 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index 304ac31..44ce124 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -66,5 +66,6 @@ extern void r8a7779_add_early_devices(void);
extern void r8a7779_add_standard_devices(void);
extern void r8a7779_clock_init(void);
extern void r8a7779_pinmux_init(void);
+extern void r8a7779_pm_init(void);
#endif /* __ARCH_MACH_COMMON_H */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index 60e101a..e6a6166 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -1,6 +1,9 @@
#ifndef __ASM_R8A7779_H__
#define __ASM_R8A7779_H__
+#include <linux/sh_clk.h>
+#include <linux/pm_domain.h>
+
/* Pin Function Controller:
* GPIO_FN_xx - GPIO used to select pin function
* GPIO_GP_x_x - GPIO mapped to real I/O pin on CPU
@@ -322,4 +325,36 @@ enum {
GPIO_FN_GPS_MAG, GPIO_FN_FCE, GPIO_FN_SCK4_B,
};
+struct platform_device;
+
+struct r8a7779_pm_ch {
+ unsigned long chan_offs;
+ unsigned int chan_bit;
+ unsigned int isr_bit;
+};
+
+struct r8a7779_pm_domain {
+ struct generic_pm_domain genpd;
+ struct r8a7779_pm_ch ch;
+};
+
+static inline struct r8a7779_pm_ch *to_r8a7779_ch(struct generic_pm_domain *d)
+{
+ return &container_of(d, struct r8a7779_pm_domain, genpd)->ch;
+}
+
+#ifdef CONFIG_PM
+extern struct r8a7779_pm_domain r8a7779_sh4a;
+extern struct r8a7779_pm_domain r8a7779_sgx;
+extern struct r8a7779_pm_domain r8a7779_vdp1;
+extern struct r8a7779_pm_domain r8a7779_impx3;
+
+extern void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd);
+extern void r8a7779_add_device_to_domain(struct r8a7779_pm_domain *r8a7779_pd,
+ struct platform_device *pdev);
+#else
+#define r8a7779_init_pm_domain(pd) do { } while (0)
+#define r8a7779_add_device_to_domain(pd, pdev) do { } while (0)
+#endif /* CONFIG_PM */
+
#endif /* __ASM_R8A7779_H__ */
OpenPOWER on IntegriCloud