Skip to content

Commit 0255652

Browse files
committed
Merge tag 'omap-for-v5.10/soc-part2-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/soc
One more SoC change for omaps for v5.10 merge window Remove debugfs dependency for enabling off mode during idle for omap3 by enabling it automatically based on the PMIC configuration. * tag 'omap-for-v5.10/soc-part2-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: omap3: enable off mode automatically Link: https://lore.kernel.org/r/pull-1601445968-476435@atomide.com Signed-off-by: Olof Johansson <olof@lixom.net>
2 parents 1d004af + fb2c599 commit 0255652

4 files changed

Lines changed: 27 additions & 7 deletions

File tree

arch/arm/mach-omap2/pm-debug.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
#include "prm2xxx_3xxx.h"
3535
#include "pm.h"
3636

37-
u32 enable_off_mode;
38-
3937
#ifdef CONFIG_DEBUG_FS
4038
#include <linux/debugfs.h>
4139
#include <linux/seq_file.h>

arch/arm/mach-omap2/pm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include "clockdomain.h"
2929
#include "pm.h"
3030

31+
u32 enable_off_mode;
32+
3133
#ifdef CONFIG_SUSPEND
3234
/*
3335
* omap_pm_suspend: points to a function that does the SoC-specific

arch/arm/mach-omap2/pm.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ static inline int omap4_opp_init(void)
4949
extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
5050
extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);
5151

52-
#ifdef CONFIG_PM_DEBUG
5352
extern u32 enable_off_mode;
54-
#else
55-
#define enable_off_mode 0
56-
#endif
5753

5854
#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
5955
extern void pm_dbg_update_time(struct powerdomain *pwrdm, int prev);

arch/arm/mach-omap2/pm34xx.c

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/clk.h>
2626
#include <linux/delay.h>
2727
#include <linux/slab.h>
28+
#include <linux/of.h>
2829
#include <linux/omap-gpmc.h>
2930

3031
#include <trace/events/power.h>
@@ -410,7 +411,12 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
410411
if (!pwrst)
411412
return -ENOMEM;
412413
pwrst->pwrdm = pwrdm;
413-
pwrst->next_state = PWRDM_POWER_RET;
414+
415+
if (enable_off_mode)
416+
pwrst->next_state = PWRDM_POWER_OFF;
417+
else
418+
pwrst->next_state = PWRDM_POWER_RET;
419+
414420
list_add(&pwrst->node, &pwrst_list);
415421

416422
if (pwrdm_has_hdwr_sar(pwrdm))
@@ -444,6 +450,22 @@ static void __init pm_errata_configure(void)
444450
}
445451
}
446452

453+
static void __init omap3_pm_check_pmic(void)
454+
{
455+
struct device_node *np;
456+
457+
np = of_find_compatible_node(NULL, NULL, "ti,twl4030-power-idle");
458+
if (!np)
459+
np = of_find_compatible_node(NULL, NULL, "ti,twl4030-power-idle-osc-off");
460+
461+
if (np) {
462+
of_node_put(np);
463+
enable_off_mode = 1;
464+
} else {
465+
enable_off_mode = 0;
466+
}
467+
}
468+
447469
int __init omap3_pm_init(void)
448470
{
449471
struct power_state *pwrst, *tmp;
@@ -477,6 +499,8 @@ int __init omap3_pm_init(void)
477499
goto err2;
478500
}
479501

502+
omap3_pm_check_pmic();
503+
480504
ret = pwrdm_for_each(pwrdms_setup, NULL);
481505
if (ret) {
482506
pr_err("Failed to setup powerdomains\n");

0 commit comments

Comments
 (0)