Skip to content

Commit

Permalink
wip: Revert "ARM: omap3: enable off mode automatically"
Browse files Browse the repository at this point in the history
This reverts commit fb2c599.

This commit surfaces problems on the Nokia N900 when the system is
actually in idle mode - causing oopses.
  • Loading branch information
MerlijnWajer authored and IMbackK committed May 31, 2023
1 parent e0486d0 commit 7f08e7f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 27 deletions.
2 changes: 2 additions & 0 deletions arch/arm/mach-omap2/pm-debug.c
Expand Up @@ -34,6 +34,8 @@
#include "prm2xxx_3xxx.h"
#include "pm.h"

u32 enable_off_mode;

#ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h>
#include <linux/seq_file.h>
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-omap2/pm.c
Expand Up @@ -28,8 +28,6 @@
#include "clockdomain.h"
#include "pm.h"

u32 enable_off_mode;

#ifdef CONFIG_SUSPEND
/*
* omap_pm_suspend: points to a function that does the SoC-specific
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/mach-omap2/pm.h
Expand Up @@ -49,7 +49,11 @@ static inline int omap4_opp_init(void)
extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);

#ifdef CONFIG_PM_DEBUG
extern u32 enable_off_mode;
#else
#define enable_off_mode 0
#endif

#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
extern void pm_dbg_update_time(struct powerdomain *pwrdm, int prev);
Expand Down
27 changes: 2 additions & 25 deletions arch/arm/mach-omap2/pm34xx.c
Expand Up @@ -25,7 +25,7 @@
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/omap-gpmc.h>

#include <trace/events/power.h>

Expand Down Expand Up @@ -406,12 +406,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
if (!pwrst)
return -ENOMEM;
pwrst->pwrdm = pwrdm;

if (enable_off_mode)
pwrst->next_state = PWRDM_POWER_OFF;
else
pwrst->next_state = PWRDM_POWER_RET;

pwrst->next_state = PWRDM_POWER_RET;
list_add(&pwrst->node, &pwrst_list);

if (pwrdm_has_hdwr_sar(pwrdm))
Expand Down Expand Up @@ -445,22 +440,6 @@ static void __init pm_errata_configure(void)
}
}

static void __init omap3_pm_check_pmic(void)
{
struct device_node *np;

np = of_find_compatible_node(NULL, NULL, "ti,twl4030-power-idle");
if (!np)
np = of_find_compatible_node(NULL, NULL, "ti,twl4030-power-idle-osc-off");

if (np) {
of_node_put(np);
enable_off_mode = 1;
} else {
enable_off_mode = 0;
}
}

int __init omap3_pm_init(void)
{
struct power_state *pwrst, *tmp;
Expand Down Expand Up @@ -494,8 +473,6 @@ int __init omap3_pm_init(void)
goto err2;
}

omap3_pm_check_pmic();

ret = pwrdm_for_each(pwrdms_setup, NULL);
if (ret) {
pr_err("Failed to setup powerdomains\n");
Expand Down

0 comments on commit 7f08e7f

Please sign in to comment.