Browse Source

pm: policy: fix mocks of CONFIG_PM_POLICY_DEVICE_CONSTRAINTS

The APIs pm_policy_device_power_lock_get and
pm_policy_device_power_lock_put are not mocked properly as they
should be excluded based on CONFIG_PM_POLICY_DEVICE_CONSTRAINTS,
not CONFIG_PM.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
pull/91106/head
Bjarki Arge Andreasen 2 months ago committed by Benjamin Cabé
parent
commit
b642925491
  1. 70
      include/zephyr/pm/policy.h

70
include/zephyr/pm/policy.h

@ -204,32 +204,6 @@ void pm_policy_event_update(struct pm_policy_event *evt, int64_t uptime_ticks); @@ -204,32 +204,6 @@ void pm_policy_event_update(struct pm_policy_event *evt, int64_t uptime_ticks);
*/
void pm_policy_event_unregister(struct pm_policy_event *evt);
/**
* @brief Increase power state locks.
*
* Set power state locks in all power states that disable power in the given
* device.
*
* @param dev Device reference.
*
* @see pm_policy_device_power_lock_put()
* @see pm_policy_state_lock_get()
*/
void pm_policy_device_power_lock_get(const struct device *dev);
/**
* @brief Decrease power state locks.
*
* Remove power state locks in all power states that disable power in the given
* device.
*
* @param dev Device reference.
*
* @see pm_policy_device_power_lock_get()
* @see pm_policy_state_lock_put()
*/
void pm_policy_device_power_lock_put(const struct device *dev);
/**
* @brief Check if a state will disable a device
*
@ -295,22 +269,52 @@ static inline void pm_policy_event_unregister(struct pm_policy_event *evt) @@ -295,22 +269,52 @@ static inline void pm_policy_event_unregister(struct pm_policy_event *evt)
ARG_UNUSED(evt);
}
static inline void pm_policy_device_power_lock_get(const struct device *dev)
static inline int64_t pm_policy_next_event_ticks(void)
{
ARG_UNUSED(dev);
return -1;
}
static inline void pm_policy_device_power_lock_put(const struct device *dev)
#endif /* CONFIG_PM */
#if defined(CONFIG_PM_POLICY_DEVICE_CONSTRAINTS) || defined(__DOXYGEN__)
/**
* @brief Increase power state locks.
*
* Set power state locks in all power states that disable power in the given
* device.
*
* @param dev Device reference.
*
* @see pm_policy_device_power_lock_put()
* @see pm_policy_state_lock_get()
*/
void pm_policy_device_power_lock_get(const struct device *dev);
/**
* @brief Decrease power state locks.
*
* Remove power state locks in all power states that disable power in the given
* device.
*
* @param dev Device reference.
*
* @see pm_policy_device_power_lock_get()
* @see pm_policy_state_lock_put()
*/
void pm_policy_device_power_lock_put(const struct device *dev);
#else
static inline void pm_policy_device_power_lock_get(const struct device *dev)
{
ARG_UNUSED(dev);
}
static inline int64_t pm_policy_next_event_ticks(void)
static inline void pm_policy_device_power_lock_put(const struct device *dev)
{
return -1;
ARG_UNUSED(dev);
}
#endif /* CONFIG_PM */
#endif /* CONFIG_PM_POLICY_DEVICE_CONSTRAINTS */
#if defined(CONFIG_PM) || defined(CONFIG_PM_POLICY_LATENCY_STANDALONE) || defined(__DOXYGEN__)
/**

Loading…
Cancel
Save