pm: move wdog from domain to wakelock
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
0ca0c017fd
commit
f7a1c2a585
@ -32,7 +32,6 @@
|
|||||||
#include <nuttx/mutex.h>
|
#include <nuttx/mutex.h>
|
||||||
#include <nuttx/clock.h>
|
#include <nuttx/clock.h>
|
||||||
#include <nuttx/power/pm.h>
|
#include <nuttx/power/pm.h>
|
||||||
#include <nuttx/wdog.h>
|
|
||||||
#include <nuttx/wqueue.h>
|
#include <nuttx/wqueue.h>
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
@ -58,7 +57,6 @@ struct pm_domain_s
|
|||||||
/* The power state lock count */
|
/* The power state lock count */
|
||||||
|
|
||||||
struct dq_queue_s wakelock[PM_COUNT];
|
struct dq_queue_s wakelock[PM_COUNT];
|
||||||
struct wdog_s wdog[PM_COUNT];
|
|
||||||
|
|
||||||
/* Auto update or not */
|
/* Auto update or not */
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ void pm_wakelock_uninit(FAR struct pm_wakelock_s *wakelock)
|
|||||||
domain = wakelock->domain;
|
domain = wakelock->domain;
|
||||||
pdom = &g_pmglobals.domain[domain];
|
pdom = &g_pmglobals.domain[domain];
|
||||||
dq = &pdom->wakelock[wakelock->state];
|
dq = &pdom->wakelock[wakelock->state];
|
||||||
wdog = &pdom->wdog[wakelock->state];
|
wdog = &wakelock->wdog;
|
||||||
|
|
||||||
flags = pm_lock(domain);
|
flags = pm_lock(domain);
|
||||||
|
|
||||||
@ -412,7 +412,7 @@ void pm_wakelock_staytimeout(FAR struct pm_wakelock_s *wakelock, int ms)
|
|||||||
domain = wakelock->domain;
|
domain = wakelock->domain;
|
||||||
pdom = &g_pmglobals.domain[domain];
|
pdom = &g_pmglobals.domain[domain];
|
||||||
dq = &pdom->wakelock[wakelock->state];
|
dq = &pdom->wakelock[wakelock->state];
|
||||||
wdog = &pdom->wdog[wakelock->state];
|
wdog = &wakelock->wdog;
|
||||||
|
|
||||||
flags = pm_lock(domain);
|
flags = pm_lock(domain);
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
#include <nuttx/wdog.h>
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <queue.h>
|
#include <queue.h>
|
||||||
@ -85,8 +86,7 @@
|
|||||||
* own, custom idle loop to support board-specific IDLE time power management
|
* own, custom idle loop to support board-specific IDLE time power management
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define PM_WAKELOCK_INITIALIZER(name, domain, state) \
|
#define PM_WAKELOCK_INITIALIZER(name, domain, state) {name, domain, state}
|
||||||
{{NULL, NULL}, name, domain, state, 0}
|
|
||||||
|
|
||||||
#define PM_WAKELOCK_DECLARE(var, name, domain, state) \
|
#define PM_WAKELOCK_DECLARE(var, name, domain, state) \
|
||||||
struct pm_wakelock_s var = PM_WAKELOCK_INITIALIZER(name, domain, state)
|
struct pm_wakelock_s var = PM_WAKELOCK_INITIALIZER(name, domain, state)
|
||||||
@ -297,11 +297,12 @@ struct pm_user_governor_state_s
|
|||||||
|
|
||||||
struct pm_wakelock_s
|
struct pm_wakelock_s
|
||||||
{
|
{
|
||||||
struct dq_entry_s node;
|
|
||||||
char name[32];
|
char name[32];
|
||||||
int domain;
|
int domain;
|
||||||
enum pm_state_e state;
|
enum pm_state_e state;
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
|
struct dq_entry_s node;
|
||||||
|
struct wdog_s wdog;
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user