power: move EXPLICIT_RELAX operation to pm_initialize()
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
d8ebe98c6c
commit
487771033d
@ -70,11 +70,6 @@
|
||||
|
||||
int pm_set_governor(int domain, FAR const struct pm_governor_s *gov)
|
||||
{
|
||||
#if CONFIG_PM_GOVERNOR_EXPLICIT_RELAX
|
||||
int state;
|
||||
int dom;
|
||||
#endif
|
||||
|
||||
if (gov == NULL)
|
||||
{
|
||||
return -EINVAL;
|
||||
@ -93,19 +88,5 @@ int pm_set_governor(int domain, FAR const struct pm_governor_s *gov)
|
||||
g_pmglobals.domain[domain].governor->initialize();
|
||||
}
|
||||
|
||||
#if CONFIG_PM_GOVERNOR_EXPLICIT_RELAX
|
||||
for (dom = 0; dom < CONFIG_PM_NDOMAINS; dom++)
|
||||
{
|
||||
for (state = 0; state < PM_COUNT; state++)
|
||||
{
|
||||
#if CONFIG_PM_GOVERNOR_EXPLICIT_RELAX < 0
|
||||
pm_stay(dom, state);
|
||||
#else
|
||||
pm_staytimeout(dom, state, CONFIG_PM_GOVERNOR_EXPLICIT_RELAX);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -74,6 +74,9 @@ struct pm_global_s g_pmglobals =
|
||||
void pm_initialize(void)
|
||||
{
|
||||
FAR const struct pm_governor_s *gov;
|
||||
#if CONFIG_PM_GOVERNOR_EXPLICIT_RELAX
|
||||
int state;
|
||||
#endif
|
||||
int i;
|
||||
|
||||
pm_wakelock_global_init();
|
||||
@ -93,6 +96,17 @@ void pm_initialize(void)
|
||||
pm_set_governor(i, gov);
|
||||
|
||||
nxrmutex_init(&g_pmglobals.domain[i].lock);
|
||||
|
||||
#if CONFIG_PM_GOVERNOR_EXPLICIT_RELAX
|
||||
for (state = 0; state < PM_COUNT; state++)
|
||||
{
|
||||
# if CONFIG_PM_GOVERNOR_EXPLICIT_RELAX < 0
|
||||
pm_stay(i, state);
|
||||
# else
|
||||
pm_staytimeout(i, state, CONFIG_PM_GOVERNOR_EXPLICIT_RELAX);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user