aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pm34xx.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-27 19:03:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-27 19:03:32 -0400
commitd61b7a572b292e2be409e13b4b3adf475f18fb29 (patch)
treee9d30390860147136c05e66abf1edda1bc5b0562 /arch/arm/mach-omap2/pm34xx.c
parent18d9946bc7e2252fe3c0f2f609ac383c627edefd (diff)
parentf4e2467bad53023589cbff18dd1ab6e0aa3f004c (diff)
Merge tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull "ARM: global cleanups" from Arnd Bergmann: "Quite a bit of code gets removed, and some stuff moved around, mostly the old samsung s3c24xx stuff. There should be no functional changes in this series otherwise. Some cleanups have dependencies on other arm-soc branches and will be sent in the second round. Signed-off-by: Arnd Bergmann <arnd@arndb.de>" Fixed up trivial conflicts mainly due to #include's being changes on both sides. * tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (121 commits) ep93xx: Remove unnecessary includes of ep93xx-regs.h ep93xx: Move EP93XX_SYSCON defines to SoC private header ep93xx: Move crunch code to mach-ep93xx directory ep93xx: Make syscon access functions private to SoC ep93xx: Configure GPIO ports in core code ep93xx: Move peripheral defines to local SoC header ep93xx: Convert the watchdog driver into a platform device. ep93xx: Use ioremap for backlight driver ep93xx: Move GPIO defines to gpio-ep93xx.h ep93xx: Don't use system controller defines in audio drivers ep93xx: Move PHYS_BASE defines to local SoC header file ARM: EXYNOS: Add clock register addresses for EXYNOS4X12 bus devfreq driver ARM: EXYNOS: add clock registers for exynos4x12-cpufreq PM / devfreq: update the name of EXYNOS clock registers that were omitted PM / devfreq: update the name of EXYNOS clock register ARM: EXYNOS: change the prefix S5P_ to EXYNOS4_ for clock ARM: EXYNOS: use static declaration on regarding clock ARM: EXYNOS: replace clock.c for other new EXYNOS SoCs ARM: OMAP2+: Fix build error after merge ARM: S3C24XX: remove call to s3c24xx_setup_clocks ...
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
-rw-r--r--arch/arm/mach-omap2/pm34xx.c88
1 files changed, 3 insertions, 85 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index b77df735fa6c..027a537d72b2 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -50,10 +50,6 @@
50#include "sdrc.h" 50#include "sdrc.h"
51#include "control.h" 51#include "control.h"
52 52
53#ifdef CONFIG_SUSPEND
54static suspend_state_t suspend_state = PM_SUSPEND_ON;
55#endif
56
57/* pm34xx errata defined in pm.h */ 53/* pm34xx errata defined in pm.h */
58u16 pm34xx_errata; 54u16 pm34xx_errata;
59 55
@@ -75,16 +71,6 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
75static struct powerdomain *core_pwrdm, *per_pwrdm; 71static struct powerdomain *core_pwrdm, *per_pwrdm;
76static struct powerdomain *cam_pwrdm; 72static struct powerdomain *cam_pwrdm;
77 73
78static inline void omap3_per_save_context(void)
79{
80 omap_gpio_save_context();
81}
82
83static inline void omap3_per_restore_context(void)
84{
85 omap_gpio_restore_context();
86}
87
88static void omap3_enable_io_chain(void) 74static void omap3_enable_io_chain(void)
89{ 75{
90 int timeout = 0; 76 int timeout = 0;
@@ -290,11 +276,6 @@ void omap_sram_idle(void)
290 int core_prev_state, per_prev_state; 276 int core_prev_state, per_prev_state;
291 u32 sdrc_pwr = 0; 277 u32 sdrc_pwr = 0;
292 278
293 pwrdm_clear_all_prev_pwrst(mpu_pwrdm);
294 pwrdm_clear_all_prev_pwrst(neon_pwrdm);
295 pwrdm_clear_all_prev_pwrst(core_pwrdm);
296 pwrdm_clear_all_prev_pwrst(per_pwrdm);
297
298 mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm); 279 mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
299 switch (mpu_next_state) { 280 switch (mpu_next_state) {
300 case PWRDM_POWER_ON: 281 case PWRDM_POWER_ON:
@@ -332,8 +313,6 @@ void omap_sram_idle(void)
332 if (per_next_state < PWRDM_POWER_ON) { 313 if (per_next_state < PWRDM_POWER_ON) {
333 per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0; 314 per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0;
334 omap2_gpio_prepare_for_idle(per_going_off); 315 omap2_gpio_prepare_for_idle(per_going_off);
335 if (per_next_state == PWRDM_POWER_OFF)
336 omap3_per_save_context();
337 } 316 }
338 317
339 /* CORE */ 318 /* CORE */
@@ -399,8 +378,6 @@ void omap_sram_idle(void)
399 if (per_next_state < PWRDM_POWER_ON) { 378 if (per_next_state < PWRDM_POWER_ON) {
400 per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm); 379 per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm);
401 omap2_gpio_resume_after_idle(); 380 omap2_gpio_resume_after_idle();
402 if (per_prev_state == PWRDM_POWER_OFF)
403 omap3_per_restore_context();
404 } 381 }
405 382
406 /* Disable IO-PAD and IO-CHAIN wakeup */ 383 /* Disable IO-PAD and IO-CHAIN wakeup */
@@ -477,50 +454,6 @@ restore:
477 return ret; 454 return ret;
478} 455}
479 456
480static int omap3_pm_enter(suspend_state_t unused)
481{
482 int ret = 0;
483
484 switch (suspend_state) {
485 case PM_SUSPEND_STANDBY:
486 case PM_SUSPEND_MEM:
487 ret = omap3_pm_suspend();
488 break;
489 default:
490 ret = -EINVAL;
491 }
492
493 return ret;
494}
495
496/* Hooks to enable / disable UART interrupts during suspend */
497static int omap3_pm_begin(suspend_state_t state)
498{
499 disable_hlt();
500 suspend_state = state;
501 omap_prcm_irq_prepare();
502 return 0;
503}
504
505static void omap3_pm_end(void)
506{
507 suspend_state = PM_SUSPEND_ON;
508 enable_hlt();
509 return;
510}
511
512static void omap3_pm_finish(void)
513{
514 omap_prcm_irq_complete();
515}
516
517static const struct platform_suspend_ops omap_pm_ops = {
518 .begin = omap3_pm_begin,
519 .end = omap3_pm_end,
520 .enter = omap3_pm_enter,
521 .finish = omap3_pm_finish,
522 .valid = suspend_valid_only_mem,
523};
524#endif /* CONFIG_SUSPEND */ 457#endif /* CONFIG_SUSPEND */
525 458
526 459
@@ -741,21 +674,6 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
741} 674}
742 675
743/* 676/*
744 * Enable hw supervised mode for all clockdomains if it's
745 * supported. Initiate sleep transition for other clockdomains, if
746 * they are not used
747 */
748static int __init clkdms_setup(struct clockdomain *clkdm, void *unused)
749{
750 if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO)
751 clkdm_allow_idle(clkdm);
752 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP &&
753 atomic_read(&clkdm->usecount) == 0)
754 clkdm_sleep(clkdm);
755 return 0;
756}
757
758/*
759 * Push functions to SRAM 677 * Push functions to SRAM
760 * 678 *
761 * The minimum set of functions is pushed to SRAM for execution: 679 * The minimum set of functions is pushed to SRAM for execution:
@@ -824,7 +742,7 @@ static int __init omap3_pm_init(void)
824 goto err2; 742 goto err2;
825 } 743 }
826 744
827 (void) clkdm_for_each(clkdms_setup, NULL); 745 (void) clkdm_for_each(omap_pm_clkdms_setup, NULL);
828 746
829 mpu_pwrdm = pwrdm_lookup("mpu_pwrdm"); 747 mpu_pwrdm = pwrdm_lookup("mpu_pwrdm");
830 if (mpu_pwrdm == NULL) { 748 if (mpu_pwrdm == NULL) {
@@ -843,8 +761,8 @@ static int __init omap3_pm_init(void)
843 core_clkdm = clkdm_lookup("core_clkdm"); 761 core_clkdm = clkdm_lookup("core_clkdm");
844 762
845#ifdef CONFIG_SUSPEND 763#ifdef CONFIG_SUSPEND
846 suspend_set_ops(&omap_pm_ops); 764 omap_pm_suspend = omap3_pm_suspend;
847#endif /* CONFIG_SUSPEND */ 765#endif
848 766
849 arm_pm_idle = omap3_pm_idle; 767 arm_pm_idle = omap3_pm_idle;
850 omap3_idle_init(); 768 omap3_idle_init();