aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/include
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2012-01-10 01:50:01 -0500
committerPaul Mundt <lethal@linux-sh.org>2012-01-10 02:44:19 -0500
commita662c08260fac126059a148cbd1061e71e806b4a (patch)
tree214ebef2b4a7ec04e17b4897baffbd3e963470bf /arch/arm/mach-shmobile/include
parent77761b63d94bcd04bb3f02b1b52716698202276a (diff)
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 304ac3115338..44ce124bfdec 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);
66extern void r8a7779_add_standard_devices(void); 66extern void r8a7779_add_standard_devices(void);
67extern void r8a7779_clock_init(void); 67extern void r8a7779_clock_init(void);
68extern void r8a7779_pinmux_init(void); 68extern void r8a7779_pinmux_init(void);
69extern void r8a7779_pm_init(void);
69 70
70#endif /* __ARCH_MACH_COMMON_H */ 71#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 60e101aaea93..e6a6166fdf22 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -1,6 +1,9 @@
1#ifndef __ASM_R8A7779_H__ 1#ifndef __ASM_R8A7779_H__
2#define __ASM_R8A7779_H__ 2#define __ASM_R8A7779_H__
3 3
4#include <linux/sh_clk.h>
5#include <linux/pm_domain.h>
6
4/* Pin Function Controller: 7/* Pin Function Controller:
5 * GPIO_FN_xx - GPIO used to select pin function 8 * GPIO_FN_xx - GPIO used to select pin function
6 * GPIO_GP_x_x - GPIO mapped to real I/O pin on CPU 9 * GPIO_GP_x_x - GPIO mapped to real I/O pin on CPU
@@ -322,4 +325,36 @@ enum {
322 GPIO_FN_GPS_MAG, GPIO_FN_FCE, GPIO_FN_SCK4_B, 325 GPIO_FN_GPS_MAG, GPIO_FN_FCE, GPIO_FN_SCK4_B,
323}; 326};
324 327
328struct platform_device;
329
330struct r8a7779_pm_ch {
331 unsigned long chan_offs;
332 unsigned int chan_bit;
333 unsigned int isr_bit;
334};
335
336struct r8a7779_pm_domain {
337 struct generic_pm_domain genpd;
338 struct r8a7779_pm_ch ch;
339};
340
341static inline struct r8a7779_pm_ch *to_r8a7779_ch(struct generic_pm_domain *d)
342{
343 return &container_of(d, struct r8a7779_pm_domain, genpd)->ch;
344}
345
346#ifdef CONFIG_PM
347extern struct r8a7779_pm_domain r8a7779_sh4a;
348extern struct r8a7779_pm_domain r8a7779_sgx;
349extern struct r8a7779_pm_domain r8a7779_vdp1;
350extern struct r8a7779_pm_domain r8a7779_impx3;
351
352extern void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd);
353extern void r8a7779_add_device_to_domain(struct r8a7779_pm_domain *r8a7779_pd,
354 struct platform_device *pdev);
355#else
356#define r8a7779_init_pm_domain(pd) do { } while (0)
357#define r8a7779_add_device_to_domain(pd, pdev) do { } while (0)
358#endif /* CONFIG_PM */
359
325#endif /* __ASM_R8A7779_H__ */ 360#endif /* __ASM_R8A7779_H__ */