Skip to content

Commit acca447

Browse files
Flavio Ceolinmbolivar-nordic
authored andcommitted
pm: device: Use pm flags to mark a power domain
Add a new flag that is used to tell whether or not a device is a power domain. In order to a device be identified as a power domain the node has to be compatible with "power-domain". Signed-off-by: Flavio Ceolin <[email protected]>
1 parent 605d785 commit acca447

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

include/zephyr/pm/device.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ enum pm_device_flag {
4141
PM_DEVICE_FLAG_RUNTIME_ENABLED,
4242
/** Indicates if the device pm is locked. */
4343
PM_DEVICE_FLAG_STATE_LOCKED,
44+
/** Indicateds if the device is used as a power domain */
45+
PM_DEVICE_FLAG_PD,
4446
};
4547

4648
/** @endcond */
@@ -176,8 +178,10 @@ struct pm_device {
176178
.state = PM_DEVICE_STATE_ACTIVE, \
177179
.flags = ATOMIC_INIT(COND_CODE_1( \
178180
DT_NODE_EXISTS(node_id), \
179-
(DT_PROP_OR(node_id, wakeup_source, 0)),\
180-
(0)) << PM_DEVICE_FLAG_WS_CAPABLE), \
181+
((DT_PROP_OR(node_id, wakeup_source, 0) \
182+
<< PM_DEVICE_FLAG_WS_CAPABLE) | \
183+
(DT_NODE_HAS_COMPAT(node_id, power_domain) << \
184+
PM_DEVICE_FLAG_PD)), (0))), \
181185
Z_PM_DEVICE_POWER_DOMAIN_INIT(node_id) \
182186
}
183187

0 commit comments

Comments
 (0)