Skip to content

Commit

Permalink
Merge branch 'for_3.2/pm-cleanup' of git://gitorious.org/khilman/linu…
Browse files Browse the repository at this point in the history
…x-omap-pm into cleanup
  • Loading branch information
Tony Lindgren committed Sep 22, 2011
2 parents 7a04c4c + dca2d0e commit 48b48fc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 40 deletions.
22 changes: 10 additions & 12 deletions arch/arm/mach-omap2/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)

ret = pwrdm_set_next_pwrst(pwrdm, state);
if (ret) {
printk(KERN_ERR "Unable to set state of powerdomain: %s\n",
pwrdm->name);
pr_err("%s: unable to set state of powerdomain: %s\n",
__func__, pwrdm->name);
goto err;
}

Expand All @@ -161,11 +161,11 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
}

/*
* This API is to be called during init to put the various voltage
* This API is to be called during init to set the various voltage
* domains to the voltage as per the opp table. Typically we boot up
* at the nominal voltage. So this function finds out the rate of
* the clock associated with the voltage domain, finds out the correct
* opp entry and puts the voltage domain to the voltage specifies
* opp entry and sets the voltage domain to the voltage specified
* in the opp entry
*/
static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
Expand All @@ -177,21 +177,20 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
unsigned long freq, bootup_volt;

if (!vdd_name || !clk_name || !dev) {
printk(KERN_ERR "%s: Invalid parameters!\n", __func__);
pr_err("%s: invalid parameters\n", __func__);
goto exit;
}

voltdm = omap_voltage_domain_lookup(vdd_name);
if (IS_ERR(voltdm)) {
printk(KERN_ERR "%s: Unable to get vdd pointer for vdd_%s\n",
pr_err("%s: unable to get vdd pointer for vdd_%s\n",
__func__, vdd_name);
goto exit;
}

clk = clk_get(NULL, clk_name);
if (IS_ERR(clk)) {
printk(KERN_ERR "%s: unable to get clk %s\n",
__func__, clk_name);
pr_err("%s: unable to get clk %s\n", __func__, clk_name);
goto exit;
}

Expand All @@ -200,14 +199,14 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,

opp = opp_find_freq_ceil(dev, &freq);
if (IS_ERR(opp)) {
printk(KERN_ERR "%s: unable to find boot up OPP for vdd_%s\n",
pr_err("%s: unable to find boot up OPP for vdd_%s\n",
__func__, vdd_name);
goto exit;
}

bootup_volt = opp_get_voltage(opp);
if (!bootup_volt) {
printk(KERN_ERR "%s: unable to find voltage corresponding"
pr_err("%s: unable to find voltage corresponding "
"to the bootup OPP for vdd_%s\n", __func__, vdd_name);
goto exit;
}
Expand All @@ -216,8 +215,7 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
return 0;

exit:
printk(KERN_ERR "%s: Unable to put vdd_%s to its init voltage\n\n",
__func__, vdd_name);
pr_err("%s: unable to set vdd_%s\n", __func__, vdd_name);
return -EINVAL;
}

Expand Down
27 changes: 0 additions & 27 deletions arch/arm/mach-omap2/pm24xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
#include "powerdomain.h"
#include "clockdomain.h"

static int omap2_pm_debug;

#ifdef CONFIG_SUSPEND
static suspend_state_t suspend_state = PM_SUSPEND_ON;
static inline bool is_suspending(void)
Expand Down Expand Up @@ -96,7 +94,6 @@ static int omap2_fclks_active(void)
static void omap2_enter_full_retention(void)
{
u32 l;
struct timespec ts_preidle, ts_postidle, ts_idle;

/* There is 1 reference hold for all children of the oscillator
* clock, the following will remove it. If no one else uses the
Expand Down Expand Up @@ -124,10 +121,6 @@ static void omap2_enter_full_retention(void)

omap2_gpio_prepare_for_idle(0);

if (omap2_pm_debug) {
getnstimeofday(&ts_preidle);
}

/* One last check for pending IRQs to avoid extra latency due
* to sleeping unnecessarily. */
if (omap_irq_pending())
Expand Down Expand Up @@ -155,13 +148,6 @@ static void omap2_enter_full_retention(void)
console_unlock();

no_sleep:
if (omap2_pm_debug) {
unsigned long long tmp;

getnstimeofday(&ts_postidle);
ts_idle = timespec_sub(ts_postidle, ts_preidle);
tmp = timespec_to_ns(&ts_idle) * NSEC_PER_USEC;
}
omap2_gpio_resume_after_idle();

clk_enable(osc_ck);
Expand Down Expand Up @@ -219,7 +205,6 @@ static int omap2_allow_mpu_retention(void)
static void omap2_enter_mpu_retention(void)
{
int only_idle = 0;
struct timespec ts_preidle, ts_postidle, ts_idle;

/* Putting MPU into the WFI state while a transfer is active
* seems to cause the I2C block to timeout. Why? Good question. */
Expand All @@ -246,19 +231,7 @@ static void omap2_enter_mpu_retention(void)
only_idle = 1;
}

if (omap2_pm_debug) {
getnstimeofday(&ts_preidle);
}

omap2_sram_idle();

if (omap2_pm_debug) {
unsigned long long tmp;

getnstimeofday(&ts_postidle);
ts_idle = timespec_sub(ts_postidle, ts_preidle);
tmp = timespec_to_ns(&ts_idle) * NSEC_PER_USEC;
}
}

static int omap2_can_sleep(void)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/pm34xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
static suspend_state_t suspend_state = PM_SUSPEND_ON;
static inline bool is_suspending(void)
{
return (suspend_state != PM_SUSPEND_ON);
return (suspend_state != PM_SUSPEND_ON) && console_suspend_enabled;
}
#else
static inline bool is_suspending(void)
Expand Down

0 comments on commit 48b48fc

Please sign in to comment.