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.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEkgNvrZJU/QSQYIcQG9Q+yVyrpXMFAl90IBERHHRvbnlAYXRv
 bWlkZS5jb20ACgkQG9Q+yVyrpXMZzw//SNPyPsLqHVzK2QES9jAHAff8T6yulwSi
 nMDqdM3/I+afvVkkxOebG5wji+/hHIIAfSkqgJ2JoffeN5kbOHOqrPF2ntvaI1RN
 IQejl7ryUT4idQZNfon0SwjqxyixSReONnW8KWHe2GyU9PPHjUCUdf8+7fHrukw7
 1iOKQIPwIV3JSsJWKxoLeEiogr92ulBmaYjSMzOe2Zz3hFsOULpIwiz5o/ngyfOS
 cgkjnuBB+FIqCM/DBImhhgjplGXPdNPNJtRBc47IaxQPDJHmhVZ2oRRsY4Px8Ap0
 zU6j3buvJclNoakpVA/3Kg64rzVVPuJYwil9ip/K5zvgNtLavaomj9ITzAiDvGLO
 rShEL30OLp6p1//W6O2UHCo656KRKuIrx24BSVN/Bj4t/K+oWbwqbeYSt36kyl00
 /Q38nW7+aZxqyPIdt3Upx8b4AGuoN9ZzFJvj2FjSLEvc8xN3pJFTE+/1U6wVkXEH
 sBL37J37UZosUTXvA16MtgWNWyAuFT33HRgkXFfYq5EW02yW6eap+ZPMPU5eml3Q
 inJhpvUSdkQBCv1DnliaWNgRMLf2+1D5WWr6OUgN78u0D60COjCxusKjunj7dOam
 yTmJE9XovhCvbYi4159N74ateyTnZi6Lru7I4aGbQCyBVk51zwmicdVeAP3CQCWB
 suooU0Ma97Q=
 =Ctj7
 -----END PGP SIGNATURE-----

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>
This commit is contained in:
Olof Johansson 2020-10-03 13:15:03 -07:00
commit 025565212d
4 changed files with 27 additions and 7 deletions

View File

@ -34,8 +34,6 @@
#include "prm2xxx_3xxx.h"
#include "pm.h"
u32 enable_off_mode;
#ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h>
#include <linux/seq_file.h>

View File

@ -28,6 +28,8 @@
#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

View File

@ -49,11 +49,7 @@ 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);

View File

@ -25,6 +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>
@ -410,7 +411,12 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
if (!pwrst)
return -ENOMEM;
pwrst->pwrdm = pwrdm;
pwrst->next_state = PWRDM_POWER_RET;
if (enable_off_mode)
pwrst->next_state = PWRDM_POWER_OFF;
else
pwrst->next_state = PWRDM_POWER_RET;
list_add(&pwrst->node, &pwrst_list);
if (pwrdm_has_hdwr_sar(pwrdm))
@ -444,6 +450,22 @@ 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;
@ -477,6 +499,8 @@ 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");