| 65 | ****************************************************************************/ |
| 66 | |
| 67 | void pm_initialize(void) |
| 68 | { |
| 69 | FAR const struct pm_governor_s *gov; |
| 70 | #if CONFIG_PM_GOVERNOR_EXPLICIT_RELAX |
| 71 | int state; |
| 72 | #endif |
| 73 | int i; |
| 74 | |
| 75 | pm_wakelock_global_init(); |
| 76 | |
| 77 | /* Select governor */ |
| 78 | |
| 79 | for (i = 0; i < CONFIG_PM_NDOMAINS; i++) |
| 80 | { |
| 81 | #if defined(CONFIG_PM_GOVERNOR_GREEDY) |
| 82 | gov = pm_greedy_governor_initialize(); |
| 83 | #elif defined(CONFIG_PM_GOVERNOR_ACTIVITY) |
| 84 | gov = pm_activity_governor_initialize(); |
| 85 | #elif defined(CONFIG_PM_GOVERNOR_STABILITY) |
| 86 | gov = pm_stability_governor_initialize(); |
| 87 | #else |
| 88 | static struct pm_governor_s null; |
| 89 | gov = &null; |
| 90 | #endif |
| 91 | pm_set_governor(i, gov); |
| 92 | |
| 93 | #if defined(CONFIG_PM_PROCFS) |
| 94 | clock_systime_timespec(&g_pmdomains[i].start); |
| 95 | #endif |
| 96 | |
| 97 | spin_lock_init(&g_pmdomains[i].lock); |
| 98 | |
| 99 | #if CONFIG_PM_GOVERNOR_EXPLICIT_RELAX |
| 100 | for (state = 0; state < PM_COUNT; state++) |
| 101 | { |
| 102 | # if CONFIG_PM_GOVERNOR_EXPLICIT_RELAX < 0 |
| 103 | pm_stay(i, state); |
| 104 | # else |
| 105 | pm_staytimeout(i, state, CONFIG_PM_GOVERNOR_EXPLICIT_RELAX); |
| 106 | # endif |
| 107 | } |
| 108 | #endif |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | #endif /* CONFIG_PM */ |
no test coverage detected