diff options
author | Olof Johansson <olof@lixom.net> | 2012-03-10 12:08:09 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-03-10 12:08:09 -0500 |
commit | e65bc8918f75620f1668d321b048bfa336ccc0fa (patch) | |
tree | 72ec2d6e5848d7ce3a2f012daf85bc08df43e49d /arch/arm/mach-omap2/pm34xx.c | |
parent | d60d506e6baaf423148c458df3ece0c1d440dce4 (diff) | |
parent | 00fd72ccc928c1fefc4c9c3b925f82cb71750dfb (diff) |
Merge branch 'cleanup-pm' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanup
* 'cleanup-pm' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
ARM: OMAP2+: PM: share some suspend-related functions across OMAP2, 3, 4
ARM: OMAP2+: omap_device: call all suspend, resume callbacks when OMAP_DEVICE_NO_IDLE_ON_SUSPEND is set
ARM: OMAP: omap_device: remove omap_device_parent
ARM: OMAP2+: PM debug: fix the use of debugfs_create_* API
ARM: OMAP2+: PM: share clkdms_setup() across OMAP2, 3, 4
ARM: OMAP2+: PM: clean up omap_set_pwrdm_state()
ARM: OMAP3: PM: remove superfluous calls to pwrdm_clear_all_prev_pwrst()
ARM: OMAP: convert omap_device_build() and callers to __init
ARM: OMAP2+: Mark omap_hsmmc_init and omap_mux related functions as __init
ARM: OMAP2+: Split omap2_hsmmc_init() to properly support I2C GPIO pins
ARM: OMAP: omap_device: Expose omap_device_{alloc, delete, register}
ARM: OMAP: Fix build error when mmc_omap is built as module
ARM: OMAP: Fix kernel panic with HSMMC when twl4030_gpio is a module
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
-rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 74 |
1 files changed, 3 insertions, 71 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 816c7940d301..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 | ||
54 | static 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 */ |
58 | u16 pm34xx_errata; | 54 | u16 pm34xx_errata; |
59 | 55 | ||
@@ -280,11 +276,6 @@ void omap_sram_idle(void) | |||
280 | int core_prev_state, per_prev_state; | 276 | int core_prev_state, per_prev_state; |
281 | u32 sdrc_pwr = 0; | 277 | u32 sdrc_pwr = 0; |
282 | 278 | ||
283 | pwrdm_clear_all_prev_pwrst(mpu_pwrdm); | ||
284 | pwrdm_clear_all_prev_pwrst(neon_pwrdm); | ||
285 | pwrdm_clear_all_prev_pwrst(core_pwrdm); | ||
286 | pwrdm_clear_all_prev_pwrst(per_pwrdm); | ||
287 | |||
288 | mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm); | 279 | mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm); |
289 | switch (mpu_next_state) { | 280 | switch (mpu_next_state) { |
290 | case PWRDM_POWER_ON: | 281 | case PWRDM_POWER_ON: |
@@ -463,50 +454,6 @@ restore: | |||
463 | return ret; | 454 | return ret; |
464 | } | 455 | } |
465 | 456 | ||
466 | static int omap3_pm_enter(suspend_state_t unused) | ||
467 | { | ||
468 | int ret = 0; | ||
469 | |||
470 | switch (suspend_state) { | ||
471 | case PM_SUSPEND_STANDBY: | ||
472 | case PM_SUSPEND_MEM: | ||
473 | ret = omap3_pm_suspend(); | ||
474 | break; | ||
475 | default: | ||
476 | ret = -EINVAL; | ||
477 | } | ||
478 | |||
479 | return ret; | ||
480 | } | ||
481 | |||
482 | /* Hooks to enable / disable UART interrupts during suspend */ | ||
483 | static int omap3_pm_begin(suspend_state_t state) | ||
484 | { | ||
485 | disable_hlt(); | ||
486 | suspend_state = state; | ||
487 | omap_prcm_irq_prepare(); | ||
488 | return 0; | ||
489 | } | ||
490 | |||
491 | static void omap3_pm_end(void) | ||
492 | { | ||
493 | suspend_state = PM_SUSPEND_ON; | ||
494 | enable_hlt(); | ||
495 | return; | ||
496 | } | ||
497 | |||
498 | static void omap3_pm_finish(void) | ||
499 | { | ||
500 | omap_prcm_irq_complete(); | ||
501 | } | ||
502 | |||
503 | static const struct platform_suspend_ops omap_pm_ops = { | ||
504 | .begin = omap3_pm_begin, | ||
505 | .end = omap3_pm_end, | ||
506 | .enter = omap3_pm_enter, | ||
507 | .finish = omap3_pm_finish, | ||
508 | .valid = suspend_valid_only_mem, | ||
509 | }; | ||
510 | #endif /* CONFIG_SUSPEND */ | 457 | #endif /* CONFIG_SUSPEND */ |
511 | 458 | ||
512 | 459 | ||
@@ -727,21 +674,6 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) | |||
727 | } | 674 | } |
728 | 675 | ||
729 | /* | 676 | /* |
730 | * Enable hw supervised mode for all clockdomains if it's | ||
731 | * supported. Initiate sleep transition for other clockdomains, if | ||
732 | * they are not used | ||
733 | */ | ||
734 | static int __init clkdms_setup(struct clockdomain *clkdm, void *unused) | ||
735 | { | ||
736 | if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO) | ||
737 | clkdm_allow_idle(clkdm); | ||
738 | else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && | ||
739 | atomic_read(&clkdm->usecount) == 0) | ||
740 | clkdm_sleep(clkdm); | ||
741 | return 0; | ||
742 | } | ||
743 | |||
744 | /* | ||
745 | * Push functions to SRAM | 677 | * Push functions to SRAM |
746 | * | 678 | * |
747 | * The minimum set of functions is pushed to SRAM for execution: | 679 | * The minimum set of functions is pushed to SRAM for execution: |
@@ -810,7 +742,7 @@ static int __init omap3_pm_init(void) | |||
810 | goto err2; | 742 | goto err2; |
811 | } | 743 | } |
812 | 744 | ||
813 | (void) clkdm_for_each(clkdms_setup, NULL); | 745 | (void) clkdm_for_each(omap_pm_clkdms_setup, NULL); |
814 | 746 | ||
815 | mpu_pwrdm = pwrdm_lookup("mpu_pwrdm"); | 747 | mpu_pwrdm = pwrdm_lookup("mpu_pwrdm"); |
816 | if (mpu_pwrdm == NULL) { | 748 | if (mpu_pwrdm == NULL) { |
@@ -829,8 +761,8 @@ static int __init omap3_pm_init(void) | |||
829 | core_clkdm = clkdm_lookup("core_clkdm"); | 761 | core_clkdm = clkdm_lookup("core_clkdm"); |
830 | 762 | ||
831 | #ifdef CONFIG_SUSPEND | 763 | #ifdef CONFIG_SUSPEND |
832 | suspend_set_ops(&omap_pm_ops); | 764 | omap_pm_suspend = omap3_pm_suspend; |
833 | #endif /* CONFIG_SUSPEND */ | 765 | #endif |
834 | 766 | ||
835 | arm_pm_idle = omap3_pm_idle; | 767 | arm_pm_idle = omap3_pm_idle; |
836 | omap3_idle_init(); | 768 | omap3_idle_init(); |