7#ifndef ZEPHYR_INCLUDE_PM_DEVICE_H_ 
    8#define ZEPHYR_INCLUDE_PM_DEVICE_H_ 
  117#define Z_PM_DEVICE_INIT(obj, node_id)                                  \ 
  120                .lock = Z_MUTEX_INITIALIZER(obj.lock),                  \ 
  121                .condvar = Z_CONDVAR_INITIALIZER(obj.condvar),          \ 
  122                .state = PM_DEVICE_STATE_ACTIVE,                        \ 
  123                .flags = ATOMIC_INIT(COND_CODE_1(                       \ 
  124                                DT_NODE_EXISTS(node_id),                \ 
  125                                (DT_PROP_OR(node_id, wakeup_source, 0)),\ 
  126                                (0)) << PM_DEVICE_FLAGS_WS_CAPABLE),    \ 
  182#ifdef CONFIG_PM_DEVICE 
  253#define device_pm_control_nop __DEPRECATED_MACRO NULL 
int atomic_t
Definition: atomic.h:21
 
bool pm_device_wakeup_is_enabled(const struct device *dev)
Check if a power management wakeup source is enabled.
 
static void pm_device_busy_clear(const struct device *dev)
Definition: device.h:227
 
static int device_busy_check(const struct device *dev)
Definition: device.h:247
 
int pm_device_state_set(const struct device *dev, enum pm_device_state state)
Set the power state of a device.
 
static void pm_device_busy_set(const struct device *dev)
Definition: device.h:226
 
pm_device_state
Device power states.
Definition: device.h:28
 
static bool pm_device_is_any_busy(void)
Definition: device.h:228
 
bool pm_device_wakeup_enable(struct device *dev, bool enable)
Enable a power management wakeup source.
 
static int device_any_busy_check(void)
Definition: device.h:242
 
int(* pm_device_control_callback_t)(const struct device *dev, enum pm_device_action action)
Device power management control function callback.
Definition: device.h:139
 
static void device_busy_set(const struct device *dev)
Definition: device.h:232
 
bool pm_device_wakeup_is_capable(const struct device *dev)
Check if a device is wake up capable.
 
const char * pm_device_state_str(enum pm_device_state state)
Get name of device PM state.
 
static void device_busy_clear(const struct device *dev)
Definition: device.h:237
 
pm_device_action
Device PM actions.
Definition: device.h:72
 
pm_device_flag
Device PM flags.
Definition: device.h:55
 
static bool pm_device_is_busy(const struct device *dev)
Definition: device.h:229
 
int pm_device_state_get(const struct device *dev, enum pm_device_state *state)
Obtain the power state of a device.
 
@ PM_DEVICE_STATE_SUSPENDED
Definition: device.h:44
 
@ PM_DEVICE_STATE_OFF
Definition: device.h:51
 
@ PM_DEVICE_STATE_ACTIVE
Definition: device.h:30
 
@ PM_DEVICE_STATE_LOW_POWER
Definition: device.h:37
 
@ PM_DEVICE_ACTION_TURN_OFF
Definition: device.h:78
 
@ PM_DEVICE_ACTION_SUSPEND
Definition: device.h:74
 
@ PM_DEVICE_ACTION_FORCE_SUSPEND
Definition: device.h:80
 
@ PM_DEVICE_ACTION_RESUME
Definition: device.h:76
 
@ PM_DEVICE_ACTION_LOW_POWER
Definition: device.h:82
 
@ PM_DEVICE_FLAGS_WS_ENABLED
Definition: device.h:64
 
@ PM_DEVICE_FLAG_TRANSITIONING
Definition: device.h:66
 
@ PM_DEVICE_FLAGS_WS_CAPABLE
Definition: device.h:62
 
@ PM_DEVICE_FLAG_COUNT
Definition: device.h:68
 
@ PM_DEVICE_FLAG_BUSY
Definition: device.h:57
 
#define EBUSY
Definition: errno.h:55
 
state
Definition: http_parser_state.h:30
 
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
 
Runtime device structure (in ROM) per driver instance.
Definition: device.h:367
 
Definition: kernel.h:2786
 
Definition: kernel.h:2680
 
A structure used to submit work after a delay.
Definition: kernel.h:3651
 
Device PM info.
Definition: device.h:88
 
uint32_t usage
Definition: device.h:99
 
enum pm_device_state state
Definition: device.h:101
 
struct k_mutex lock
Definition: device.h:92
 
struct k_work_delayable work
Definition: device.h:103
 
atomic_t flags
Definition: device.h:97
 
struct k_condvar condvar
Definition: device.h:105
 
const struct device * dev
Definition: device.h:90
 
bool enable
Definition: device.h:95