diff options
author | Govindraj.R <govindraj.raja@ti.com> | 2011-11-09 06:52:30 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-12-14 18:48:08 -0500 |
commit | 8384c9749f8c31c6e1e64a63c8d50af7863ce657 (patch) | |
tree | 2d4b76083fdfdcbd946d8df6973b681c477a7cde /arch/arm/mach-omap2/pm34xx.c | |
parent | 4390f5b2cb1f568c1d4b3e5bbf57158f6809627a (diff) |
ARM: OMAP2+: UART: cleanup + remove uart pm specific API
In preparation to UART runtime conversion remove uart specific calls
from pm24xx/34xx files and their definition from serial.c
These func calls will no more be used with upcoming uart runtime design.
1.) omap_uart_prepare_suspend :- can be taken care with driver suspend hooks.
2.) omap_uart_enable_irqs :- Used to enable/disable uart irq's in suspend
path from PM code, this is removed as same is handled by
uart_suspend_port/uart_resume_port in omap-serial driver which will
do an port_shutdown on suspend freeing irq and port_startup on resume
enabling back irq.
3.) Remove prepare_idle/resume_idle calls used to gate uart clocks.
UART clocks can be gated within driver using runtime funcs
and be woken up using irq_chaining from omap_prm driver.
4.) Remove console_locking from idle path as clock gating is done withing
driver itself with runtime API. Remove is_suspending check used to acquire
console_lock.
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
-rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index fa637dfdda5..4feee45ef06 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/clk.h> | 28 | #include <linux/clk.h> |
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
31 | #include <linux/console.h> | ||
32 | #include <trace/events/power.h> | 31 | #include <trace/events/power.h> |
33 | 32 | ||
34 | #include <asm/suspend.h> | 33 | #include <asm/suspend.h> |
@@ -54,15 +53,6 @@ | |||
54 | 53 | ||
55 | #ifdef CONFIG_SUSPEND | 54 | #ifdef CONFIG_SUSPEND |
56 | static suspend_state_t suspend_state = PM_SUSPEND_ON; | 55 | static suspend_state_t suspend_state = PM_SUSPEND_ON; |
57 | static inline bool is_suspending(void) | ||
58 | { | ||
59 | return (suspend_state != PM_SUSPEND_ON) && console_suspend_enabled; | ||
60 | } | ||
61 | #else | ||
62 | static inline bool is_suspending(void) | ||
63 | { | ||
64 | return false; | ||
65 | } | ||
66 | #endif | 56 | #endif |
67 | 57 | ||
68 | /* pm34xx errata defined in pm.h */ | 58 | /* pm34xx errata defined in pm.h */ |
@@ -376,20 +366,11 @@ void omap_sram_idle(void) | |||
376 | omap3_enable_io_chain(); | 366 | omap3_enable_io_chain(); |
377 | } | 367 | } |
378 | 368 | ||
379 | /* Block console output in case it is on one of the OMAP UARTs */ | ||
380 | if (!is_suspending()) | ||
381 | if (per_next_state < PWRDM_POWER_ON || | ||
382 | core_next_state < PWRDM_POWER_ON) | ||
383 | if (!console_trylock()) | ||
384 | goto console_still_active; | ||
385 | |||
386 | pwrdm_pre_transition(); | 369 | pwrdm_pre_transition(); |
387 | 370 | ||
388 | /* PER */ | 371 | /* PER */ |
389 | if (per_next_state < PWRDM_POWER_ON) { | 372 | if (per_next_state < PWRDM_POWER_ON) { |
390 | per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0; | 373 | per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0; |
391 | omap_uart_prepare_idle(2); | ||
392 | omap_uart_prepare_idle(3); | ||
393 | omap2_gpio_prepare_for_idle(per_going_off); | 374 | omap2_gpio_prepare_for_idle(per_going_off); |
394 | if (per_next_state == PWRDM_POWER_OFF) | 375 | if (per_next_state == PWRDM_POWER_OFF) |
395 | omap3_per_save_context(); | 376 | omap3_per_save_context(); |
@@ -397,8 +378,6 @@ void omap_sram_idle(void) | |||
397 | 378 | ||
398 | /* CORE */ | 379 | /* CORE */ |
399 | if (core_next_state < PWRDM_POWER_ON) { | 380 | if (core_next_state < PWRDM_POWER_ON) { |
400 | omap_uart_prepare_idle(0); | ||
401 | omap_uart_prepare_idle(1); | ||
402 | if (core_next_state == PWRDM_POWER_OFF) { | 381 | if (core_next_state == PWRDM_POWER_OFF) { |
403 | omap3_core_save_context(); | 382 | omap3_core_save_context(); |
404 | omap3_cm_save_context(); | 383 | omap3_cm_save_context(); |
@@ -447,8 +426,6 @@ void omap_sram_idle(void) | |||
447 | omap3_sram_restore_context(); | 426 | omap3_sram_restore_context(); |
448 | omap2_sms_restore_context(); | 427 | omap2_sms_restore_context(); |
449 | } | 428 | } |
450 | omap_uart_resume_idle(0); | ||
451 | omap_uart_resume_idle(1); | ||
452 | if (core_next_state == PWRDM_POWER_OFF) | 429 | if (core_next_state == PWRDM_POWER_OFF) |
453 | omap2_prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF_MASK, | 430 | omap2_prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF_MASK, |
454 | OMAP3430_GR_MOD, | 431 | OMAP3430_GR_MOD, |
@@ -464,14 +441,8 @@ void omap_sram_idle(void) | |||
464 | omap2_gpio_resume_after_idle(); | 441 | omap2_gpio_resume_after_idle(); |
465 | if (per_prev_state == PWRDM_POWER_OFF) | 442 | if (per_prev_state == PWRDM_POWER_OFF) |
466 | omap3_per_restore_context(); | 443 | omap3_per_restore_context(); |
467 | omap_uart_resume_idle(2); | ||
468 | omap_uart_resume_idle(3); | ||
469 | } | 444 | } |
470 | 445 | ||
471 | if (!is_suspending()) | ||
472 | console_unlock(); | ||
473 | |||
474 | console_still_active: | ||
475 | /* Disable IO-PAD and IO-CHAIN wakeup */ | 446 | /* Disable IO-PAD and IO-CHAIN wakeup */ |
476 | if (omap3_has_io_wakeup() && | 447 | if (omap3_has_io_wakeup() && |
477 | (per_next_state < PWRDM_POWER_ON || | 448 | (per_next_state < PWRDM_POWER_ON || |
@@ -533,7 +504,6 @@ static int omap3_pm_suspend(void) | |||
533 | goto restore; | 504 | goto restore; |
534 | } | 505 | } |
535 | 506 | ||
536 | omap_uart_prepare_suspend(); | ||
537 | omap3_intc_suspend(); | 507 | omap3_intc_suspend(); |
538 | 508 | ||
539 | omap_sram_idle(); | 509 | omap_sram_idle(); |
@@ -580,14 +550,12 @@ static int omap3_pm_begin(suspend_state_t state) | |||
580 | { | 550 | { |
581 | disable_hlt(); | 551 | disable_hlt(); |
582 | suspend_state = state; | 552 | suspend_state = state; |
583 | omap_uart_enable_irqs(0); | ||
584 | return 0; | 553 | return 0; |
585 | } | 554 | } |
586 | 555 | ||
587 | static void omap3_pm_end(void) | 556 | static void omap3_pm_end(void) |
588 | { | 557 | { |
589 | suspend_state = PM_SUSPEND_ON; | 558 | suspend_state = PM_SUSPEND_ON; |
590 | omap_uart_enable_irqs(1); | ||
591 | enable_hlt(); | 559 | enable_hlt(); |
592 | return; | 560 | return; |
593 | } | 561 | } |