Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223289
b: refs/heads/master
c: e83df17
h: refs/heads/master
i:
  223287: ab652cb
v: v3
  • Loading branch information
Kevin Hilman authored and Tony Lindgren committed Dec 10, 2010
1 parent bad11fa commit b348f8a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 28dd31983f6c3a4d89369ff8f0c93de2cda868db
refs/heads/master: e83df17f178360a8e7874441bca04a710c869e42
34 changes: 31 additions & 3 deletions trunk/arch/arm/mach-omap2/pm24xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@
#include <plat/powerdomain.h>
#include <plat/clockdomain.h>

#ifdef CONFIG_SUSPEND
static suspend_state_t suspend_state = PM_SUSPEND_ON;
static inline bool is_suspending(void)
{
return (suspend_state != PM_SUSPEND_ON);
}
#else
static inline bool is_suspending(void)
{
return false;
}
#endif

static void (*omap2_sram_idle)(void);
static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl,
void __iomem *sdrc_power);
Expand Down Expand Up @@ -120,8 +133,9 @@ static void omap2_enter_full_retention(void)
goto no_sleep;

/* Block console output in case it is on one of the OMAP UARTs */
if (try_acquire_console_sem())
goto no_sleep;
if (!is_suspending())
if (try_acquire_console_sem())
goto no_sleep;

omap_uart_prepare_idle(0);
omap_uart_prepare_idle(1);
Expand All @@ -136,7 +150,8 @@ static void omap2_enter_full_retention(void)
omap_uart_resume_idle(1);
omap_uart_resume_idle(0);

release_console_sem();
if (!is_suspending())
release_console_sem();

no_sleep:
if (omap2_pm_debug) {
Expand Down Expand Up @@ -284,6 +299,12 @@ static void omap2_pm_idle(void)
local_irq_enable();
}

static int omap2_pm_begin(suspend_state_t state)
{
suspend_state = state;
return 0;
}

static int omap2_pm_prepare(void)
{
/* We cannot sleep in idle until we have resumed */
Expand Down Expand Up @@ -333,10 +354,17 @@ static void omap2_pm_finish(void)
enable_hlt();
}

static void omap2_pm_end(void)
{
suspend_state = PM_SUSPEND_ON;
}

static struct platform_suspend_ops omap_pm_ops = {
.begin = omap2_pm_begin,
.prepare = omap2_pm_prepare,
.enter = omap2_pm_enter,
.finish = omap2_pm_finish,
.end = omap2_pm_end,
.valid = suspend_valid_only_mem,
};

Expand Down
27 changes: 20 additions & 7 deletions trunk/arch/arm/mach-omap2/pm34xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@
#include "sdrc.h"
#include "control.h"

#ifdef CONFIG_SUSPEND
static suspend_state_t suspend_state = PM_SUSPEND_ON;
static inline bool is_suspending(void)
{
return (suspend_state != PM_SUSPEND_ON);
}
#else
static inline bool is_suspending(void)
{
return false;
}
#endif

/* Scratchpad offsets */
#define OMAP343X_TABLE_ADDRESS_OFFSET 0xc4
#define OMAP343X_TABLE_VALUE_OFFSET 0xc0
Expand Down Expand Up @@ -387,10 +400,11 @@ void omap_sram_idle(void)
}

/* Block console output in case it is on one of the OMAP UARTs */
if (per_next_state < PWRDM_POWER_ON ||
core_next_state < PWRDM_POWER_ON)
if (try_acquire_console_sem())
goto console_still_active;
if (!is_suspending())
if (per_next_state < PWRDM_POWER_ON ||
core_next_state < PWRDM_POWER_ON)
if (try_acquire_console_sem())
goto console_still_active;

/* PER */
if (per_next_state < PWRDM_POWER_ON) {
Expand Down Expand Up @@ -470,7 +484,8 @@ void omap_sram_idle(void)
omap_uart_resume_idle(3);
}

release_console_sem();
if (!is_suspending())
release_console_sem();

console_still_active:
/* Disable IO-PAD and IO-CHAIN wakeup */
Expand Down Expand Up @@ -514,8 +529,6 @@ static void omap3_pm_idle(void)
}

#ifdef CONFIG_SUSPEND
static suspend_state_t suspend_state;

static int omap3_pm_prepare(void)
{
disable_hlt();
Expand Down

0 comments on commit b348f8a

Please sign in to comment.